{"affected":[{"defaultStatus":"unaffected","product":"nvm","source":"CNA: harborist","vendor":"nvm-sh","versions":[{"lessThan":"0.41.0","status":"affected","version":"0.40.0","versionType":"semver"}]}],"cveId":"CVE-2026-121746","cwes":["CWE-59"],"description":"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.","epss":null,"exploits":[],"kev":null,"metrics":[{"score":6.7,"severity":"medium","source":"CNA: harborist","vector":"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","version":"4.0"},{"score":5.5,"severity":"medium","source":"CNA: harborist","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1"},{"score":6.7,"severity":"medium","source":"NVD: 7ffcee3d-2c14-4c3e-b844-86c6a321a158","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","version":"4.0"},{"score":5.5,"severity":"medium","source":"NVD: 7ffcee3d-2c14-4c3e-b844-86c6a321a158","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1"}],"modifiedAt":1793830674160,"publishedAt":1793827917022,"references":[{"source":"CNA: harborist","tags":["vendor-advisory"],"url":"https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh"},{"source":"CNA: harborist","tags":["patch"],"url":"https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7"},{"source":"7ffcee3d-2c14-4c3e-b844-86c6a321a158","tags":[],"url":"https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7"},{"source":"7ffcee3d-2c14-4c3e-b844-86c6a321a158","tags":[],"url":"https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh"}],"remediation":[{"kind":"fix","source":"CNA: harborist","text":"Upgrade to nvm 0.41.0 or later."},{"kind":"workaround","source":"CNA: harborist","text":"Until upgrading, check that `.nvmrc` is not a symlink (`ls -l .nvmrc`) before running `nvm use --save` or `nvm install --save` in an untrusted project directory."},{"kind":"fix","source":"CNA: harborist","text":"The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches.","url":"https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7"}],"revision":"30843daf9925b40c9ef5bbf0eadd63fbd69206f0ad7946d7edeb7456ed444553","sources":[{"modifiedAt":1793827917022,"name":"CNA: harborist","retrievedAt":1793830351621,"url":"https://www.cve.org/CVERecord?id=CVE-2026-121746"},{"modifiedAt":1793830674160,"name":"NVD","retrievedAt":1793838298264,"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-121746"}],"ssvc":null,"status":"published","title":"nvm use --save and nvm install --save write through a symlinked .nvmrc, overwriting any file the user can write","updatedAt":1793838298264}