CVE-2026-118905: nvm · OS Command Injection
Affects nvmSource CVE Database V5
Not known to be exploited · CVSS 7.1 High : upgrade to 0.40.6 soon.
Data as of 29 Oct 2026, 07:26 UTC
Thin evidence
One scorer or none| CNA (harborist) | CVSS 4.0 | 7.1 |
|---|---|---|
| CNA (harborist) | CVSS 3.1 | 7.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:NExploitation evidence
Disclosed: evidence found.
CVE published 29 Oct 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by 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
| Product | Affected | Fixed in |
|---|---|---|
| nvm-shnvm | Affected
| Fixed in
|
GitHubnvmpkg:github/nvmOther threats | Affected
| Fixed in
|
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.