Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-15921: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in nvm-sh nvm

0
Low
VulnerabilityCVE-2026-15921cvecve-2026-15921cwe-22cwe-73
Published: 07/15/2026 (07/15/2026, 21:16:46 UTC)
Source: CVE Database V5
Vendor/Project: nvm-sh
Product: nvm

Description

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.

CVSS v4.0

Score 2.1low

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vuln. Confidentiality
None
Vuln. Integrity
Low
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

nvm
pkg:npm/nvm
Affected versions
>=0.32.1 <0.40.6

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

AILast updated: 07/15/2026, 21:48:15 UTC

Technical Analysis

The vulnerability in nvm (Node Version Manager) versions 0.32.1 through 0.40.5 involves improper validation of LTS codename fields obtained from the node.js mirror's index.tab file. Commands like 'nvm ls-remote' and 'nvm install --lts' use these codenames as filenames for alias files without sanitizing path traversal sequences. A malicious or compromised mirror can supply a codename containing path traversal characters (e.g., '../../../.bashrc'), causing nvm to write alias files outside the intended $NVM_DIR/alias directory, potentially overwriting critical user files such as shell startup scripts. Exploitation requires the user to run affected commands while configured to use a hostile mirror or under a man-in-the-middle attack. This vulnerability is fixed in nvm 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 responses can cause nvm to write files outside its intended directory, including overwriting user shell startup files. This can lead to arbitrary code execution when the user starts a new shell session. The vulnerability requires user interaction with affected nvm commands and use of a malicious or compromised mirror. The CVSS score is low (2.1) reflecting the need for user action and specific conditions for exploitation.

Mitigation Recommendations

Upgrade nvm to version 0.40.6 or later, which includes validation of remote LTS codenames to prevent path traversal. Until upgrading, avoid using untrusted or compromised mirrors and do not run affected commands with a hostile mirror configured. Patch status is not explicitly stated in the vendor advisory, but version 0.40.6 contains the fix. Check the official nvm repository or vendor advisory for the latest remediation guidance.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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/15/2026, 21:48:15 UTC

Last updated: 07/16/2026, 02:35:31 UTC

Views: 8

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses