-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Replace vulnerable mkdirp with fs.mkdir #4199
Comments
please note that |
We will drop Node.js v8 support in mocha v8.0.0, see #4164 |
minimist@1.2.2 and earlier had "a prototype pollution bug that could cause privilege escalation in some circumstances when handling untrusted user input." [Source: https://github.com/substack/minimist#security] Unfortunately, mocha@7.x also has a dependency on a vulnerable minimist version through the mkdirp package; but at this point it seems likely that this will only get addressed in mocha@8.0: mochajs/mocha#4199. This update partially addresses the security alert raised by GitHub in https://github.com/aerospike/aerospike-client-nodejs/network/alert/package-lock.json/minimist/open
It should be enough to add caret (
|
If someone else gets here because of
|
@ejke: The key is to use the |
Getting this too in the log when installing -> npm WARN deprecated mkdirp@0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. |
@JimmyBjorklund : That's an improvement (and separate issue) though (the message actually means you got the vulnerability fixed or avoided). While 0.5.3 is deprecated in favor of the new 1.0 series, 0.5.3 includes a fix for a security vulnerability present in 0.5.1 (which some of us still had in our But it would indeed be good to start using the 1.0 series of mkdirp too (or remove it) as it is presumably more attractive to use internally given its use of Promises, and because it is the version currently being maintained. But as a 1.0 version, it introduces breaking changes, so there'd need to be some code refactoring to get it working. |
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
Mocha does depend on
mkdirp
, which depends on an old version ofminimist
, which has a known Prototype pollution vulnerability: https://snyk.io/test/github/mochajs/mochaIt does not seem that
minimist
is getting updated soon, and also,fs.mkdir(path[, options], callback)
can be run recursively, effectively obsoletingmkdirp
. Furthermore, packages depending on any version ofmocha
currently exhibit this vulnerability (cf. any package on snyk.io), and are shown to the user as vulnerable, too.mocha --version
andnode node_modules/.bin/mocha --version
: 7.1.0node --version
: v13.6.0The text was updated successfully, but these errors were encountered: