Repository navigation
Lower the schema pattern input bound to 128 characters; changeset and notes for 0.4.6 - #372
Merged
Merged
Conversation
… notes for 0.4.6 The 0.4.5 CI gate failed on Windows / Node 22: a pattern the guard accepts took about 550 ms against a 500 ms bound. At 128 characters the worst accepted patterns cost about 7 times less. Nothing was published for 0.4.3 to 0.4.5. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This was referenced Sep 21, 2026
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 0.4.5 release stopped at the CI gate: on windows-latest / Node 22,
accepted patterns stay fast on adversarial input at the length cap (ReDoS bound)failed twice (^\w+\w+\w+$ took 577 ms, then 539 ms, against a 500 ms bound); it passes on every other leg. Nothing was tagged or published; npm is at 0.4.2.The guard allows up to three unbounded quantifiers, which are polynomial (cubic) on the input cap. Lowering
maxPatternInputLengthfrom 256 to 128 (the maintainer chose this option) makes the worst accepted patterns about 7 times cheaper: about 25 ms to about 3.7 ms locally, so roughly 75 ms on that runner. The test bound stays at 500 ms. A schema that setspatternnow needsmaxLengthof at most 128; this is an unreleased feature. Updated: pattern-guard, tests, docs/HTTP.md, the body-validation example.Also adds the 0.4.6 changeset (0.4.3 to 0.4.5 were never published) and marks the 0.4.3, 0.4.4 and 0.4.5 release notes accordingly.
npm run verifypasses.🤖 Generated with Claude Code