Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessVictim clones attacker repo with symlinked .nvmrc
-
ExploitVictim runs nvm use/install with --save (or -w)
-
Executiontee follows the symlink and opens target with O_TRUNC
-
ImpactWritable 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 |
| 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 |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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.
Primary rating from Vendor (harborist).
CVSS VectorVendor: harborist
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Command injection in nvm (Node Version Manager) versions through 0.40.4 allows attackers controlling the configured Node
OS command injection in Node Version Manager (nvm) 0.31.2 through 0.40.5 lets an attacker-influenced version string brea
Information disclosure in nvm versions before 0.40.8 allows a local attacker who controls a repository to read arbitrary
Information disclosure in Node Version Manager (nvm) versions 0.2.0 through 0.40.8 allows a repository or archive that s
Argument injection in Node Version Manager (nvm) 0.5.0 through 0.40.8 lets a malicious `.nvmrc` smuggle grep options and
Node Version Manager (nvm) 0.39.6 through 0.40.8 contains a command injection path in which the version column of a Node
Path traversal in nvm versions 0.32.1 through 0.40.5 allows a hostile Node.js mirror to overwrite arbitrary files in the
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
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
File corruption and permission weakening in Node Version Manager (nvm) 0.27.0 through 0.40.8 arise when a project `.npmr
EUVD-2026-117176
NVD
CVE.org
EPSS
GitHub
Exploit-DB