Skip to content

fix: Validate CIDR masks in IP configuration - #10641

Open
mukeshr06 wants to merge 1 commit into
parse-community:alphafrom
mukeshr06:fix/validate-cidr-mask
Open

fix: Validate CIDR masks in IP configuration#10641
mukeshr06 wants to merge 1 commit into
parse-community:alphafrom
mukeshr06:fix/validate-cidr-mask

Conversation

@mukeshr06

@mukeshr06 mukeshr06 commented Aug 22, 2026

Copy link
Copy Markdown

Pull Request

Issue

Closes #10640.

Approach

  • Validate a CIDR mask instead of discarding it before IP validation.
  • Require decimal digits only and enforce the IPv4 (0–32) and IPv6 (0–128) boundaries.
  • Reject empty masks, extra separators, whitespace, fractions, exponent/hex/binary forms, negative masks, and out-of-range masks.
  • Add focused regression coverage for malformed masks, valid boundaries, and rejection through the server configuration path.

Tasks

  • Add tests

Validation

  • Focused CIDR specs: 2 passed
  • Full ESLint suite: passed
  • Babel build: 197 files compiled successfully

@parse-github-assistant

Copy link
Copy Markdown

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant Bot changed the title fix: validate CIDR masks in IP configuration fix: Validate CIDR masks in IP configuration Aug 22, 2026
@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cb79f84-389b-42b2-8b59-905800ec1dbd

📥 Commits

Reviewing files that changed from the base of the PR and between 315e157 and 20a31cb.

📒 Files selected for processing (2)
  • spec/index.spec.js
  • src/Config.js

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Config.validateIps now validates CIDR masks for IPv4 and IPv6 addresses. Tests cover malformed masks, startup rejection, and valid boundary masks.

Changes

CIDR validation

Layer / File(s) Summary
Validate CIDR masks
src/Config.js, spec/index.spec.js
Config.validateIps validates CIDR syntax and IP-version-specific limits. Tests cover invalid masks, startup rejection, and valid /0, /32, and /128 masks.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 20a31

The change is limited to CIDR-mask validation and tests, with no identified user or production impact that would block merging; it is merge-ready after normal checks.

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed The diff only adds bounded CIDR validation before BlockList use; published masterKeyIps IP-spoofing path is unchanged, and no changed code matches a listed vulnerability pattern.
Engage In Review Feedback ✅ Passed GitHub API shows no review submissions or inline review comments; only automated welcome and review-processing comments exist, so no review feedback required engagement.
Title check ✅ Passed The title uses the allowed "fix:" prefix and clearly describes CIDR mask validation.
Description check ✅ Passed The description includes the required issue, approach, and tasks sections, with tests and validation results documented.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

masterKeyIps never validates the CIDR mask

1 participant