Critical vulnerability in react-scripts package due to the package version is not updated
See original GitHub issueDescribe the bug
Yarn audit command shows critical vulnerability for immer package:
my-app % yarn audit --level critical
yarn audit v1.22.10
βββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β critical β Prototype Pollution in immer β
βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Package β immer β
βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Patched in β >=9.0.6 β
βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Dependency of β react-scripts β
βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Path β react-scripts > react-dev-utils > immer β
βββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β More info β https://www.npmjs.com/advisories/1002492 β
βββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
115 vulnerabilities found - Packages audited: 1682
Severity: 85 Moderate | 29 High | 1 Critical
package.json file for react-dev-utils package uses the correct version of immer. However, since the version of react-script package was not changed (still 4.0.3 for last 8 months) the update is not published to package repositories (npm, yarn).
Did you try recovering your dependencies?
Yes, I did
Which terms did you search for in User Guide?
Fix vulnerabilities
Environment
Environment Info:
current version of create-react-app: 4.0.3
running from /Users/veselov/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 14.15.4 - /usr/local/bin/node
Yarn: 1.22.10 - ~/homebrew/bin/yarn
npm: 7.22.0 - ~/homebrew/bin/npm
Browsers:
Chrome: 94.0.4606.71
Edge: Not Found
Firefox: 91.1.0
Safari: 15.0
npmPackages:
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-scripts: ^4.0.3 => 4.0.3
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
(Write your steps here:)
- Generate my-app
npx create-react-app my-app
cd my-app
- Run audit
yarn audit --level critical
Expected behavior
Expect not to have any critical vulnerabilities
Actual behavior
See above
Reproducible demo
Use the current version of create-react-app
Possible security incident Possible compliance risk
Issue Analytics
- State:
- Created 2 years ago
- Reactions:19
- Comments:6
Top Results From Across the Web
Help, `npm audit` says I have a vulnerability in react-scripts!
npm audit is broken for front-end tooling by design. Bad news, but it's true. See here for a longer explanation.
Read more >My React App has unfixable High Severity warnings, how do I ...
It looks like it's a dependency issue with immer, react-scripts, and react-dev-tools. They say they will try and push out an update thisΒ ......
Read more >how to solve critical react scripts vulnerabilities : r/reactjs
move react-scripts to devDependencies. run npm audit --production. ensure nothing critical is there.
Read more >react-scripts - Snyk Vulnerability Database
version published direct vulnerabilities
5.0.1 12 Apr, 2022 0. C. 0. H. 0. M. 0. L
5.1.0βnext.14 12 Apr, 2022 0. C. 0. H. 0....
Read more >react-scripts - npm
Configuration and scripts for Create React App.. Latest version: 5.0.1, last published: 9 months ago. Start using react-scripts in yourΒ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a development only problem, see https://github.com/facebook/create-react-app/issues/11174 for more info.
I get high severity reports when running with yarn and npm:
Environment: