fix: upgrade shell-quote and brace-expansion (Dependabot #34, #35) - #82
Merged
Merged
Conversation
…erts - shell-quote: pin override to 1.9.0 (fixes O(n^2) DoS in parse(), alert #34) - brace-expansion: pin new override to 1.1.17 (fixes exponential-time DoS in expand() for consecutive non-expanding {} groups, alert #35) Both are transitive deps via npm-run-all -> shell-quote and npm-run-all -> minimatch -> brace-expansion (devDependencies only). Verified with npm install and npm audit (0 vulnerabilities).
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
Resolves two Dependabot alerts for transitive devDependencies pulled in via
npm-run-all:shell-quote<= 1.8.4:parse()usesArray.prototype.concatin areduce, making it O(n²) in token count. A ~256KB input can block the event
loop for ~57s. Fixed by pinning the override to
1.9.0, which replaces thequadratic reduce with a linear push-based flatten.
brace-expansion< 1.1.16:expand()recurses intopostbeforeits early-return branches, causing O(2ⁿ) behavior on consecutive
non-expanding
{}groups (~90 byte input can hang for minutes). Added anew override pinned to
1.1.17(the 1.1.16 fix still had a separate highseverity DoS via unbounded expansion length, flagged by
npm audit, which1.1.17 resolves).
Both packages are only reachable through devDependencies
(
npm-run-all -> shell-quote,npm-run-all -> minimatch -> brace-expansion),so there's no production/runtime exposure, but Dependabot flags them and
they're cheap to fix.
Pinned to exact patched versions rather than open ranges (e.g.
>=1.1.16)to avoid npm resolving brace-expansion's unrelated 5.x major line, which has
a different API than the 1.x line minimatch depends on.
Changes
package.json:shell-quoteoverride changed from>=1.8.4to1.9.0;added
brace-expansionoverride pinned to1.1.17.package-lock.json: updated accordingly (keptlockfileVersion: 2, nounrelated transitive bumps).
Testing
npm installcompletes cleanly (2 packages added, 45 removed, 55 changed).npm auditreports 0 vulnerabilities.(
npm-run-alldev scripts), not the published site.