CVE-2026-15921: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in nvm-sh nvm
Node Version Manager (nvm) versions 0.32.1 through 0.40.5 contain a path traversal vulnerability in commands that refresh remote LTS aliases, such as `nvm ls-remote` and `nvm install --lts`. This occurs because nvm uses the LTS codename from the node.js mirror as an alias filename without validating it, allowing a malicious mirror to cause files outside the intended directory to be overwritten. Exploitation requires use of a hostile mirror and running an affected command. Version 0.40.6 and later validate these codenames to prevent this issue.
AI Analysis
Technical Summary
The vulnerability (CVE-2026-15921) in nvm-sh's nvm affects versions 0.32.1 through 0.40.5. The `nvm ls-remote` and similar commands parse the node.js mirror's `index.tab` file and use the LTS codename field as an alias filename without proper validation. A malicious or compromised mirror can supply an LTS codename containing path traversal sequences (e.g., `../../../.bashrc`), causing nvm to write alias files outside the intended `$NVM_DIR/alias` directory. This can overwrite critical user files such as shell startup scripts, potentially leading to code execution in subsequent shell sessions. Exploitation requires the user to run an affected command while configured to use a hostile mirror. The issue is fixed in version 0.40.6 by validating and rejecting unsafe path components in LTS codenames.
Potential Impact
An attacker controlling or intercepting the node.js mirror used by nvm can cause arbitrary files in the user's home directory to be created or overwritten by supplying malicious LTS codenames with path traversal sequences. This can lead to persistent code execution when the user starts a new shell session, by overwriting shell startup files. The vulnerability requires user interaction to run affected nvm commands and the use of a hostile mirror, limiting the attack scope. The CVSS score is low (2.1) reflecting these conditions.
Mitigation Recommendations
Users should upgrade nvm to version 0.40.6 or later, which includes validation to reject unsafe LTS codename aliases and prevents path traversal. Until upgraded, users should avoid using untrusted or compromised mirrors and be cautious about network environments that could enable man-in-the-middle attacks on the mirror URL. Patch status is not explicitly confirmed in the advisory, but version 0.40.6 contains the fix. No other mitigations are specified.
CVE-2026-15921: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in nvm-sh nvm
Description
Node Version Manager (nvm) versions 0.32.1 through 0.40.5 contain a path traversal vulnerability in commands that refresh remote LTS aliases, such as `nvm ls-remote` and `nvm install --lts`. This occurs because nvm uses the LTS codename from the node.js mirror as an alias filename without validating it, allowing a malicious mirror to cause files outside the intended directory to be overwritten. Exploitation requires use of a hostile mirror and running an affected command. Version 0.40.6 and later validate these codenames to prevent this issue.
CVSS v4.0
Score 2.1low
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability (CVE-2026-15921) in nvm-sh's nvm affects versions 0.32.1 through 0.40.5. The `nvm ls-remote` and similar commands parse the node.js mirror's `index.tab` file and use the LTS codename field as an alias filename without proper validation. A malicious or compromised mirror can supply an LTS codename containing path traversal sequences (e.g., `../../../.bashrc`), causing nvm to write alias files outside the intended `$NVM_DIR/alias` directory. This can overwrite critical user files such as shell startup scripts, potentially leading to code execution in subsequent shell sessions. Exploitation requires the user to run an affected command while configured to use a hostile mirror. The issue is fixed in version 0.40.6 by validating and rejecting unsafe path components in LTS codenames.
Potential Impact
An attacker controlling or intercepting the node.js mirror used by nvm can cause arbitrary files in the user's home directory to be created or overwritten by supplying malicious LTS codenames with path traversal sequences. This can lead to persistent code execution when the user starts a new shell session, by overwriting shell startup files. The vulnerability requires user interaction to run affected nvm commands and the use of a hostile mirror, limiting the attack scope. The CVSS score is low (2.1) reflecting these conditions.
Mitigation Recommendations
Users should upgrade nvm to version 0.40.6 or later, which includes validation to reject unsafe LTS codename aliases and prevents path traversal. Until upgraded, users should avoid using untrusted or compromised mirrors and be cautious about network environments that could enable man-in-the-middle attacks on the mirror URL. Patch status is not explicitly confirmed in the advisory, but version 0.40.6 contains the fix. No other mitigations are specified.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- harborist
- Date Reserved
- 2026-07-15T20:49:26.387Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a57fcc868715ace4384e498
Added to database: 07/15/2026, 21:34:00 UTC
Last enriched: 07/22/2026, 23:01:31 UTC
Last updated: 08/29/2026, 22:52:09 UTC
Views: 71
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.