Re:GitHub Advisory Database now powers NPM audit
by Floegipoky on Friday October 08, 2021 @10:14AM
(#28799505)
I stand corrected, thanks! Elegance in simplicity https://github.com/npm/cli/pull/202/files#diff-2a8ed1f0d31e4...
You can run
to audit only the "dependencies" that are what deployed code is using, but not "devDependencies" which are what build and test infrastructure is using.> That's not a vulnerability, that's a broken build.
True, but at the same time you shouldn't discount the potential issues in the build toolchain as totally harmless. A classical example is a malicious transitive dependency that steals your signing keys. Or triggers long builds, slowly (or rapidly) burning your money that you pay for CI.
The thing is, with every potential vulnerability you should assess whether it actually applies to you. There are countless reasons for which a vulnerability cannot be exploited in your particular situation: you don't even use a feature, you use it with proper safeguards, you don't deploy that code to anywhere that matters, you run it in a sandbox, etc.
But doing so is not that easy when you have hundreds of transitive dependencies and npm audit cries wolf daily. I have this little library with exactly one direct dependency and what do I see?
This is doable. Now multiply it by 200 and you can't be bothered to review it all and decide whether things apply to you or not.Extreme positions are to either ignore the advisories entirely (“it’s not an issue until I have a real user with a real complaint”), or treat all of them as immediate priority (“npm audit says we have 7 critical vulnerabilities, those must be real and actual, drop whatever you're doing and fix that NAO”).
A middle ground is some arbitrary policy, like don't sweat it until we have more than N potential vulnerabilities, or someone happened to read their descriptions and thinks they are particularly nasty.
The bad thing here is that the npm audit scale promotes this sort of middle ground position taking without involving actual security people.