Skip to content
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

Remove minimist dependency via mkdirp (vulnerability CVE-2020-7598) #13050

Closed
davidgilbertson opened this issue Mar 15, 2020 · 12 comments
Closed
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion

Comments

@davidgilbertson
Copy link

The version of ESLint you are using.
6.8.0

The problem you want to solve.
Remove the warning about the minimist vulnerability detailed here GHSA-7fhm-mqm4-2wp7

This is required via a dependency on the mkdirp package.

Your take on the correct solution to problem.
@mysticatea has already done this in a PR targeting version 7. I suggest making this change in a patch to 6.8.

Are you willing to submit a pull request to implement this change?
Yep.

@davidgilbertson davidgilbertson added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Mar 15, 2020
@evanplaice
Copy link
Contributor

@davidgilbertson Do you mind if I submit a PR with a fix for this issue?

@davidgilbertson
Copy link
Author

Go for it!

evanplaice added a commit to evanplaice/eslint that referenced this issue Mar 16, 2020
* the CVE is caused by the mkdirp dependency
* mkdirp is no longer supported
* mkdirp has been removed as of 7.0.0-alpha0
* this back-ports the change to v6.x
evanplaice added a commit to evanplaice/eslint that referenced this issue Mar 16, 2020
* the CVE is caused by the mkdirp dependency
* mkdirp is no longer supported
* mkdirp has been removed as of 7.0.0-alpha0
* this back-ports the change to v6.x
@evanplaice
Copy link
Contributor

The PR is in, all tests are passing. That's as far as I can go for now.

@au5ton
Copy link

au5ton commented Mar 16, 2020

Thank you, I've been seeing this for days

@rzr
Copy link

rzr commented Mar 16, 2020

Release to npm welcome or tell which git branch should be used ?

@evanplaice
Copy link
Contributor

Update: mkdirp published a new version that bumps minimist to a safe version.

Patching ESLint is no longer unnecessary.

Re-creating package-lock.json should fix the issue.

@celosauro
Copy link

Update: mkdirp published a new version that bumps minimist to a safe version.

Patching ESLint is no longer unnecessary.

Re-creating package-lock.json should fix the issue.

Still failing and not updated:

> npm ls minimist   
├─┬ eslint@6.8.0
│ └─┬ mkdirp@0.5.1
│   └── minimist@0.0.8 

@willkjackson
Copy link

Wiping package-lock/minimist from mode_modules and reinstalling packages updated the tree:

> npm ls minimist
├─┬ eslint@6.8.0
│ └─┬ mkdirp@0.5.3
│   └── minimist@1.2.5 

@yumetodo
Copy link

yumetodo commented Mar 19, 2020

I decided to ignore this security warning.
mkdirp dependency was already removed by #12753 however, eslint v7 is alpha release. And backport PR was rejected #13051 .
The way described by @willkjackson has a question "that is really safe? major version change should be doing more carefully, isn't it?"
So I will wait eslint v7 stable release.

I missed that in mkdirp@0.5.2, isaacs/node-mkdirp@c5b97d1 , major version was updated.

@kaicataldo kaicataldo added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Mar 20, 2020
@kaicataldo
Copy link
Member

Given the workaround listed here, we have made the decision not to backport this change to the 6.x line.

wu-lee pushed a commit to DigitalCommons/mykomap that referenced this issue Mar 20, 2020
This fixes the problems with ESLint, as described here:

eslint/eslint#13050 (comment)

The problematic dependency `mkdirp` published a new version that bumps
`minimist` to a safe version.
Amphiluke added a commit to Amphiluke/lindsvg that referenced this issue Mar 21, 2020
calebHankins added a commit to calebHankins/node-playground that referenced this issue Mar 24, 2020
wincent added a commit to liferay/liferay-frontend-guidelines that referenced this issue Apr 6, 2020
As per:

eslint/eslint#13050

This gives us a clean `yarn audit`, getting rid of:

    ┌───────────────┬──────────────────────────────────────────────────────────────┐
    │ low           │ Prototype Pollution                                          │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ Package       │ minimist                                                     │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ Patched in    │ >=0.2.1 <1.0.0 || >=1.2.3                                    │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ Dependency of │ eslint                                                       │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ Path          │ eslint > file-entry-cache > flat-cache > write > mkdirp >    │
    │               │ minimist                                                     │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ More info     │ https://www.npmjs.com/advisories/1179                        │
    └───────────────┴──────────────────────────────────────────────────────────────┘
    ┌───────────────┬──────────────────────────────────────────────────────────────┐
    │ low           │ Prototype Pollution                                          │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ Package       │ minimist                                                     │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ Patched in    │ >=0.2.1 <1.0.0 || >=1.2.3                                    │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ Dependency of │ eslint                                                       │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ Path          │ eslint > mkdirp > minimist                                   │
    ├───────────────┼──────────────────────────────────────────────────────────────┤
    │ More info     │ https://www.npmjs.com/advisories/1179                        │
    └───────────────┴──────────────────────────────────────────────────────────────┘
    2 vulnerabilities found - Packages audited: 596
@oliikit
Copy link

oliikit commented May 18, 2020

For those with really old package-lock.json and not a tightly controlled package.json, completing wiping the package-lock.json to reinstall dependencies can break their application. I'd recommend the following option:

 npm uninstall eslint; npm install -D eslint@VERSION

That will update all the subdependencies in eslint without you be in dependency hell.

@evanplaice
Copy link
Contributor

@oliikit The latest SemVer major release (ie v6.x) of ESLint removes the need for this change altogether.

Id recommend upgrading if possible

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 18, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

No branches or pull requests

9 participants