# CVE-2026-121748: nvm use --delete-prefix lets a project .npmrc choose which file npm rewrites or makes world-writable

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** LOW 1.8
- **CVSS:** 1.8 (v4.0, CNA) `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: Active; Confidentiality impact: None; Integrity impact: Low; Availability impact: Low; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.13% (percentile 1, 2026-11-28)
- **CWE:** CWE-73
- **Published:** 2026-11-04T21:29:25.656Z
- **Modified:** 2026-11-10T21:46:30.563Z

## Who should check

- Anyone running nvm-sh nvm \>= 0.27.0, \< 0.41.0

## Description

Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.27.0 through 0.40.8, when a project's \`.npmrc\` sets \`prefix\`, \`nvm use\` tells the user to run \`nvm use --delete-prefix\`, which runs \`npm config delete prefix\` and \`npm config delete globalconfig\` in the current directory without naming a config file. npm loads the project \`.npmrc\` before deciding which file to edit, so that file chooses the target: \`userconfig=~/.bashrc\` makes npm rewrite \`~/.bashrc\` as ini (corrupting it), and \`location=global\` with \`globalconfig=\` leaves the chosen file at mode 0666, which on a shared machine lets another local user write to it. The attacker (the author of a cloned repository or archive, or a local user who can write a shared parent directory) chooses the file but not the bytes written, and no project code runs. Version 0.41.0 no longer lets a project \`.npmrc\` select which config file \`--delete-prefix\` edits.

## Affected and fixed versions

- nvm-sh nvm: \>= 0.27.0, \< 0.41.0 (cvelist)

## Mitigation

- Upgrade nvm to 0.41.0 or later.
- Vendor workaround: Until upgrading, do not run \`nvm use --delete-prefix\` in an untrusted project directory; remove the \`prefix\` setting from your own npmrc files by hand instead.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-121748. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-121748.md
Affected: nvm-sh nvm >= 0.27.0, < 0.41.0
Fixed in: nvm-sh nvm 0.41.0

Steps:
1. Search this machine and project for nvm-sh nvm: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

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

There is no confirmed exploitation: CVE-2026-121748 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.13% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-121748?

Low: CVSS 1.8 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.

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

nvm-sh nvm \>= 0.27.0, \< 0.41.0.

### Is there a fix for CVE-2026-121748?

Yes. Fixed in nvm-sh nvm 0.41.0. Upgrade nvm to 0.41.0 or later. Vendor workaround: Until upgrading, do not run \`nvm use --delete-prefix\` in an untrusted project directory; remove the \`prefix\` setting from your own npmrc files by hand instead.

### How do I check if I'm affected by CVE-2026-121748?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/nvm-sh/nvm/security/advisories/GHSA-ccgf-7gv4-xg5h>
- patch: <https://github.com/nvm-sh/nvm/commit/4049296ca8eef2067517d8cfd5ef5c0e615daa10>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-121748>

HTML: <https://flawdb.com/CVE-2026-121748> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-121748>
