CVE-2026-121747

nvm prints the contents of any readable file through a symlinked .nvmrc

Published Nov 4, 2026 CVSS 4.0 · 6.7 Medium EPSS < 1% KEV · Not listed
Description
Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.2.0 through 0.40.8, nvm does not check whether `.nvmrc` is a symbolic link. A repository or archive that ships `.nvmrc` as a symlink to another file (for example `../../.npmrc`, or `/proc/self/environ` on Linux) makes a plain `nvm use`, `nvm install`, `nvm which`, `nvm exec`, `nvm run`, or `nvm-exec` read that file and print its contents in the invalid-`.nvmrc` message (even with `--silent`) or, for a one-line file, in the `Found ... with version <...>` message; with the README's zsh `load-nvmrc` or bash `cdnvm` hook installed, entering the directory is enough. nvm sends the content nowhere; the attacker learns it only where they can see the victim's output, such as a CI log for a contributed branch. Version 0.41.0 still follows a symlinked `.nvmrc`, so deliberate links to another version file keep working, but never prints its content, and accepts it only if it contains a version or the name of an existing alias; the README's bash `cdnvm` hook, which read `.nvmrc` itself, now gets the version from nvm, so users of that hook must also update their copy of it.

Analysis

AI-generated

Technical impact

Nvm, the Node Version Manager, fails to validate whether the .nvmrc file is a symbolic link in versions 0.2.0 through 0.40.8. A repository that supplies .nvmrc as a symlink to any readable file (for example ../../.npmrc or /proc/self/environ) causes nvm commands such as nvm use, nvm install, or nvm exec to read that target file and print its contents to standard output. The attacker learns the file data only through the output that is visible to anyone who can see the process’s console or CI log, and the data is not transmitted elsewhere. The vulnerability therefore results in unauthorized disclosure of potentially sensitive information but does not lead to code execution or privilege escalation.

Affected Systems

The affected product is nvm‑sh:nvm, specifically all releases in the 0.2.0 through 0.40.8 range. The vendor recommends updating to version 0.41.0 or later to eliminate the flaw. Custom repository load scripts such as bash cdnvm or zsh load‑nvmrc that read .nvmrc directly must also be updated to accommodate the new behavior.

Risk and Exploitability

The CVSS score of 6.7 indicates a moderate severity. No EPSS score is reported and the vulnerability is not listed in CISA’s KEV catalog, yet the risk is non‑negligible in environments where untrusted code is executed, such as public CI pipelines or shared development directories. An attacker must be able to commit a symlinked .nvmrc to a project or have direct access to run nvm commands in the vulnerable directory; the exploit path is local and relies on the display of standard output. Because the data is only disclosed through output streams, the potential impact is limited to confidentiality breaches rather than system compromise.

Remediation

Vendor Solution

Upgrade to nvm 0.41.0 or later.


Vendor Workaround

Until upgrading, check for a symlinked `.nvmrc` (`ls -l .nvmrc`) before running nvm in an untrusted project directory, and do not run nvm in CI for untrusted branches where its output is visible to their authors.


OpenCVE Recommended Actions

  • Upgrade nvm to version 0.41.0 or newer.
  • Replace any custom nvm load scripts (e.g., cdnvm or load‑nvmrc) with the latest versions that retrieve the version from nvm rather than reading .nvmrc directly.
  • Avoid running nvm commands in directories that may contain a symlinked .nvmrc; remove or prevent such links in untrusted or shared projects.
  • If an immediate upgrade is not possible, inspect any .nvmrc for symbolic links (ls -l .nvmrc) before executing nvm and refrain from using nvm in CI workflows for untrusted branches where output is logged.

Generated by OpenCVE AI on November 4, 2026 at 22:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

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

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
Description Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.2.0 through 0.40.8, nvm does not check whether `.nvmrc` is a symbolic link. A repository or archive that ships `.nvmrc` as a symlink to another file (for example `../../.npmrc`, or `/proc/self/environ` on Linux) makes a plain `nvm use`, `nvm install`, `nvm which`, `nvm exec`, `nvm run`, or `nvm-exec` read that file and print its contents in the invalid-`.nvmrc` message (even with `--silent`) or, for a one-line file, in the `Found ... with version <...>` message; with the README's zsh `load-nvmrc` or bash `cdnvm` hook installed, entering the directory is enough. nvm sends the content nowhere; the attacker learns it only where they can see the victim's output, such as a CI log for a contributed branch. Version 0.41.0 still follows a symlinked `.nvmrc`, so deliberate links to another version file keep working, but never prints its content, and accepts it only if it contains a version or the name of an existing alias; the README's bash `cdnvm` hook, which read `.nvmrc` itself, now gets the version from nvm, so users of that hook must also update their copy of it.
Title nvm prints the contents of any readable file through a symlinked .nvmrc
Weaknesses CWE-200
CWE-59
CWE-61
References
Metrics cvssV3_1

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

cvssV4_0

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

Weaknesses
  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

  • CWE-61

    UNIX Symbolic Link (Symlink) Following

Sources

Status
PUBLISHED
Assigner
harborist
Published
Updated
Nov 9, 2026, 8:45 PM
Reserved
Nov 3, 2026, 11:38 PM
Status
Awaiting Analysis
Published
Nov 4, 2026, 10:17 PM
Modified
Nov 10, 2026, 9:46 PM
Severity
Moderate
Public date
Nov 4, 2026, 9:30 PM