# CVE-2026-121746: nvm use --save and nvm install --save write through a symlinked .nvmrc, overwriting any file the user can write

Status: published. Published: 2026-11-04. Updated: 2026-11-04.

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.

## Remediation

- fix: Upgrade to nvm 0.41.0 or later. (source: CNA: harborist)
- workaround: 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. (source: CNA: harborist)
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: CNA: harborist) — https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7

## Affected products and versions

- nvm-sh / nvm: ≥ 0.40.0; < 0.41.0 (affected, semver). Source: CNA: harborist

## Severity and prioritization

- CVSS 4.0: 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; source: CNA: harborist

- CVSS 3.1: 5.5 (medium); CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N; source: CNA: harborist

- CVSS 4.0: 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/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; source: NVD: 7ffcee3d-2c14-4c3e-b844-86c6a321a158

- CVSS 3.1: 5.5 (medium); CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N; source: NVD: 7ffcee3d-2c14-4c3e-b844-86c6a321a158

- CISA KEV: No listing in collected sources

- EPSS: Not available

- SSVC: Not available

- Weaknesses: CWE-59

## Exploit evidence

No exploit evidence in collected sources. This is not proof of no exploitation.

## References

- https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh (CNA: harborist; vendor-advisory)

- https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7 (CNA: harborist; patch)

- https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7 (7ffcee3d-2c14-4c3e-b844-86c6a321a158)

- https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh (7ffcee3d-2c14-4c3e-b844-86c6a321a158)

## Provenance

- CNA: harborist: https://www.cve.org/CVERecord?id=CVE-2026-121746; retrieved 2026-11-04; source updated 2026-11-04

- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-121746; retrieved 2026-11-05; source updated 2026-11-04

Revision: 30843daf9925b40c9ef5bbf0eadd63fbd69206f0ad7946d7edeb7456ed444553

Canonical: https://y2.dev/cve/CVE-2026-121746

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.