fix: update serialize-javascript to >=7.0.3#592
Merged
cameri merged 3 commits intocameri:mainfrom May 4, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: a85ca44 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Collaborator
There was a problem hiding this comment.
Pull request overview
This PR mitigates a high-severity RCE vulnerability in the transitive devDependency serialize-javascript by forcing pnpm to resolve it to a patched version across the workspace.
Changes:
- Added a pnpm workspace override for
serialize-javascriptto require>=7.0.3. - Regenerated
pnpm-lock.yamlto reflect resolution toserialize-javascript@7.0.5and removal of no-longer-needed transitive deps. - Added a Changeset marking a patch release for the security-related dependency resolution change.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
package.json |
Introduces pnpm override configuration to force patched serialize-javascript. |
pnpm-lock.yaml |
Captures the override in the lockfile and updates resolved dependency graph (now serialize-javascript@7.0.5). |
.changeset/fix-serialize-javascript-cve.md |
Adds a patch changeset documenting the security fix. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6db254a to
65ff30b
Compare
65ff30b to
1aa065f
Compare
cameri
approved these changes
May 4, 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.
Description
This PR adds a
pnpm.overridesentry to forceserialize-javascriptto>=7.0.3, resolving a high-severity RCE vulnerability (GHSA-5c6j-r48x-rmvq, CVSS 8.1).The package isn't a direct dependency — it's pulled in transitively via
mocha → serialize-javascript@^6.0.2. Since mocha upstream hasn't bumped this yet, the only correct fix is overriding the resolution at the workspace level using pnpm's native override mechanism.Related Issue
Closes #521
Motivation and Context
serialize-javascript <=7.0.2allows code injection through spoofedRegExp.flagsandDate.toISOString()properties. When the serialized output iseval'd, the injected code executes. Mocha uses this package in its parallel worker pool (buffered-worker-pool.js) to serialize test options between the main process and worker threads.While this is a devDependency and not reachable at relay runtime, it still poses a risk in CI environments and developer machines. Patching it is the right call.
How Has This Been Tested?
Manual PoC verification: Ran the CVE proof-of-concept against both versions:
serialize-javascript@6.0.2→ injection succeeds silentlyserialize-javascript@7.0.5(installed after override) → throws"RegExp.prototype.source getter called on non-RegExp object", injection neutralizedScreenshots (if appropriate):
N/A
Types of changes
Checklist: