CVE-2026-10796

nvm executes commands from a malicious Node.js mirror's version strings

Published Jun 4, 2026 CVSS 4.0 · 7.5 High EPSS 5.0% KEV · Not listed
Description
nvm (Node Version Manager) through 0.40.4 executes arbitrary commands from version strings supplied by the configured Node.js/io.js mirror. Commands such as `nvm install` read the available versions from the mirror's index.tab and use the selected version, without sanitization, to build download URLs and shell/awk commands. Two sinks are affected by the same untrusted input: nvm_download() built a curl/wget command string and ran it with `eval`, so a version field containing command substitution (for example $(id)) was executed by the local shell; and nvm_get_checksum() interpolated the version-derived download slug into an awk program, so a crafted version could execute arbitrary commands via awk's system(). An attacker who controls the configured mirror, supplies mirror content to a user or CI on a non-default mirror, or machine-in-the-middles a non-TLS mirror can ∴ run arbitrary commands with the privileges of the user running nvm. The default mirror (https://nodejs.org over TLS) is not affected. Fixed on master (pending the next tagged release) by passing every argument as a literal argv element instead of using eval, by passing the value to awk as data via -v instead of interpolating it into the program, and by rejecting any version outside the Node.js/io.js version grammar before it is used.

Analysis

AI-generated

Technical impact

nvm (Node Version Manager) reads version strings from configured Node.js mirrors and uses them to build download URLs and shell/awk commands without sanitization. A crafted version field such as $(id) triggers command substitution in the evalled curl/wget string and in the awk system() call, allowing an attacker to run arbitrary commands with the privileges of the user executing nvm. The vulnerability is limited to the process of nvm and does not provide network or system‑wide privileges beyond those of the nvm invoker.

Affected Systems

Any installation of nvm-sh:nvm through version 0.40.4 that utilizes a non‑default or potentially compromised mirror. This includes systems where the mirror URL has been manually changed, where an attacker controls the mirror, or where a man‑in‑the‑middle attack can alter mirror content. The default HTTPS endpoint https://nodejs.org is not affected, but any custom mirror configuration exposes the risk.

Risk and Exploitability

The CVSS score of 7.5 indicates high severity, while the EPSS score of 5% indicates a moderate probability of exploitation. The vulnerability is not listed in the CISA KEV catalog. An attacker must influence the mirror to supply malicious version strings; this is feasible for users who have administrative access to the mirror or who can intercept traffic to a non‑TLS mirror. The exploit path is straightforward once the malicious content is injected, with a very low barrier to successful exploitation if the conditions are met.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade nvm to a version that includes the security fix (e.g., release 0.40.5 or later).
  • Revert to the default nodejs.org mirror https://nodejs.org/, which is served over TLS and is unaffected by this issue.
  • If a custom mirror must be used, ensure it is secured with TLS, verify its authenticity, and confirm that the mirror’s index files do not contain shell syntax before use.

Generated by OpenCVE AI on September 24, 2026 at 18:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Openjsf
Openjsf node Version Manager
CPEs cpe:2.3:a:openjsf:node_version_manager:*:*:*:*:*:node.js:*:*
Vendors & Products Openjsf
Openjsf node Version Manager
Type Values Removed Values Added
First Time appeared Nvm-sh
Nvm-sh nvm
Vendors & Products Nvm-sh
Nvm-sh nvm
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description nvm (Node Version Manager) through 0.40.4 executes arbitrary commands from version strings supplied by the configured Node.js/io.js mirror. Commands such as `nvm install` read the available versions from the mirror's index.tab and use the selected version, without sanitization, to build download URLs and shell/awk commands. Two sinks are affected by the same untrusted input: nvm_download() built a curl/wget command string and ran it with `eval`, so a version field containing command substitution (for example $(id)) was executed by the local shell; and nvm_get_checksum() interpolated the version-derived download slug into an awk program, so a crafted version could execute arbitrary commands via awk's system(). An attacker who controls the configured mirror, supplies mirror content to a user or CI on a non-default mirror, or machine-in-the-middles a non-TLS mirror can ∴ run arbitrary commands with the privileges of the user running nvm. The default mirror (https://nodejs.org over TLS) is not affected. Fixed on master (pending the next tagged release) by passing every argument as a literal argv element instead of using eval, by passing the value to awk as data via -v instead of interpolating it into the program, and by rejecting any version outside the Node.js/io.js version grammar before it is used.
Title nvm executes commands from a malicious Node.js mirror's version strings
Weaknesses CWE-78
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 7.5, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Sources

Status
PUBLISHED
Assigner
openjs
Published
Updated
Jun 4, 2026, 6:11 PM
Reserved
Jun 3, 2026, 9:17 PM
Status
Analyzed
Published
Jun 4, 2026, 6:16 PM
Modified
Jul 22, 2026, 8:10 PM