Add prefix length validation for CIDR ranges in isIpInRange#17
Merged
Conversation
…nges Co-authored-by: devnomadic <14085319+devnomadic@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] WIP address feedback on worker AI bindings
Add prefix length validation for CIDR ranges in isIpInRange
Dec 28, 2025
🚀 PR Status Dashboard📊 Workflow Status✅ CI: success (view) 🌐 Preview EnvironmentsSPA Preview: https://copilot-sub-pr-16.albatross-5kt.pages.dev 📝 PR DetailsBranch: This comment is automatically updated by the PR Update workflow |
devnomadic
added a commit
that referenced
this pull request
Dec 28, 2025
* Update deployment configuration for preview environment and ensure AI binding is set correctly * Add API page for IP analysis and reputation checking; update home page logo for December * Fix casing for AI reputation property in API response * Implement API response handling and create results page * Enhance API response handling with HTML output and cloud provider support; remove legacy API results page * Update API page to support HTML output and enhance syntax highlighting; fix cloud provider parameter casing * Improve Azure manifest search logging and error handling; validate CIDR format and prefix length * Fix JSON output highlighting in API page and adjust manifest URL casing * Enhance JSON highlighting in API page by moving highlight logic to JS function and invoking it after rendering * Enhance API documentation and UI; add interactive mode for IP analysis, improve error handling, and update styles * Add API hostname selection and enhance response display in API page * Enable workers_dev for production and preview environments in wrangler.toml * Update cloudflare-worker.template.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update cloudflare-worker.template.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update cloudflare-worker.template.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update cloudflare-worker.template.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update cloudflare-worker.template.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update wwwroot/openapi.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update wwwroot/js/json-highlight.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add prefix length validation for CIDR ranges in isIpInRange (#17) * Initial plan * Add prefix length validation for IPv4 (0-32) and IPv6 (0-128) CIDR ranges Co-authored-by: devnomadic <14085319+devnomadic@users.noreply.github.com> * Fix whitespace formatting in AbuseIPDBService.cs --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devnomadic <14085319+devnomadic@users.noreply.github.com> Co-authored-by: Drew Kennedy <drewkenn@gmail.com> * Update IP manifest filenames to lowercase and adjust last modified dates in sitemap * Refactor code structure for improved readability and maintainability * Add environment-based base URL and set ENVIRONMENT variables for production and preview --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: devnomadic <14085319+devnomadic@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
isIpInRangefunction validated prefix parsing but not range bounds, allowing invalid values like/33for IPv4 or/129for IPv6 to pass through to bitwise operations.Changes:
Example:
Validation occurs after NaN check and before IP version matching, preventing incorrect subnet mask calculations from
(0xFFFFFFFF << (32 - prefixLength))with out-of-bounds prefix values.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.