Skip to main content
VulnerabilityPublished

CVE-2026-118905: nvm · OS Command Injection

Affects nvmSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 7.1 High : upgrade to 0.40.6 soon.

Data as of 29 Oct 2026, 07:26 UTC

CVSS 4.0 base score
7.1High
How severe the flaw is on the 0–10 CVSS scale.

Thin evidence

One scorer or none
CVSS scores by source
CNA (harborist)CVSS 4.07.1
CNA (harborist)CVSS 3.17.0
Patch
Available – fixed in 0.40.6
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 29 Oct 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.

What to do

Upgrade nvm to 0.40.6.

Affected software

ProductAffectedFixed in
nvm-shnvmAffected
  • >=0.31.2 <0.40.6
Fixed in
  • 0.40.6
GitHubnvmpkg:github/nvmOther threatsAffected
  • >=0.31.2 <0.40.6
Fixed in
  • 0.40.6

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Upgrade to nvm version 0.40.6 or later, where the vulnerability is fixed by filtering version patterns containing '#' or newlines before they reach the sed command. Until upgraded, avoid using untrusted version strings in nvm commands or environment variables. Users employing bash cdnvm or zsh load-nvmrc auto-switch hooks should be aware that changing into directories with malicious .nvmrc files can trigger this vulnerability. No other mitigations are documented.

Description

Node Version Manager (nvm) versions 0.31.2 through 0.40.5 contain an OS command injection vulnerability in the nvm_ls function. This occurs because version strings with '#' characters can prematurely close a sed address, allowing execution of arbitrary shell commands via GNU sed's 'e' command or BSD sed's 'w' and 'r' commands. This vulnerability can be triggered by attacker-controlled version strings passed to various nvm commands or environment variables, and is exploitable when at least one version is installed. Version 0.40.6 fixes this issue by filtering version patterns containing '#' or newlines before they reach the vulnerable sed command.

References

Community reviews

Loading reviews…