Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2026-118905

published high CVSS 4.0 · 7.1

nvm_ls lets an untrusted version string inject sed commands, executing arbitrary commands with GNU sed

Published
29 Oct 2026, 05:22:35 UTC
Updated
05 Nov 2026, 20:46:27 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
nvm-sh — nvm0.31.2 to < 0.40.6 · Other versions: unaffected Affected Not stated harborist

Description

Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.31.2 through 0.40.5, `nvm_ls` filters installed versions with a sed program that embeds the requested version pattern in a `\#...#` address, escaping `.` (and, since 0.40.4, `#`) but not backslash. A version string containing `#` (or `\#`) therefore closes the address early, and the rest of it is parsed as sed commands: with GNU sed, the `e` command runs a shell command as the user; with BSD sed, the `w` and `r` commands write and read files. This is reachable whenever an attacker-influenced version string is passed to `nvm use`, `nvm which`, `nvm ls`, `nvm version`, `nvm run`, or `nvm exec`, or to `nvm-exec` via `NODE_VERSION`, and at least one version is installed. nvm's own `.nvmrc` parser strips comments, so a bare `nvm use` is not affected; however, the bash `cdnvm` and zsh `load-nvmrc` auto-switch hooks documented in the README read `.nvmrc` as-is and pass it to `nvm ls` and `nvm version`, so a user with one of those hooks installed runs the attacker's command just by changing into a directory under a malicious `.nvmrc`; scripts that run `nvm use "$(cat .nvmrc)"` are affected the same way. Version 0.40.6 passes any version pattern containing `#` or a newline through the `.nvmrc` content parser first, so no `#` reaches the sed program.

en · harborist · cna

Vendor advisories explicitly linked to this CVE.

0

No linked advisories were found for this CVE.

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
4.0
Base score
7.1 / 10
Severity
high
Provider
harborist · cna
Vector string
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
Scenarios
en: GENERAL

Additional Assessments

Additional normalized CVSS assessments
VersionScoreSeverityProviderVectorScenarios
3.1 7.0 high harborist · cna CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H en: GENERAL

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
nvm-sh nvm 0.31.2 to < 0.40.6 (affected · semver)Default: unaffected harborist · cna

Weaknesses

2
  • CWE-78 CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (harborist · cna)
  • CWE-94 CWE-94 Improper Control of Generation of Code ('Code Injection') (harborist · cna)

References

4
  • Fix commit 82315e2b https://github.com/nvm-sh/nvm/commit/82315e2b189528a006da6701eac30e8c364ffd22 patch Contributors: harborist (cna)
  • nvm-sh/nvm#3854 https://github.com/nvm-sh/nvm/pull/3854 patch Contributors: harborist (cna)
  • v0.40.6 https://github.com/nvm-sh/nvm/releases/tag/v0.40.6 release-notes Contributors: harborist (cna)
  • GHSA-vgqf-vc3m-4wv3 https://github.com/nvm-sh/nvm/security/advisories/GHSA-vgqf-vc3m-4wv3 vendor-advisory Contributors: harborist (cna)

Provider assertions

2

harborist · cna

nvm_ls lets an untrusted version string inject sed commands, executing arbitrary commands with GNU sed

CISA-ADP · adp

CISA ADP Vulnrichment

Provenance

Schema
5.2
Searchable
yes
Content hash
5903e7e593029c944bb7e90c68336c7eec0f6511f02f65c787d47ee57822845f
Ingested
07 Nov 2026, 23:39:08 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected