chore(deps): clear the serialize-javascript and brace-expansion advisories - #22
Merged
Conversation
…ories serialize-javascript below 7.0.3 rebuilds RegExp flags and Date values in a way that lets a serialized payload execute, and below 7.0.5 a crafted array-like object burns CPU. mocha pins the 6.x line, so only a resolutions entry crosses the major; mocha loads the package solely in its parallel worker pool, and that path was exercised to prove the pin. brace-expansion below 1.1.16 expands consecutive empty groups in exponential time, and minimatch's own range already admitted the fix.
There was a problem hiding this comment.
Pull request overview
This PR addresses development-only security advisories by forcing patched dependency versions through Yarn resolution and lockfile re-resolution, ensuring Mocha’s transitive dependency on serialize-javascript no longer stays on the vulnerable 6.x line.
Changes:
- Re-resolves
brace-expansion@^1.1.7to1.1.18(within the existing semver range). - Adds a Yarn
resolutionsoverride to forceserialize-javascriptto^7.0.5(lockfile resolves to7.1.0), replacing Mocha’s transitive^6.0.2. - Lockfile cleanup removes now-unneeded transitive packages (
randombytes,safe-buffer) that were pulled byserialize-javascript@6.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| yarn.lock | Updates resolved versions for brace-expansion and serialize-javascript, and removes obsolete transitive entries after the major bump. |
| package.json | Adds a resolutions entry to force serialize-javascript to a patched 7.x version despite Mocha’s ^6.0.2 dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Why
serialize-javascript below 7.0.3 reconstructs RegExp flags and Date values so that a serialized payload can execute, and below 7.0.5 a crafted array-like object exhausts CPU. mocha pins the 6.x line, so no lockfile bump reaches the fix and a resolutions entry is the only route across the major. brace-expansion below 1.1.16 expands consecutive empty groups in exponential time; minimatch's own range already admitted the fix, so that one is a plain re-resolution.
Both are development scope. The cross-major pin is the only real risk, and it is not speculative: atomicassets-api already runs the same pin against mocha 11 with a passing suite.
Validation
The suite passes with counts identical to the pre-change run. mocha loads serialize-javascript only in its parallel worker pool, which the default run never touches, so the suite was also run with --parallel to exercise that path; it passes there too. yarn install --frozen-lockfile succeeds, and the lockfile diff is limited to the two packages plus two transitive children that the 6.x line no longer needs.