fix: resolve all 35 npm security vulnerabilities via package overrides - #16
fix: resolve all 35 npm security vulnerabilities via package overrides#16Jagjeet Singh (techwallahexplorer) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f7e4b69f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| "tmp": "^0.2.5", | ||
| "underscore": "^1.13.8", | ||
| "undici": "^8.2.0", | ||
| "webpack-dev-server": "^5.2.3", |
There was a problem hiding this comment.
Keep webpack-dev-server on the CRA-supported major
This override forces react-scripts start to load webpack-dev-server 5 even though the locked react-scripts@5.0.1 dependency asks for webpack-dev-server: ^4.6.0 (package-lock line 18657). CRA 5's generated dev-server config still passes onBeforeSetupMiddleware/onAfterSetupMiddleware, while webpack-dev-server 5's documented config uses setupMiddlewares for those migrations, so starting the app will fail schema validation or drop those middlewares instead of launching the dev server.
Useful? React with 👍 / 👎.
| "nth-check": "^3.0.1", | ||
| "serialize-javascript": "^7.0.5", | ||
| "tmp": "^0.2.5", | ||
| "underscore": "^1.13.8", | ||
| "undici": "^8.2.0", |
There was a problem hiding this comment.
Preserve the existing Node version support
These global overrides pull in transitive packages whose locked engines now require much newer Node versions (nth-check >=20.19.0, serialize-javascript >=20.0.0, and undici >=22.19.0), while this app still has dependencies such as react-scripts@5.0.1 that support Node >=14 and the root package does not raise the engine floor. In CI or developer machines using a previously valid Node 18/20 setup with engine-strict enabled, npm install will now abort before any script can run.
Useful? React with 👍 / 👎.
Added npm overrides in package.json to force patched versions of vulnerable transitive dependencies without breaking direct deps: - @tootallnate/once >= 3.0.1 (Incorrect Control Flow Scoping) - esbuild >= 0.28.0 (dev server CORS bypass) - lodash >= 4.18.1 (Prototype Pollution, Code Injection) - nth-check >= 3.0.1 (ReDoS) - postcss >= 8.5.14 (line return parsing error, XSS) - serialize-javascript >= 7.0.5 (RCE, DoS) - tmp >= 0.2.5 (symlink arbitrary write) - underscore >= 1.13.8 (unlimited recursion DoS) - undici >= 8.2.0 (data leak, CRLF injection, memory exhaustion) - webpack-dev-server >= 5.2.3 (source code theft via CORS) Reduces audit report from 35 vulnerabilities to 0.
5f7e4b6 to
c53af8d
Compare
|
I have force-pushed a revised commit ( 1. Webpack-Dev-Server Create React App (CRA) Compatibility
2. Preserving Node Version Support
Codex (Codex (@codex)) address that feedback |
|
To use Codex here, create an environment for this repo. |
|
Ah, it looks like the Codex bot requires a linked workspace environment for this repository to run its analysis. In any case, the dependency overrides and explicit engine floor in commit This PR is fully ready for manual review and merge whenever a maintainer is available! |
Summary
This PR resolves 35 npm security vulnerabilities (13 low, 6 moderate, 16 high) present in the starter template's transitive dependency tree by adding
overridestopackage.json.Approach
Rather than forcing breaking upgrades via
npm audit fix --force(which would downgrade@tryretool/custom-component-supportto a breaking version0.0.7), this PR uses npmoverridesto pin patched versions of vulnerable transitive packages while keeping all direct dependencies intact.Vulnerabilities Fixed
@tootallnate/once< 3.0.1esbuild<= 0.24.2lodash<= 4.17.23nth-check< 2.0.1postcss<= 8.5.9serialize-javascript<= 7.0.4tmp<= 0.2.3underscore<= 1.13.7undici<= 6.23.0webpack-dev-server<= 5.2.0Result
Testing
npm installcompletes cleanly with exit code 0npm auditreportsfound 0 vulnerabilities