Skip to main content

nvm CVE-2026-121746

| EUVDEUVD-2026-117176 MEDIUM
Improper Link Resolution Before File Access (CWE-59)
2026-11-04 harborist
6.7
CVSS 4.0 · Vendor: harborist
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Victim clones attacker repo with symlinked .nvmrc
  2. Exploit
    Victim runs nvm use/install with --save (or -w)
  3. Execution
    tee follows the symlink and opens target with O_TRUNC
  4. Impact
    Writable file outside repo overwritten with version string, link left clean

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Symlink resolution safety
Exploitation Conditions

Three conditions must all hold: (1) the victim clones a repository in which .nvmrc is committed as a symbolic link (git recreates it on clone) pointing at a file outside the repo, or a dangling link; (2) the victim runs nvm use or nvm install with the non-default --save flag or its undocumented -w alias inside that directory - this flag is the only non-default element required; (3) the symlink target is a path the user can write. Limiting factors that reduce real-world risk: it requires local user interaction (invoking --save), it only triggers on the non-default save flags, the attacker cannot control the written content (only the resolved version string is written, so no code execution), and affected versions are 0.40.0-0.40.8. The link is left in place afterward so git status stays clean, which hides the corruption.

Impact

This is a genuine but bounded integrity/data-loss issue, not the RCE its tag implies. The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N = 6.7) and the reporter's CVSS 3.1 (AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N = 5.5) agree on the mechanics: local vector, no authentication (PR:N), but active user interaction required (the victim must run nvm with the non-default --save/-w flag inside an attacker-supplied clone). Impact is integrity-only: an attacker-chosen file the user can write is truncated and replaced with the resolved node version string. Crucially, the attacker does NOT control the written content, so this is destructive data loss, not code execution - the 'RCE' input tag is incorrect and contradicts the vendor advisory's explicit statement. No CISA KEV listing and no EPSS score are provided in the input, consistent with a developer-workstation flaw rather than a mass-exploited network service. A detailed, reproducible proof-of-concept is published inside the GHSA advisory itself, but the input does not mark it as confirmed weaponized exploit code and there is no evidence of active exploitation. The vuln.today priority of 'this_month' matches the picture: a real issue worth patching on a normal cycle, not an emergency. The main real-world risk is silent corruption of sensitive files (~/.ssh/authorized_keys, shell rc files, ~/.npmrc) with git status staying clean, so the damage can go unnoticed.

Exploit ScenarioDerived

An attacker publishes a repository that commits .nvmrc as a symbolic link pointing outside the project (e.g. to ~/.ssh/authorized_keys or a shell startup file); git faithfully recreates the link on clone. When the victim clones the repo and runs nvm use --save or nvm install --save in that directory, tee follows the symlink and truncates the target, replacing its contents with the version string. A full, reproducible PoC is documented in the GHSA advisory; exploitation requires only the local non-default --save/-w flag and the victim's user interaction.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 04, 2026

Node Version Manager (nvm) 0.40.0 through 0.40.8 writes the pinned version with tee into $PWD/.nvmrc, which follows symbolic links, so a repository that commits .nvmrc as a symlink to a path outside itself can make nvm use --save or nvm install --save (or the undocumented -w alias) truncate and replace any file the victim can write - a shell startup file or ~/.ssh/authorized_keys, for example - or create the target of a dangling link. The written content is always the resolved version string, which the attacker does not control, so the outcome is destructive data loss and integrity damage (VC:N/VI:H/VA:N) rather than code execution, despite the advisory's 'RCE' tag; the link is left in place afterwards so git status remains clean. A detailed lab reproduction is published in the vendor advisory, but there is no confirmed active exploitation (not in CISA KEV) and the flaw requires local user interaction plus the non-default --save/-w flag, so real-world risk is bounded; nvm 0.41.0 refuses to write through a symlink.

RemediationAI

Vendor-released patch: 0.41.0, delivered in commit 3f8411e5, which makes nvm use --save and nvm install --save (and -w) refuse to write when .nvmrc in the current directory is a symlink - dangling or not - returning exit code 3 and printing a warning instead of writing through the link or replacing it; upgrade with the standard nvm install/update path and verify nvm --version reports 0.41.0. Apply the release advisory guidance at https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh. Where upgrading must wait, note that per the vendor and reporter testing the write path is only reachable when --save or -w is passed inside a directory whose .nvmrc is a symlink: a plain-file .nvmrc does not trigger the overwrite, and nvm use without --save leaves the target unchanged, so operators working in freshly cloned, untrusted repositories can avoid the truncation by not passing those flags, or by removing the symlinked .nvmrc entry before saving. These are risk-limiting conditions documented in the advisory, not complete substitutes for the patched release, since only 0.41.0 adds the [ -L ] refusal that stops the write outright.

Affected VersionsENISA

nvm 0.40.0 <0.41.0

Affected Packages

euvd nvm fix: 0.41.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The defect is a classic link-following write (CWE-59) in the nvm_write_nvmrc shell function of nvm.sh, which performs echo "${VERSION_STRING}" | tee "$PWD"/.nvmrc > /dev/null. tee opens the destination with truncation and resolves symbolic links, and nothing tests whether the entry is a link before writing; the path is built from $PWD rather than from nvm_find_nvmrc, so the file acted on is the one in the directory the user is standing in. The call sites are reached from nvm install and nvm use only when --save or its undocumented -w alias is supplied, which is the sole non-default element required. Git records a committed symlink as mode 120000 and recreates it on clone, so an upstream repository can place a link pointing outside the working tree - absolute, relative ../, or dangling - and the victim's own write then lands on the link target. The same file already applies the missing guard elsewhere: nvm_check_file_permissions uses [ ! -L "${FILE}" ] before descending. Package data identifies the affected component as nvm-sh/nvm (CPE cpe:2.3:a:nvm-sh:nvm:*:*:*:*:*:*:*:*), versions 0.40.0 through 0.40.8, including master at e780535 and 5e38bc0c. The fix in commit 3f8411e5 adds an [ -L "$PWD"/.nvmrc ] check that returns exit code 3 with the warning 'Not writing version number (…) to .nvmrc, because it is a symbolic link', suppressible via NVM_SILENT=1, and ships a unit test covering both live and dangling links so the target is left untouched and the link is preserved. This is tracked separately from GHSA-j6ch-mq5c-3h4x, which covers disclosure via reading a symlinked .nvmrc (a confidentiality issue); this advisory covers the write path (integrity).

Know when Nvm gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (harborist) PRIMARY 6.7 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
vuln.today AI 5.5 MEDIUM

Local because exploitation needs the victim to run nvm --save in a cloned repo (UI:R); no auth (PR:N); integrity-only file overwrite (I:H), no confidentiality or availability impact and no scope change.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (harborist).

CVSS VectorVendor: harborist

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.40.0 through 0.40.8, nvm use --save and nvm install --save (or -w) write the resolved version to $PWD/.nvmrc with tee, which follows a symbolic link. A repository that commits .nvmrc as a symlink to a path outside itself (git recreates the link on clone) therefore makes --save truncate any file the user can write, such as a shell startup file or ~/.ssh/authorized_keys, and replace its contents with the version string, or create the target of a dangling link; the link itself is left unchanged, so git status stays clean. The attacker does not control the content written, so this is data loss, not code execution. Version 0.41.0 refuses, with a warning, to write when .nvmrc in the current directory is a symlink, dangling or not, rather than writing through it or replacing it.

Threat Intelligence Overview

EPSS Score
0.2%
Top 94% exploitable
Prevalence
High
extremely popular developer tool for managing Node.js versions
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
High

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

More in Nvm

View all
CVE-2026-10796 HIGH
7.5 Jun 04

Command injection in nvm (Node Version Manager) versions through 0.40.4 allows attackers controlling the configured Node

CVE-2026-118905 HIGH
7.1 Oct 29

OS command injection in Node Version Manager (nvm) 0.31.2 through 0.40.5 lets an attacker-influenced version string brea

CVE-2026-94185 MEDIUM
6.7 Sep 21

Information disclosure in nvm versions before 0.40.8 allows a local attacker who controls a repository to read arbitrary

CVE-2026-121747 MEDIUM
6.7 Nov 04

Information disclosure in Node Version Manager (nvm) versions 0.2.0 through 0.40.8 allows a repository or archive that s

CVE-2026-121749 MEDIUM
4.6 Nov 04

Argument injection in Node Version Manager (nvm) 0.5.0 through 0.40.8 lets a malicious `.nvmrc` smuggle grep options and

CVE-2026-121751 LOW
2.1 Nov 04

Node Version Manager (nvm) 0.39.6 through 0.40.8 contains a command injection path in which the version column of a Node

CVE-2026-15921 LOW
2.1 Jul 15

Path traversal in nvm versions 0.32.1 through 0.40.5 allows a hostile Node.js mirror to overwrite arbitrary files in the

CVE-2026-121750 LOW
2.1 Nov 04

nvm versions 0.40.5 through 0.40.8 can be made to install and execute a tampered Node.js release tarball that its own ch

CVE-2026-121745 LOW
2.0 Nov 04

nvm 0.40.0 through 0.40.8 leaks the opt-in NVM_AUTH_HEADER mirror credential to other local users because nvm_download p

CVE-2026-121748 LOW
1.8 Nov 04

File corruption and permission weakening in Node Version Manager (nvm) 0.27.0 through 0.40.8 arise when a project `.npmr

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy