Repository navigation
Conversation
brendanh-katalyst
left a comment
There was a problem hiding this comment.
The changes look to be what is needed to solve the stack overflow issue behind vuln CVE-2026-93687
|
Any ETA on getting this merged and release? |
I sent an email to the developers that can approve, but no answer so far in the past 9 days. |
|
+1 on this also, it's getting on to being 2 weeks+ on this |
…ide added GHSA-vfj7-8cjw-p6xm / CVE-2026-93687 (braces, stack-overflow DoS in its recursive AST walkers): no patched version exists upstream as of 2026-10-02. pnpm audit's own "Patched versions: >=3.0.4" claim is stale/wrong — confirmed directly against the npm registry (3.0.3 is genuinely dist-tags.latest) and GitHub's own Advisory API (first_patched_version: null), and against the upstream repo (an open fix PR, micromatch/braces#72, and open issues explicitly confirming no fixed release exists). No override added — there's no patched version to pin to, so one would be a no-op, not a fix. Traced the actual code path instead: @manypkg/get-packages (reached only via @changesets/cli, dev-only, never shipped) feeds micromatch/braces only this repo's own pnpm-workspace.yaml packages list — trusted, repo-owner-controlled config, not external input an attacker could supply without already having repo write access. Documented in §3.1 as the first real instance of a new pattern (what to do when no patch exists at all), and added to §3.2's scheduled-maintenance list to check again at the next refresh pass. The Dependabot alert itself is left open, not dismissed — that's a call for whoever owns the repo's security settings, not something to do unilaterally. Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
Downstream follow-up: our application is blocked by GHSA-vfj7-8cjw-p6xm through Tailwind and Next ESLint dependency paths. We independently validated a minimal depth-guard backport against the published 3.0.3 release suite (all 764 tests pass unchanged on Node 24), plus excessive string/direct-AST depth, 100/101 boundaries, malformed/escaped inputs and glob/watch consumer checks. We retained original advisory visibility rather than treating package renaming as remediation. Is there a plan or ETA for reviewing this PR and publishing an official patched release? A release would let downstream consumers retire any temporary maintained patch without a broad toolchain migration. Thanks. |
|
While validating this fix, I found a fractional I prepared a focused correction and regression tests for both braces and parentheses. It passes the full existing suite (900 tests). The contribution targets this PR's source branch: FSDevelop#1 The change is small and keeps the parser's documented numeric limit consistent with the recursive walkers. Please incorporate it into this security fix if you agree. |
|
Thanks for this fix. I'm using it in a fork while it waits for review, and found one behaviour change in The recursive call now passes the current node as output += stringify(child, node, child.nodes ? depth + 1 : depth);Before, it passed no parent ( const braces = require('braces');
braces.stringify(braces.parse('{{a}}'), { escapeInvalid: true });
// 3.0.3: '{{a}}'
// this PR: '\\{\\{a\\}\\}'The same happens with output += stringify(child, undefined, child.nodes ? depth + 1 : depth);With that change, and a regression test for the five patterns above, the suite passes (900 tests) and the depth limit still stops the stack overflow. The commit is pillarsdotnet@31d783e, if you'd like to pick it up. |
|
I evaluated the depth guards from PR #72 at The PR also changes the recursive const braces = require('braces');
console.log(braces.stringify('{1..8}', { escapeInvalid: true }));
// Published 3.0.3: {1..8}
// PR HEAD: \{1..8\}For a narrow 3.0.3 backport experiment, I applied only this PR's five output += stringify(child, {}, child.nodes ? depth + 1 : depth);This is a local derivative, not an assertion that the unmodified PR passes these compatibility checks. On Node 22.20.0 / linux-amd64, with network disabled during tests:
The full upstream HEAD suite separately passed 899 tests, but HEAD includes unreleased parser behavior; that result is distinct from the narrow backport results above. Expansion cardinality, AST width and malformed parent cycles remain outside this depth-only evaluation. No application-wide compatibility or production deployment is claimed. Could the parent-propagation behavior change be separated or explicitly covered/documented, and could a fixed release be published after review? A local patch still leaves downstream version-based audit findings unresolved while the installed package is identified as affected 3.0.3. We are preserving the audit gate rather than suppressing it. |
|
预计何时能合并并发布? 着急 赶紧发布 |
Summary
Fixes CVE-2026-93687 and closes #70.
Attacker-controlled, deeply nested brace patterns can exhaust the JavaScript call stack in recursive AST walkers while remaining within the existing input-length limit. This PR adds a bounded nesting limit to parsing and recursive AST processing.
Fix
compile,expand, andstringifyso caller-supplied ASTs also receive depth checks.maxDepthvalues, including fractional limits, while capping larger values at 100.stringifybehavior withescapeInvalid: true.maxDepthand add regression coverage for excessive depth, fractional limits, stringify compatibility, and parent cycles.doesNotThrowin the Node 8.3 assertion shim, fixing the test compatibility issue introduced by the original depth-limit test.The follow-up changes from FSDevelop#1, FSDevelop#2, and FSDevelop#3 are included.
Verification
At commit
28d440b5dd449dbf1fe6f3506cf94ecca4d02660:assert.doesNotThrow is not a functionfailures; both now pass.git diff --checkpasses.These results cover the two Node versions and Windows environment listed above.