{"id":"CVE-2026-121746","state":"PUBLISHED","title":"nvm use --save and nvm install --save write through a symlinked .nvmrc, overwriting any file the user can write","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.","publishedAt":"2026-11-04T21:31:57.022Z","updatedAt":"2026-11-09T20:42:28.385Z","severity":{"score":6.7,"label":"Medium","version":"4.0","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","source":"harborist"},"assigner":"harborist","products":["nvm-sh nvm"],"affected":[{"vendor":"nvm-sh","product":"nvm","defaultStatus":"unaffected","versions":[{"version":"0.40.0","status":"affected","lessThan":"0.41.0","versionType":"semver"}],"repo":"https://github.com/nvm-sh/nvm"}],"references":["https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh","https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7"],"weaknesses":["CWE-59"],"ingestedAt":"2026-11-09T20:44:06.629Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/121xxx/CVE-2026-121746.json","commit":"1043b7c6fc84a2e11e5ae43eed5cbc7b24593ac0","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-121746","state":"PUBLISHED","datePublished":"2026-11-04T21:31:57.022Z","dateUpdated":"2026-11-09T20:42:28.385Z","assignerShortName":"harborist","assignerOrgId":"7ffcee3d-2c14-4c3e-b844-86c6a321a158","dateReserved":"2026-11-03T23:38:59.223Z"},"containers":{"cna":{"title":"nvm use --save and nvm install --save write through a symlinked .nvmrc, overwriting any file the user can write","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"nvm-sh","product":"nvm","defaultStatus":"unaffected","versions":[{"version":"0.40.0","status":"affected","lessThan":"0.41.0","versionType":"semver"}],"repo":"https://github.com/nvm-sh/nvm"}],"references":[{"url":"https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh","name":"GHSA-8qjx-8r8m-mpqh","tags":["vendor-advisory"]},{"url":"https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7","name":"Fix commit 3f8411e5","tags":["patch"]}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"LOCAL","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"ACTIVE","vulnConfidentialityImpact":"NONE","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"NONE","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED","version":"4.0","baseSeverity":"MEDIUM","baseScore":6.7,"vectorString":"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"}},{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV3_1":{"version":"3.1","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"HIGH","availabilityImpact":"NONE","baseSeverity":"MEDIUM","baseScore":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-59","lang":"en","description":"CWE-59 Improper Link Resolution Before File Access ('Link Following')","type":"CWE"}]}],"providerMetadata":{"shortName":"harborist","orgId":"7ffcee3d-2c14-4c3e-b844-86c6a321a158","dateUpdated":"2026-11-04T21:31:57.022Z"},"workarounds":[{"lang":"en","value":"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.","supportingMedia":[{"type":"text/html","base64":false,"value":"<p>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.</p>"}]}],"solutions":[{"lang":"en","value":"Upgrade to nvm 0.41.0 or later.","supportingMedia":[{"type":"text/html","base64":false,"value":"<p>Upgrade to nvm 0.41.0 or later.</p>"}]}],"credits":[{"lang":"en","value":"Adel Assakaf (https://github.com/assakafpix)","type":"finder"},{"lang":"en","value":"Anthropic's OSS Scanner, as part of vulnerability ANT-2026-G9REVGKT","type":"finder"},{"lang":"en","value":"Jordan Harband (https://github.com/ljharb)","type":"remediation developer"}],"source":{"advisory":"GHSA-8qjx-8r8m-mpqh","discovery":"EXTERNAL"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-11-09T20:42:00.793023Z","id":"CVE-2026-121746","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-11-09T20:42:28.385Z"}}]}}}