create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

npm audit vulnerability : react-scripts > webpack-dev-server > yargs > yargs-parser

Open sonikamah opened this issue 6 years ago • 42 comments

while running npm audit , I am getting the below error for 'react-scripts' (1 low vulnerability ), could you please help me ?

  • Below I have added my package.json.

  • Error is for : "react-scripts > webpack-dev-server > yargs > yargs-parser"

npm audit

                   === npm audit security report ===


                             Manual Review
         Some vulnerabilities require your attention to resolve

      Visit https://go.npm.me/audit-guide for additional guidance

Low Prototype Pollution

Package yargs-parser

Patched in >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2

Dependency of react-scripts

Path react-scripts > webpack-dev-server > yargs > yargs-parser

More info https://npmjs.com/advisories/1500


package.json -> dependencies

"dependencies": { "react": "^16.12.0", "react-dom": "^16.12.0", "react-router-dom": "^5.1.2", "react-scripts": "3.4.0", "reactstrap": "^8.4.1" },

sonikamah avatar May 19 '20 15:05 sonikamah

Any updates on how much time this will take?

dillu24 avatar May 20 '20 10:05 dillu24

Any updates on how much time this will take?

not yet ... any other alternative solution do you have, as build is getting failed ?

sonikamah avatar May 21 '20 05:05 sonikamah

I have usually fixed this issue by deleting the package-lock.json or yarn.lock and then running npm install or yarn (depending on which one you use).

mohrash92 avatar May 21 '20 08:05 mohrash92

I have usually fixed this issue by deleting the package-lock.json or yarn.lock and then running npm install or yarn (depending on which one you use).

Thanks for your input. have tried deleting package.json but no luck.

sonikamah avatar May 21 '20 08:05 sonikamah

It should be enough to update webpack-dev-server to the latest version 3.11.0 in react-scripts. This is already done in master branch, so we just need a new release of react-scripts

scailbc avatar May 22 '20 10:05 scailbc

It should be enough to update webpack-dev-server to the latest version 3.11.0 in react-scripts. This is already done in master branch, so we just need a new release of react-scripts

Hope it is soon.

dillu24 avatar May 23 '20 14:05 dillu24

It should be enough to update webpack-dev-server to the latest version 3.11.0 in react-scripts. This is already done in master branch, so we just need a new release of react-scripts

Hope it is soon.

any luck ?

sonikamah avatar May 25 '20 05:05 sonikamah

See also: #8529, #8970, #8975.

damien-git avatar May 26 '20 12:05 damien-git

This appears to be happening even when "react-scripts": "^3.4.0" or "react-scripts: "3.4.1" is used. On version 3.4.1, npm ls gives the following output:

└─┬ [email protected]
 [ snipped for brevity ]
  ├─┬ [email protected]

Looks like the package.json file on npm needs an update or something, as it's already been addressed here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/package.json#L82

tatebosler avatar May 28 '20 01:05 tatebosler

Anyone managed to solved this?

dillu24 avatar May 29 '20 06:05 dillu24

Any news about the update? Is a newer version of react-scripts > 3.4.1 fixing this warning going to be released soon? Thanks!

tonix-tuft avatar May 31 '20 11:05 tonix-tuft

Also confirming I am seeing this issue. I ran into it when I had to do a npm install to read my created .env file. After the npm install, react-scripts": "3.3.1" wasn't loading with npm start. After reading here: https://stackoverflow.com/questions/60234640/typeerror-err-invalid-arg-type-the-path-argument-must-be-of-type-string-re

Upgrading the version made it work again, but this makes me and my team uneasy.

And now I'm seeing this same issue as the op... I love react, but please don't let it become unstable or it will be a hard sell to my team. I'm also hoping to get the next update to make the warning go away.

jamespagedev avatar Jun 01 '20 06:06 jamespagedev

Almost month around when this was fixed in dependent webpack-dev-server package (https://github.com/webpack/webpack-dev-server/releases/tag/v3.11.0) and still no one has taken 5 minutes to bump the version of it in CRA? Looks like there is not enough pissed off dev-ops around the globe who are angry at failing pipelines because of npm audit or yarn audit. :D

eMarek avatar Jun 04 '20 20:06 eMarek

Hi @iansu do you want to take credit for closing 4 issues in create-react-app? You would have to release master for this. Or are there any blockers? It would help us a lot. And if you will ever be in Berlin I invite you to a beer ;) Deal?

valoricDe avatar Jun 08 '20 07:06 valoricDe

Hi there,

Wondering if anyone knows the plan around resolving this issue?

scottjason avatar Jun 14 '20 16:06 scottjason

The commit is merged to master to fix this issue but there hasn't been a new release since March 20, 2020. Is anyone able to give a time frame for when a new release will be out?

mohsenari avatar Jun 15 '20 18:06 mohsenari

This issue has a lot of complaints and is a problem for a lot of people who depend on this package. it blocks our application from being deployed to our production systems. The fix is known and has been made a long time ago. The day it was made it should have been released. Security-related item must be prioritized over any other fixes. Please make the release now and prove that you're good maintainers of your product.

jaredgisin avatar Jun 17 '20 21:06 jaredgisin

This has been open for far too long now. I expect a release ASAP to fix this issue once and for all, or at least some response from the devs.

dillu24 avatar Jun 23 '20 07:06 dillu24

Hi,

the vulnerable code in yargs-parser is not actually used in CRA context. But all the security related things are taken very seriously and webpack-dev-server was already updated in https://github.com/facebook/create-react-app/pull/8975 and will be released in 4.0.0.

petetnt avatar Jun 24 '20 10:06 petetnt

See and comment https://github.com/facebook/create-react-app/discussions/9131 on how to help with 4.0.0. crossing the finish line :)

petetnt avatar Jun 24 '20 10:06 petetnt