GitHub Advisory Database now powers NPM audit
github.blog
github.blog
Scanning through the vulns on GitHub Advisory Database, it looks like it still contains many that DA brought up as unhelpful at best (e.g. “Regular Expression Denial of Service”).
Npm audit denial-of-service by Regular Expressions Denial of Service CVE’s
There's a whole topic in information security and infrastructure hardening that centers around SDLC (secure development lifecycle) and it covers such thrilling topics as:
1. Is the code from your SCM the same as the code that was built and deployed?
2. Has anyone tampered with your build or deployment artifact?
3. Who all actually has access to the boxes that do all this? Can you tell when folks access your build boxes and what has changed on them?
4. Does your CI/CD system have privileged access to secrets or other internal networks?
5. How confident are you that your digital supply chain is reliable and trustworthy? Would you know if someone fed you a poisoned dependency?
The list goes on and on. There be dragons here. I'd love to see less focus on regex DoS and more awareness around the fact that build systems need just as much scrutiny and security as the production environments they feed into.
Prioritising security activities that aren't useful (fixing "regex dos" in dev deps) takes time and effort that could have been spent on real bugs or product improvement.
Incorrect and expensive to evaluate information, broadcast to tens or hundreds of thousands of people is misinformation and yes, it's worse than no information.
By notifying you of "vulnerabilities" which aren't, these tools effectively "amplify bullshit".
It wastes the time of your team and in an open-source context also wastes the time of your downstream consumers. Triaging (evaluating the bullshit) takes time. It is often quicker to "fix" the non problem by upgrading but of course this pushes additional version churn on everyone downstream of you.
Even ignoring it wastes time as you have to communicate why you're doing it to "helpful" third parties. In an organisational context you're often stuck with security people who don't know any better or an org policy with metrics around this.
If the information were categorised correctly at the source, or the tooling were smart enough, or the rules nuanced enough to capture the reality of the situation then the time and effort of every team in the ecosystem could be saved.
Unfortunately researchers are incented to produce CVEs regardless of quality, and of course the CVSS score is always calculated "worst case" despite the fact that 90% of the time these issues are in barely used parts of the codebase or exploitable only in unusual configurations.
The tooling then makes this poor quality data worse by completely ignoring context. For example, basically every docker scanning tool on the market will report sev 9.8s on "linux kernel vulns" (based on installed headers) or systemd or cron privesc bugs... in a container... based on matching package versions inside the container.
It's all just incredibly lazy engineering from scanning tool vendors who afaict don't QC their data feeds at all, and are also incented to maximise "findings" on every scan.
I believe there's room for a startup that does "collaborative triage" of security issues to help stem the tide of this, because no vendors seem interested in fixing it.
You can run
npm audit --production
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?
found 7 vulnerabilities (4 moderate, 3 critical) in 124 scanned packages
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.
I'm sure there are plenty out there with managers who will just run the report and demand these "security issues" are fixed and won't understand an explanation on why it's not relevant.
Dont get me wrong, i wish npm audit was better. But unreasonable people will be unreasonable regardless of the tools they have access to.
If anything you should be promoting easier upgrades for the packages affected by these security problems.
well if it's a regex ddos in build tooling, it doesn't "impact your project severly". That's the entire point of this thread
If you ever heard the story of "The Boy Who Cried Wolf" as a child you should recognise what npm audit is doing wrong.
Say there was a regex dos in nodemon, I only use this for local development and has no effect on my main application.
Point is npm audit is an advisory as it doesn't know the context in which it used.
Sure, but I'd rather be alerted to the issue so that I can investigate.
* ransomware
* free PR from haveibeenpwned (but not the kind you want)
* a burning desire to put my (or one of my AppSec/IR peers) kids through college.
That said, YMMV.
- with no advisory database/dependency scanning, you'll eventually suffer this parade of horribles
- with an advisory database / dependency scanning which results in tons of false positives, you will also suffer from the same parade of horribles.
A scanning system with relatively few false positives could change the result. But very very few groups can afford to follow up on all of these . And those which can tend to take ownership of their own dependencies, perhaps privately forking them (as Google did with Linux)
Maybe dependency advisor will eventually grow into the role we want them to fill and become far more useful. It's probably better than nothing in its current form, but it's hard to say how much better than nothing.
But ultimately, vuln lists are just lists not magic. You still have to apply them to your context.
looks like everyone's trying it :)
And yes, we have major deployment night and npm is offline, nice.