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.
Published: 2026-07-15
Score: 2.1 Low
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

In versions 0.32.1 through 0.40.5, the nvm ls-remote command parses the LTS codename from mirror metadata and writes the alias file using that codename without sanitization. A malicious mirror can supply a codename that contains relative path components, such as '../../../.bashrc', causing nvm to create or overwrite files outside the expected alias directory. Overwriting shell startup files allows an attacker to inject code that will run in subsequent shell sessions, effectively giving remote code execution privileges to the user.

Affected Systems

Node Version Manager, commonly known as nvm, a shell function for managing node.js versions, is affected in releases 0.32.1 through 0.40.5 of the nvm‑sh:nvm package. The vulnerability exists when the default ~/.nvm layout is used or when a non‑default mirror is configured via the NVM_NODEJS_ORG_MIRROR or NVM_IOJS_ORG_MIRROR environment variables. Users who rely on nvm ls‑remote, nvm install --lts, or other alias‑refreshing commands while pointing to an untrusted mirror are potentially impacted.

Risk and Exploitability

The CVSS score of 2.1 indicates low overall severity, and the EPSS score of less than 1% suggests a low probability of exploitation at this time. However, because the flaw permits the attacker to write arbitrary files in the user’s home directory, including shell startup files, and can be triggered simply by invoking nvm ls‑remote against a malicious mirror, the strategic impact remains significant. The vulnerability is not listed in the CISA KEV catalog, but it remains a remote code execution risk when a hostile mirror is present. Attackers can compromise a mirror or perform a man‑in‑the‑middle attacks to supply the specially crafted LTS codename, then run any nvm command that refreshes aliases to achieve code execution, an inference based on the description.

Generated by OpenCVE AI on July 31, 2026 at 02:36 UTC.

Remediation

Vendor Solution

Upgrade to nvm 0.40.6 or later, which validates remote LTS codenames and rejects `..` path components when writing alias files. (Only needed if using a non-default mirror whose metadata contents you do not trust).


Vendor Workaround

Until upgrading, only run `nvm ls-remote` and LTS-refreshing commands against trusted mirrors over TLS, and ensure `NVM_NODEJS_ORG_MIRROR` and `NVM_IOJS_ORG_MIRROR` point only at trusted endpoints.


OpenCVE Recommended Actions

  • Upgrade to nvm 0.40.6 or newer, which validates remote LTS codenames and rejects unsafe path components when writing alias files.
  • If an upgrade is not yet possible, ensure that all NVM_*_MIRROR environment variables point only to trusted TLS endpoints and avoid using untrusted mirrors.
  • Avoid running nvm ls‑remote, nvm install --lts, or similar alias-refreshing commands against any non‑trusted mirror until the patch is applied.

Generated by OpenCVE AI on July 31, 2026 at 02:36 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 16 Jul 2026 13:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 15 Jul 2026 23:15:00 +0000

Type Values Removed Values Added
First Time appeared Nvm-sh
Nvm-sh nvm
Vendors & Products Nvm-sh
Nvm-sh nvm

Wed, 15 Jul 2026 21:30:00 +0000

Type Values Removed Values Added
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.
Title nvm path traversal via a malicious mirror's LTS codename writes outside the alias directory
Weaknesses CWE-22
CWE-73
References
Metrics cvssV3_1

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

cvssV4_0

{'score': 2.1, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: harborist

Published:

Updated: 2026-07-16T12:53:35.897Z

Reserved: 2026-07-15T20:49:26.387Z

Link: CVE-2026-15921

cve-icon Vulnrichment

Updated: 2026-07-16T12:53:32.360Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T02:45:04Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-73

    External Control of File Name or Path