-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency on insecure version of braces (Node security advisory 786) #6443
Comments
This is a development only package and it should not affect your production build in anyway. It should go away once a newer version of a downstream package that addresses this issue is available. |
Getting the same vulnerabilities from The vulnerability is in versions earlier than 2.3.1 and it seems
More information on the issue is here. Do we wait for |
Unless jest releases a new 23.x version with updated dependencies to micromatch@3 (unlikely since this is a breaking change), or CRA updates to jest 24, I don't think there is an easy workaround for this issue. |
As it stands right now, Jest is not planning on releasing a patch for v23. |
See #6064 #6109 #5777 #5618 for earlier times something like this happened; I think it's useful to draw the connection between these recurring issues. #6064 (comment) explains the reasoning behind this project's tradeoff between dependency pessimism (pinning, delayed upgrades, and enduser frustration) and dependency optimism (allow users to use I do see that in this case, Jest fixed the issue with a major version bump, not a patch, so even a SemVer "minors and patches OK"
@bugzpodder That is a very confident prediction! Unfortunately, in fact, I can't push to production via my CI pipeline when my tests fail, and this problem causes UPDATE: For my nested-node-project setup, I had to add ALSO: I know open source development can be a thankless task, so BIG THANKS to everyone who's working on all these interrelated projects and the tangled dependency webs they weave. |
FWIW we originally bumped Micromatch in a minor of Jest 23, but it broke a ton of setups (notably on windows), so we reverted it: jestjs/jest#6661 |
@alexch, your production build (i.e. running react-scripts build) will not be affected by this security vulnerability in any way. You'll get a notice about this low risk vulnerability if you run npm install, but otherwise an end user should not be affected by this issue. There is no need to rush upgrading to Jest 24. |
This is causing issues with us being able to deploy our front-end through our CI also. Going to keep an eye out here for any movement. :) |
Nothing will happen here unless a patch is released for an old version of micromatch or a new major of CRA is released. Using a newer major of micromatch is a breaking change. Seems like your CI should just check production dependencies, not dev deps. Doesn't seem like https://npm.community/t/please-support-production-or-only-production-in-npm-audit/3005 |
WORKAROUND
you can exclude low vulnerabilities with |
Instead of using a workaround (which ignores the advisory in all modules you installed) you can use https://www.npmjs.com/package/npm-audit-resolver that wraps audit in fine-grained tools to manage your security decision |
I've seen messages like this a number of times for a variety of reported security vulnerabilities in various packages and it's not a particularly satisfying response for me but maybe I'm thinking about things the wrong way. Is the expected flow:
That flow seems really likely to allow something that wasn't expected to cause a production issue to end up causing one. I had been operating under the expectation that the flow was:
Under that flow, we're less likely to let flaws creep into our projects but it means responses like "it only impacts dev" or "it's only a command-line thing" are insufficient. Maybe the issue with with npm and yarn? Maybe they should have some sort of "dev only, prod and dev" flags or "mark as 'ok for me and don't tell me again'" like other vuln scanners have? |
@bugzpodder If @jdalegonzalez I think you're right that different teams/projects have different workflow expectations, and different levels of reliance on so-called "dev-only" packages, and that your latter flow ("apply fix ASAP") is much preferred over a flow that requires every project owner to deeply understand vulnerabilities and updates and workarounds and release schedules. |
@alexch you don't need to disable preflight checks if you install the same version of jest (23.6 instead of 24) in your node code. If you decide to use Jest 24, then disabling preflight checks is a perfectly valid course of action for your decision. @jdalegonzalez this is unfortunately the difference between reality and an ideal world. Ideally you would run a command that would fix everything, but the reality is that APIs change between versions (especially majors), we have deeply nested dependencies, and most open source projects don't have the resources to back port each fix to older versions. All of your npm modules have various version dependencies (eg Jest 23 uses micromatch 2 but eslint might use micromatch 3 at the same time) so you can't always have the latest packages for every nested dependency. So yes, it needs to be on a case-by-case basis. If you are on a team then one person should be the POC for security related issues. If you aren't sure about a particular vulnerability assessment, issues are one of the perfectly valid ways of asking for help. |
Handlebars just joined the party with a High priority vulnerability too |
Yep. That's why we pulled it out. We can live without test coverage
reporting
…On Mon, Feb 18, 2019, 4:15 PM Zac Tolley ***@***.*** wrote:
Handlebars just joined the party with a High priority vulnerability too
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6443 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZ6hKAredtyt7L_aQCyipooTEOkJDXSks5vOxf3gaJpZM4a_CiD>
.
|
Any ideas for suppressing this on Looks like yarn doesn't allow for auditing production-only dependencies. |
I don't really understand why, but it seems like this is related to my perfect-scrollbar being on the left of my page instead of the right - I'm getting identical vulnerabilities after running Edit: running Material Dashboard Pro |
@dlipeles why would this block a CI? Is it because of the preflight check or do you have a build step that hinges on yarn audit succeeding? In any case, if you are yarn, you could use yarn resolutions to pin micromatch to v3 but it might break something, YMMV. |
Is it possible to change your CI pipeline to omit npm audit step? From my experience it takes a non-trivial amount of time to test/deploy/propagate a security fix. In most cases, when a security advisory is posted, either it doesn't affect your production build (such as this case), or that it is a real issue. In the latter case, either a fix might not be immediately available/feasible, or there could be workarounds that might mitigate risk while keeping the package as-is, and blocking all builds until the package is updated might not be the best course of action. EDIT: This comment isn't meant as a call to ignore security warnings. npm audit has its place and it should be done as part of security audit for your application. It should be monitored and dealt on a case by case basis. IMO it doesn't belong in a CI pipeline for the reasons mentioned above. |
@bugzpodder With all due respect, this feels like bad advice to me. While I recognize that right this minute we're in a bit of a pickle as it relates to NPM audit, the idea that we all should ignore security warnings because most of the time they don't impact our app feels a little careless. Almost all high-profile breaches I've ever seen reported start with someone thinking it wasn't a high-priority to patch some previously reported vulnerability. A very low percentage of hacks are exploiting zero-day/unreported vulnerabilities. Within the last six months, there were packages on npm that had the ability to steal cryptocurrency - no impact to the "app" itself, it just made the app a conduit for theft. If you feel like "for right now" removing the audit from the CI pipeline is necessary while solutions are explored - I would at least sympathize and maybe agree. If you're advocating (like some are) that the standard npm audit be wrapped in some script that filters out those warnings deemed as acceptable risk (again until npm fixes their audit system to support this natively), I would agree too. Making the blanket suggestion that people stop depending on npm audit as a part of CI altogether because "in most cases" security advisories don't impact "most" production apps feels like a bridge too far. (of course, that's just my opinion. I could be wrong) |
The vulnerability was discovered in an existing package. |
A vulnerability was discovered and reported in a package that one of your packages ultimately depends on. You didn’t need to update anything. The vulnerability report is what is new.
From: Daryl Roberts <[email protected]>
Reply-To: facebook/create-react-app <[email protected]>
Date: Tuesday, February 19, 2019 at 8:40 AM
To: facebook/create-react-app <[email protected]>
Cc: jdalegonzalez <[email protected]>, Mention <[email protected]>
Subject: Re: [facebook/create-react-app] Dependency on insecure version of braces (Node security advisory 786) (#6443)
@jitenderchand1
Why this issue started to occurred, I have not updated any package?
The vulnerability was discovered in an existing package.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Let's focus on the issue here. This is not the place to debate the merits of Since Jest isn't planning to backport this fix to Jest 23 the only thing we can do is release a major version of Create React App with Jest 24. We are currently working on that and you can follow the progress on upgrading to Jest 24 here: #6278 |
Potentially, you can get a patch into Note that upgrading from micromatch 2 to 3 is a breaking change in and of itself, so there's really no way Jest can backport a fix to v23 |
there is still some unfixed issue in react-script. See: - facebook/create-react-app#6443 - facebook/create-react-app#6278
any updates ?? |
@Waseemrajashaik Based on @iansu's comment above, I think #6278 is relevant to your question. |
Agreed. I shared my view on the merits of |
even thought installed latest CRA it still gives. Any updates? |
We haven't yet upgraded to Jest 24 which includes the fix but it is in progress. This will be part of the 3.0 release. |
There is still an unresolvable dependency issue. See facebook/create-react-app#6443
FWIW, I went through my node_modules folder and searched out each instance of I did This resolved the warning (as the fix is >2.3.1) and CRA works fine. Here's my npm tree now: edit - I'm parsing this down. My npm tree was frickin huge. Hopefully this makes it easier for others to do the same, instead of digging folder by folder. +-- [email protected]
| ...
| +-- [email protected]
| | ...
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | `-- [email protected]
| | | ...
| | | +-- [email protected]
| | | | ...
| | | | +-- [email protected]
| | | | ...
| | +-- [email protected]
| | | ...
| | | +-- [email protected]
...
| | +-- [email protected]
| | | ...
| | | +-- [email protected]
| | | | ...
| | | | +-- [email protected]
| | | | | ...
| | +-- [email protected]
| | | ...
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | `-- [email protected]
| | | | +-- [email protected]
| | | | | ...
| | +-- [email protected]
| | | ...
| | | +-- [email protected]
| | | |...
| +-- [email protected]
| | ...
| | +-- [email protected]
| | | +...
| | | | ...
| | | +-- [email protected]
...
| | | +-- [email protected]
| | | | +-- [email protected] deduped
| | | | +-- [email protected]
| | | | | ...
| | | | | +-- [email protected]
| | | | | |...
| | +-- [email protected]
| | |...
| | | +-- [email protected] deduped
| | | `-- [email protected]
| | | ...
| | | +-- [email protected]
| | | ...
`-- [email protected] |
Hmm ok so what would be the fastest way to continue working on my old project right now if npm audit fails, barring completely ignoring the issue by installing with --no-audit? |
For those that need this resolved immediately you can try out our alpha build by following the instructions over at #6475. Closing this for now as it should be resolved and will be part of the 3.0 release. |
Is this a bug report?
Yes.
Did you try recovering your dependencies?
I don't think this step is necessary, due to the error being present in a brand new project.
Which terms did you search for in User Guide?
None.
Environment
Steps to Reproduce
yarn create react-app my-app
cd my-app/
yarn audit
In addition, I've tried to add braces as a top-level dependency using
yarn add braces
. That didn't help.Expected Behavior
Pass.
Actual Behavior
Fail:
Reproducible Demo
I don't think this is necessary, due to the required steps being very few.
The text was updated successfully, but these errors were encountered: