Repository navigation
[Lesson 13] Update vulnerable serialize-javascript dependency - #806
Merged
Lee Stott (leestott) merged 5 commits intoJul 17, 2026
Merged
Lee Stott (leestott) merged 5 commits into
Lee Stott (leestott) merged 5 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix serialize-javascript RCE vulnerability via RegExp.flags and Date.prototype.toISOString
[Lesson 13] Update vulnerable serialize-javascript dependency
Jul 17, 2026
Lee Stott (leestott)
marked this pull request as ready for review
July 17, 2026 19:00
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a Dependabot security alert in the Lesson 13 “meaningful-visualizations” starter by overriding the transitive serialize-javascript dependency to a patched release and regenerating the npm lockfile to reflect the updated resolution.
Changes:
- Add an npm
overridesentry forcingserialize-javascriptto7.0.5. - Regenerate
package-lock.jsonso the dependency graph resolvesserialize-javascriptto7.0.5(and removes now-unneeded transitive deps likerandombytes).
Show a summary per file
| File | Description |
|---|---|
| 3-Data-Visualization/13-meaningful-visualizations/starter/package.json | Adds an overrides pin for serialize-javascript@7.0.5 to remediate the vulnerability. |
| 3-Data-Visualization/13-meaningful-visualizations/starter/package-lock.json | Updates the resolved serialize-javascript package to 7.0.5 and reflects associated lockfile graph changes (including its engines constraint). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Files not reviewed (1)
- 3-Data-Visualization/13-meaningful-visualizations/starter/package-lock.json: Generated file
- Files reviewed: 1/2 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
49
to
53
| "webpack-bundle-analyzer": { | ||
| "ws": "7.5.11" | ||
| } | ||
| }, | ||
| "serialize-javascript": "7.0.5" | ||
| } |
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.
Track translation progress by opening a draft PR using this template and checking off the translations completed
Each lesson includes a translation of the README.md and the Assignment.md file, if available. Only mark the lesson complete if both those files are translated per lesson, please.
1
1-1
1-2
1-3
2
2-1
2-2
2-3
2-4
3
3-1
3-2
3-3
4
4-1
5
5-1
5-2
5-3
6
6-1
6-2
6-3
6-4
6-5
6-6
7
7-1
7-2
7-3
7-4
Quiz (add a file in the quiz-app with all localizations)
serialize-javascript@6.0.2permits code injection through forgedRegExp.flagsandDate.toISOString()values.Dependency update
7.0.5.7.0.5because7.0.3–7.0.4are affected by the newer GHSA-qj8w-gfj5-8c6v advisory.Reachability Assessment — High confidence
serialize-javascript, callserialize(), or evaluate its output.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>3-Data-Visualization/13-meaningful-visualizations/starter/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 ...