Conversation
…HSA-5c6j-r48x-rmvq Agent-Logs-Url: https://github.com/github/emergency-pull-request-probot-app/sessions/70ba3aa6-5429-4b16-bdc8-5dade885fc0e Co-authored-by: lindluni <9400927+lindluni@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix serialize-javascript vulnerability in RegExp.flags and Date.prototype.toISOString
Update serialize-javascript to 7.0.3 via npm override (GHSA-5c6j-r48x-rmvq)
Apr 8, 2026
Contributor
|
There was a problem hiding this comment.
Pull request overview
Pins a vulnerable transitive dev dependency (serialize-javascript) to a patched version using npm overrides, addressing GHSA-5c6j-r48x-rmvq while keeping the existing mocha version.
Changes:
- Add
overrides.serialize-javascript = 7.0.3to force the patched version. - Update
package-lock.jsonto reflectserialize-javascript@7.0.3undermocha(and remove the old6.0.2entry).
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds npm override to pin serialize-javascript to 7.0.3. |
| package-lock.json | Locks transitive dependency resolution to serialize-javascript@7.0.3 under mocha. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/2 changed files
- Comments generated: 1
Comment on lines
+31
to
34
| }, | ||
| "overrides": { | ||
| "serialize-javascript": "7.0.3" | ||
| } |
There was a problem hiding this comment.
This override pulls in serialize-javascript@7.x which requires Node >=20. If the project expects contributors to run on Node 18 locally, consider declaring the Node requirement explicitly (e.g., package.json "engines" / .nvmrc / short README note) to avoid confusing install/runtime issues.
robandpdx
approved these changes
Apr 8, 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.
serialize-javascript@6.0.2has a high-severity RCE via unsanitizedRegExp.flagsandDate.prototype.toISOString()interpolation (incomplete fix for CVE-2020-7660).Changes
overridesto pinserialize-javascriptto 7.0.3. Required because the sole consumer (mocha@11.7.5) constrains it to^6.0.2and hasn't updated yet.Reachability Assessment
Not reachable — high confidence.
serialize-javascriptis pulled in only bymocha(devDependency). Application code never imports or callsserialize(). Production builds usenpm ci --production, so the package isn't even installed in containers. Update is to clear the Dependabot alert, not to mitigate active risk.Compatibility
serialize-javascript@7.0.3requires Node ≥20. Dockerfile base image isnode:20-slim. Dev-only dependency, so no production surface.Original prompt
This section details the Dependabot vulnerability alert you should resolve
<alert_title>Serialize JavaScript is Vulnerable to RCE via RegExp.flags and Date.prototype.toISOString()</alert_title>
<alert_description>### Impact
The serialize-javascript npm package (versions <= 7.0.2) contains a code injection vulnerability. It is an incomplete fix for CVE-2020-7660.
While
RegExp.sourceis sanitized,RegExp.flagsis interpolated directly into the generated output without escaping. A similar issue exists inDate.prototype.toISOString().If an attacker can control the input object passed to
serialize(), they can inject malicious JavaScript via the flags property of a RegExp object. When the serialized string is later evaluated (viaeval,new Function, or<script>tags), the injected code executes.Patches
The fix has been published in version 7.0.3. https://github.com/yahoo/serialize-javascript/releases/tag/v7.0.3</alert_description>
high
https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-5c6j-r48x-rmvq https://nvd.nist.gov/vuln/detail/CVE-2020-7660 https://github.com/yahoo/serialize-javascript/commit/2e609d0a9f4f5b097f0945af88bd45b9c7fb48d9 https://github.com/advisories/GHSA-hxcc-f52p-wc94 https://github.com/yahoo/serialize-javascript/releases/tag/v7.0.3 https://github.com/advisories/GHSA-5c6j-r48x-rmvqGHSA-5c6j-r48x-rmvq
serialize-javascript
npm
<vulnerable_versions>6.0.2</vulnerable_versions>
<patched_version>7.0.3</patched_version>
<manifest_path>package-lock.json</manifest_path>
<task_instructions>Resolve this alert by updating the affected package to a non-vulnerable version. Prefer the lowest non-vulnerable version (see the patched_version field above) over the latest to minimize breaking changes. Include a Reachability Assessment section in the PR description. Review the alert_description field to understand which APIs, features, or configurations are affected, then search the codebase for usage of those specific items. If the vulnerable code path is reachable, explain how (which files, APIs, or call sites use the affected functionality) and note that the codebase is actively exposed to this vulnerability. If the vulnerable code path is not reachable, explain why (e.g. the affected API is never called, the vulnerable configuration is not used) and note that the update is primarily to satisfy vulnerability scanners rather than to address an active risk. If the advisory is too vague to determine reachability (e.g. 'improper input validation' with no specific API named), state that reachability could not be determined and explain why. Include a confidence level in the reachability assessment (e.g. high confidence if the advisory names a specific API and you confirmed it is or is not called, low confidence if the usage is indirect and hard to trace). If no patched version is available, check the alert_description field for a Workarounds section — the advisory may describe configuration changes or usage patterns that miti...