fix: update webpack plugins to resolve serialize-javascript RCE (GHSA-5c6j-r48x-rmvq)#949
Conversation
…-5c6j-r48x-rmvq) Update css-minimizer-webpack-plugin to ^8.0.0 and add terser-webpack-plugin ^5.3.17 to resolve serialize-javascript <=7.0.2 RCE vulnerability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review Summary by QodoResolve serialize-javascript RCE vulnerability in webpack plugins
WalkthroughsDescription• Update css-minimizer-webpack-plugin to ^8.0.0 • Add terser-webpack-plugin ^5.3.17 as direct devDependency • Resolve serialize-javascript RCE vulnerability (GHSA-5c6j-r48x-rmvq) • Minor formatting adjustment in test file Diagramflowchart LR
A["Vulnerable Dependencies<br/>serialize-javascript ≤7.0.2"] -->|"Update"| B["css-minimizer-webpack-plugin ^8.0.0"]
A -->|"Add Override"| C["terser-webpack-plugin ^5.3.17"]
B -->|"Resolves"| D["GHSA-5c6j-r48x-rmvq RCE Fixed"]
C -->|"Resolves"| D
File Changes1. package.json
|
Code Review by Qodo
1. Undocumented indirect dependency
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDependencies updated in package.json with css-minimizer-webpack-plugin bumped from v5 to v8 and terser-webpack-plugin added at v5.3.17. Test assertion in custom-api.test.mjs reformatted for multi-line clarity without functional changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements crucial security updates by addressing a Remote Code Execution vulnerability found in the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates css-minimizer-webpack-plugin and adds terser-webpack-plugin to resolve a security vulnerability in the transitive dependency serialize-javascript. The changes are correct and effectively mitigate the vulnerability. I have one suggestion to use npm's overrides feature for terser-webpack-plugin for better dependency management clarity and maintainability.
| "style-loader": "^4.0.0", | ||
| "thread-loader": "^4.0.4", | ||
| "webpack": "^5.92.1", | ||
| "terser-webpack-plugin": "^5.3.17", |
There was a problem hiding this comment.
For better maintainability and to more clearly express the intent of overriding a transitive dependency, consider using the overrides field in package.json instead of adding terser-webpack-plugin as a direct dependency. This is the recommended approach for such cases since npm v8.3.0, and it is supported by your project's configured Node.js version (>=22).
You would remove this line and add the following to your package.json:
"overrides": {
"terser-webpack-plugin": "^5.3.17"
}|
Closing, apologies for the noise. |
|
Should be done in #944, thanks anyway. |
Summary
serialize-javascriptversions ≤7.0.2 are vulnerable to Remote Code Execution via craftedRegExp.flagsandDate.prototype.toISOString()(GHSA-5c6j-r48x-rmvq).Two devDependencies pull in the vulnerable version:
serialize-javascript≤7.0.2serialize-javascript≤7.0.2Changes
css-minimizer-webpack-pluginfrom^5.0.1to^8.0.0terser-webpack-plugin^5.3.17as a direct devDependency to override the transitive version from webpackVerification
After these changes,
npm auditno longer reports theserialize-javascriptRCE vulnerability.🤖 Generated with Claude Code
Summary by CodeRabbit