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

Update minimatch in deps #42075

Closed
gjasny opened this issue Feb 22, 2022 · 7 comments
Closed

Update minimatch in deps #42075

gjasny opened this issue Feb 22, 2022 · 7 comments
Labels
wrong repo Issues that should be opened in another repository.

Comments

@gjasny
Copy link

gjasny commented Feb 22, 2022

Version

HEAD

Platform

any

Subsystem

No response

What steps will reproduce the bug?

Right now the minimatch dependency that is vendored into the deps directory is at version 3.0.4:

grep '"version"' deps/npm/node_modules/minimatch/package.json
  "version": "3.0.4",

Unfortunately that version is reported as vulnerable to a redos attack:

     Description : minimatch package versions before 3.0.5 are vulnerable to Regular Expression Denial of Service (ReDoS). It\'s possible to cause a
       denial of service when calling function braceExpand (The regex /\\{.*\\}/ is vulnerable and can be exploited).

The last npm update PR in #42039 did not (automatically) raise the minimatch dependency.

Could you please update minimatch in v17 and v16 and release new versions?

How often does it reproduce? Is there a required condition?

always

What is the expected behavior?

Minimatch is updated to at least version 3.0.5.

What do you see instead?

Minimatch is at 3.0.4.

Additional information

No response

@mscdex
Copy link
Contributor

mscdex commented Feb 22, 2022

This should be posted to the npm issue tracker instead.

@mscdex mscdex closed this as completed Feb 22, 2022
@mscdex mscdex added the wrong repo Issues that should be opened in another repository. label Feb 22, 2022
@gjasny
Copy link
Author

gjasny commented Feb 22, 2022

@mscdex npm itself has a relaxed dependency on minimatch:

root@ab36c616b81d:/nodejs/lib# grep -r minimatch .|grep package.json
./node_modules/npm/node_modules/glob/package.json:    "minimatch": "^3.0.4",
./node_modules/npm/node_modules/libnpmdiff/package.json:    "minimatch": "^3.0.4",
./node_modules/npm/node_modules/ignore-walk/package.json:    "minimatch": "^3.0.4"
./node_modules/npm/node_modules/@npmcli/map-workspaces/package.json:    "minimatch": "^3.0.4",

Therefore I thought the problem is with the vendoring of the npm dependency into the nodejs repo. Somehow it did not update minimatch to the latest allowed version.

Do you happen to know where the script that populates deps is stored? Is the process documented somewhere?

@gjasny gjasny changed the title Update minimatch in dist Update minimatch in deps Feb 22, 2022
@Trott
Copy link
Member

Trott commented Feb 22, 2022

Do you happen to know where the script that populates deps is stored? Is the process documented somewhere?

The process is described in https://github.com/nodejs/node/blob/45b5ca810a16074e639157825c1aa2e90d60e9f6/doc/contributing/maintaining-npm.md but I'm not sure how up to date it is because we don't do it manually anymore. There is a bot that does it and it is all handled by the @nodejs/npm team.

@mscdex
Copy link
Contributor

mscdex commented Feb 22, 2022

@gjasny npm itself checks in a lot of its own dependencies, including minimatch, which is currently at version 3.0.4 in the npm repo.

@wraithgar
Copy link

wraithgar commented Feb 22, 2022

we can't update minimatch till we patch a fix for the thing that was a breaking change, namely the handling of backslashes for globs. You can see an example in one of the cli deps that have already been updated here.

@mateBe95
Copy link

@wraithgar is this fixed version of minimatch available in nodeJS 16.14.1?

@wraithgar
Copy link

This is fixed in [email protected] It landed in this repo 8 days ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests

5 participants