Here's a fix for the following vulnerability:
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://github.com/advisories/GHSA-33f9-j839-rf8h
Fix:
Install the patched version of immer, in this case
9.0.6
, using the following command:npm install --save immer@9.0.6
Update the package.json file with
npm update
.IMPORTANT NOTE: if at this point the vulnerability is still present, you can do the following ONLY if you know this will not break your code or mess up dependencies for previous versions or other packages of your project. I'm the only person working on my project, so this fix works in my scenario.
In your
package-lock.json
file, find the outdated package, in my case:"immer": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/immer/-/immer-8.0.1.tgz", "integrity": "sha512-aqXhGP7//Gui2+UrHtvxZxSquQVXTpZ7KDxfCcKAF3Vysvw0CViVaH9RZ1j1xlIYqaaaipBoqcqeibkc17PNvF==" },
and straight-up delete it.
This fix seems not very sustainable for all packages/dependencies, but who knows? If there are better ways, let the community know.