Repository navigation
fix: bound single-branch repeated wildcard extglobs - #269
Open
loomlogic-io wants to merge 1 commit into
Open
loomlogic-io wants to merge 1 commit into
loomlogic-io wants to merge 1 commit into
Conversation
|
I'd really like to see this PR merged. This issue is quite blocking on my side, so having a fix for it would make a real difference. The approach looks promising, and I appreciate the work put into the regression tests and compatibility safeguards. Hopefully a maintainer can review and approve it soon. I'd be happy to see this included in an official release! Thanks for working on this! |
This was referenced Nov 18, 2026
|
Both GitHub and VulnCheck have withdrawn this advisory, as it is not a security issue. If a tool is still reporting you're "vulnerable", then you need to contact the tool author about getting their source updated. |
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.
A single-branch repeated wildcard such as
+(*a)nests an unbounded wildcard inside an unbounded repeat. The stock 4.0.7 parser times out on a 50,001-character negative match in an isolated child process.This proposal removes the redundant outer repetition when the branch is closed under concatenation over non-separator characters:
+(X)becomes oneX, and*(X)becomes an optionalX. Complex wildcard bodies, capture/contains modes, raw-regex mode and surrounding capture contexts use the existing literal safeguard instead. The wildcard check remains active whenmaxExtglobRecursionis disabled; that option's behavior for other extglob forms is unchanged. Parsed collapsed states reject capture/contains changes atcompileRe, so callers must reparse with those options.Validation:
npm testpasses 2,003 tests on Node 26.12.1/macOS arm64. All 1,998 existing tests are unchanged. Five added tests cover exhaustive short-input matching comparisons, Windows separators/Unicode/escaped stars, literal fallbacks, parse/compile option changes, and 50,001-character attacks across ten option configurations in 64 MB children with one-second deadlines. The stock 4.0.7 attack reproduces the timeout.git diff --checkpasses.Compatibility and scope: guarded complex patterns can match literally, and changing capture/contains after parsing a collapsed expression throws a
SyntaxError. This is a focused proposal for the reported repeated-wildcard class, not a general proof against every possible regex ambiguity; broader extglob ambiguity and existing opt-outs for other forms need separate review. Please review the compatibility policy and CVE coverage before an official release.Related advisory: GHSA-fc5q-39xc-vjpf (CVE-2026-112366). No package version is changed and no official npm release is claimed.