fix: remove numeric regex backtracking - #81
Conversation
|
Warning Review limit reachedNext included review available in 12 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
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. Comment |
There was a problem hiding this comment.
This PR successfully eliminates a regex backtracking vulnerability by replacing the NUMBER_PATTERN regex with a bounded linear-time parser. The new _is_decimal_number_string() function correctly prevents catastrophic backtracking attacks while maintaining the existing conversion contract. The implementation and test coverage look solid.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7400a35cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
|
|
||
|
|
||
| def _is_decimal_number_string(value: str) -> bool: |
There was a problem hiding this comment.
Preserve the documented NUMBER_PATTERN export
NUMBER_PATTERN was a non-underscored constant explicitly listed in this module’s documentation, so consumers may import it directly from extended_data.primitives.types; replacing it outright with this private helper makes those imports fail after a patch upgrade. Retain and deprecate a compatible public matcher while using the bounded parser internally, or defer removal to a breaking release.
Useful? React with 👍 / 👎.



Summary
Validation
tox -e lint,typecheck,py311,py312,py313,py314,examples,docs,build,auditpnpm --dir docs validateactionlint .github/workflows/*.ymluv lock --check