Repository navigation
Prevent stack exhaustion in deeply nested braces patterns - #425
Merged
Merged
Conversation
Co-authored-by: lisagorewitdecker <50784106+lisagorewitdecker@users.noreply.github.com>
Co-authored-by: lisagorewitdecker <50784106+lisagorewitdecker@users.noreply.github.com>
Co-authored-by: lisagorewitdecker <50784106+lisagorewitdecker@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
lisagorewitdecker
October 7, 2026 20:44
View session
lisagorewitdecker
marked this pull request as ready for review
October 7, 2026 20:44
lisagorewitdecker
self-requested a review
October 7, 2026 20:45
lisagorewitdecker
approved these changes
Oct 7, 2026
Contributor
There was a problem hiding this comment.
🟢 Approved
The mitigation, lockfile metadata, and regression coverage are consistent and complete.
0 open findings
What changed in this PR
Adds a pnpm dependency patch that limits braces@3.0.3 recursion depth and rejects cyclic AST parent chains.
Changes:
- Caps parsing and AST traversal depth at 100.
- Updates pnpm patch metadata and lockfile references.
- Adds security regression tests to the unit suite.
| File | Description |
|---|---|
patches/braces@3.0.3.patch |
Implements parser and AST recursion safeguards. |
pnpm-workspace.yaml |
Registers the braces patch. |
pnpm-lock.yaml |
Records patch hash and patched snapshot. |
scripts/tests/braces-security-patch.test.mjs |
Tests normal use, excessive depth, and cycles. |
package.json |
Adds the regression tests to test:unit. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: lisagorewitdecker <50784106+lisagorewitdecker@users.noreply.github.com>
Co-authored-by: lisagorewitdecker <50784106+lisagorewitdecker@users.noreply.github.com>
auto-merge was automatically disabled
October 7, 2026 20:52
Head branch was pushed to by a user without write access
lisagorewitdecker
approved these changes
Oct 7, 2026
Co-authored-by: lisagorewitdecker <50784106+lisagorewitdecker@users.noreply.github.com>
Co-authored-by: lisagorewitdecker <50784106+lisagorewitdecker@users.noreply.github.com>
lisagorewitdecker
approved these changes
Oct 7, 2026
lisagorewitdecker
enabled auto-merge
October 7, 2026 21:52
lisagorewitdecker
approved these changes
Oct 8, 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.
Summary
The transitive
braces@3.0.3parser allows deeply nested patterns that can exhaust the stack during recursive AST processing. This change caps nesting and AST traversal at 100 and rejects cyclic expansion parent chains.bracesthrough pnpm’s patched-dependency mechanism and update the lockfile.API compatibility
API_BREAKING_CHANGE_JUSTIFICATION:
API_BREAKING_CHANGE_MIGRATION_PLAN: