Replies: 3 comments
|
The presence of a CVE in one of npm's transitive dependencies does not, by itself, mean that the npm CLI is vulnerable. Whether npm is actually affected depends on two things:
For example, CVE-2026-13149 in NVD: This is also consistent with previous npm discussions. For example, in npm/cli#8917, the maintainers explained that although a dependency had a reported vulnerability, npm CLI itself was not considered vulnerable because of how it used that dependency rather than simply because the dependency existed in the dependency graph. So, for a CVE like this, the questions that matter are:
Without establishing that call path, the existence of the vulnerable package in npm's dependency tree alone is not sufficient to conclude that npm CLI is exploitable. I think guidance from the npm maintainers on those specific questions would be valuable, because it would allow downstream consumers to assess whether a reported dependency CVE is actually reachable and exploitable within the context of normal npm CLI usage. Ultimately, whether a specific dependency CVE is reachable within npm CLI can only be established by examining how npm invokes the affected dependency, for example, through a code audit of the relevant call sites or confirmation from the npm maintainers. The dependency advisory alone is not sufficient to establish that npm is affected, because it describes the vulnerability in the library itself, not how any particular application uses it. Hope this helps |
|
A practical way to assess these reports is to treat them as reachability questions, not just dependency-version questions. For the A quick code search in
That gives you a concrete starting point for the reachability review:
For This distinction also explains why maintainers sometimes say “npm is not vulnerable” even when a transitive dependency has a CVE: the vulnerable library is present, but the vulnerable function may only be called with constrained/local inputs, or not called in the affected way. A useful report to npm maintainers would be structured like this: That gives maintainers something more actionable than a dependency tree alert. It also lets downstream consumers separate “must patch immediately because registry/package input reaches it” from “dependency scanner finding, but only local trusted input appears reachable.” |
|
The key distinction is "dependency contains a CVE" != "npm is vulnerable." Reachability is what matters.
|
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
Body
Hi,
I would like to ask about some guidance when it comes to CVEs reported against npm's own dependencies.
We get reports on a near-weekly basis against npm dependencies such as minimatch, node-tar, brace-expansion, and undici, with CVEs usually centered around some sort of unsanitized input.
We have on previous occasions received feedback—for example regarding
node-tarin npm/cli#8917—that npm is not vulnerable to a dependency's CVE due to npm-specific filtering.I would like to better understand whether it is possible for these CVEs to be exploited within the context of standard npm usage. For example, how could an attacker actually trigger the latest brace-expansion DoS vulnerability within the
expand()function through standard npm commands?Key areas I am trying to figure out:
How are inputs routed to these dependencies?
For example, in the case of
brace-expansion's DoS vulnerability (CVE-2026-13149) in theexpand()function: does npm ever pass unvalidated, third-party package data (like fields in a fetchedpackage.jsonor arbitrary package names) into these expansion and matching libraries? Or are these utilities only invoked on local configuration, deterministic paths, and command-line arguments explicitly provided by the system administrator?How does the project treats these transitive CVEs?
For example, does the project distinguish between "offline/local-only CLI execution risks" (where an attacker already needs local execution privileges to exploit npm) versus "remote package-registry parsing risks" (where a malicious package published to registry metadata could trigger a crash/execution)?
Resources for self-assessment:
Are there any community resources, write-ups, or past issue analyses you would recommend that demonstrate how to audit the reachability of a sub-dependency vulnerability specifically within the npm CLI codebase?
I understand that this is a very broad question, but from our POV, it is necessary to determine how vulnerable our clients will actually be before we start blindly patching. I would appreciate it if anyone could share their insight on how the project deals with this sort of CVE report, or point me towards some resources that could help me understand the possible attack vectors of these unsanitized input CVEs.
All reactions