nvm prints contents of arbitrary files through a symlinked .nvmrc
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Active
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-200.
Summary
nvm from 0.2.0 before 0.41.0 does not check whether .nvmrc is a symbolic link (CWE-59). A repository or archive that links .nvmrc to another file makes commands such as nvm use or nvm install print that file's contents in their messages, even with --silent. An attacker must supply the repository and be able to see the victim's output, such as a CI log, to read the content.
Written with Claude Haiku 5.5 from the sources below · 2026-11-06
Description from the CNA
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Update nvm to 0.41.0, which still follows symlinked .nvmrc files but never prints their contents. Users of the README's bash cdnvm hook must also update their copy of it, because it now gets the version from nvm.
Written with Claude Haiku 5.5 from the sources below · 2026-11-06
- Fix · CNA nvm (nvm-sh) Fixed in 0.41.0
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
nvm-sh nvm 0.41.0
7 records Highest priority Priority LOW 7 LOW
Other records, highest priority first
- TI-2026-85226 nvm --save follows symlinked .nvmrc and overwrites filesPriority LOW 29
- TI-2026-85228 nvm passes .nvmrc contents to grep, leaking local filesPriority LOW 20
- TI-2026-85216 Command injection in nvm through malicious mirror LTS alias valuesPriority LOW 11
Vendor assessments
Timeline
- 2026-11-04 Threatist record created from CVE-2026-121747
- 2026-11-06 Priority changed: MEDIUM → LOW
- 2026-11-06 Affected versions changed · Red Hat
- 2026-11-06 CVSS score added · Red Hat
References
Advisory 1
More nvm-sh vulnerabilities
- TI-2026-13337 nvm path traversal via a malicious mirror's LTS codename writes outside the alias directory CVSS 4.0LOW 2.1
- TI-2026-82282 Command injection in nvm lets version strings run arbitrary commands CVSS 4.0HIGH 7.1
- TI-2026-85226 nvm --save follows symlinked .nvmrc and overwrites files CVSS 4.0MEDIUM 6.7
- TI-2026-63368 nvm alias resolution follows `..` and discloses files outside $NVM_DIR/alias CVSS 4.0MEDIUM 6.7
- TI-2026-01349 Command Injection in nvm via NVM_AUTH_HEADER in wget code path CVSS 4.0MEDIUM 5.4
- TI-2026-85228 nvm passes .nvmrc contents to grep, leaking local files CVSS 4.0MEDIUM 4.6
Sources
- CVE-2026-121747 · CVE Program
- CVE-2026-121747 · NVD
- FIRST EPSS
- CVE-2026-121747 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences