patrickhulce / hulk

Collection of useful scripts.
MIT License
1 stars 3 forks source link

Addressing vulnerabilities in dependencies #11

Closed neilmispelaar closed 1 week ago

neilmispelaar commented 2 weeks ago

Hi there,

This issue is to raise awareness on a couple of vulnerabilities being identified by yarn audit in a few outdated dependencies, with the hopes to work together on addressing them.

I've included information below on the dependencies at issue, the versions where they get patched, and if there are any additional notes on the dependencies or vulnerabilities. I'll also setup a PR as well.

Package Installed Version Addressed In Latest Available Release notes Other notes
jimp ^0.2.28 0.22.09 0.22.12 jimp release notes The vulnerability isn't actually with jimp, but with a dependency (mkdirp) that jimp used. That dependency was removed in 0.22.09
git-url-parse ^9.0.1 13.0.0 14.0.0 git-url-parse release notes The vulnerability isn't actually with git-url-parse, but rather with parse-url that is used by git-up. The dependency was addressed in version 7.0.0 of git-up.
conventional-changelog-writer ^4.0.0 5.0.1 8.0.0 conventional-changelog-writer release notes The vulnerability isn't actually with conventional-changelog-writer, but rather with handlebars and minimist that are used as dependencies.
pkgfiles ^2.3.2 n/a ^2.3.2 pkgfiles releases The vulnerability isn't actually addressed in pkgfiles. We can fix this by overriding the minimist dependency to >=1.2.6
yarn auditoutput ```bash yarn audit v1.22.22 ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=0.2.4 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ jimp │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ jimp > mkdirp > minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1097677 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Server-Side Request Forgery in parse-url │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ parse-url │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=6.0.1 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ git-url-parse │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ git-url-parse > git-up > parse-url │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1088918 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Server-Side Request Forgery (SSRF) in GitHub repository │ │ │ ionicabizau/parse-url │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ parse-url │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=8.1.0 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ git-url-parse │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ git-url-parse > git-up > parse-url │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1092304 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=0.2.4 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ git-url-parse │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ git-url-parse > parse-domain > mocha > mkdirp > minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1097677 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ json-schema is vulnerable to Prototype Pollution │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ json-schema │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=0.4.0 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ jimp │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ jimp > request > http-signature > jsprim > json-schema │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1095057 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Remote code execution in handlebars when compiling templates │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ handlebars │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=4.7.7 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ conventional-changelog-writer │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ conventional-changelog-writer > handlebars │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1095063 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in handlebars │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ handlebars │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=4.7.7 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ conventional-changelog-writer │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ conventional-changelog-writer > handlebars │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1095465 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=0.2.4 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ conventional-changelog-writer │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ conventional-changelog-writer > handlebars > optimist > │ │ │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1097677 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=1.2.6 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ pkgfiles │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ pkgfiles > minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1097678 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=1.2.6 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ conventional-changelog-writer │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ conventional-changelog-writer > meow > minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1097678 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=0.2.4 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ @patrickhulce/lint │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ @patrickhulce/lint > eslint > mkdirp > minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1097677 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=0.2.4 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ @patrickhulce/lint │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ @patrickhulce/lint > eslint > file-entry-cache > flat-cache │ │ │ > write > mkdirp > minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1097677 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Insufficient Entropy in cryptiles │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ cryptiles │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=4.1.2 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ jimp │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ jimp > request > hawk > cryptiles │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1095034 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ critical │ Prototype Pollution in minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=0.2.4 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ pkgfiles │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ pkgfiles > fstream-npm > fstream-ignore > fstream > mkdirp > │ │ │ minimist │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1097677 │ └───────────────┴──────────────────────────────────────────────────────────────┘ 91 vulnerabilities found - Packages audited: 451 Severity: 1 Low | 39 Moderate | 37 High | 14 Critical Done in 1.14s. ```
patrickhulce commented 2 weeks ago

Thanks @neilmispelaar ! To be clear, this is all in devDeps and not affecting any consumers, right?

Nevermind, thought this email was for a different repo, these are definitely deps. Thanks for the issue :)

neilmispelaar commented 2 weeks ago

Just created a PR with the minimum bumps needed to address the critical vulnerabilities: #12

Would you have a set of recommended tests I can run to see if any of the updated packages broke anything? Happy to help where I can / where it's helpful.

Or if there is anything else you need please feel free to reach out.

Thanks!

patrickhulce commented 1 week ago

fixed by #12