Skip to main content
← Vulnerabilities

nvm use --delete-prefix lets a project .npmrc choose which file npm rewrites or makes world-writable

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

1.8LowCNA
Exploited
No known exploitation
Fix
Fixed in 0.41.0
Who is exposed
Not reported

Do first: Upgrade to a fixed version: 0.41.0.

2Pcve.now Index 2 of 100 · methodology v3 · provisional
  • Exploitation?/40Exploitation: unknown (data gap). No CISA SSVC exploitation rating yet
  • Exposure?/25Exposure: unknown (data gap). No advisory context yet
  • Reach?/20Reach: unknown (data gap). No tracked technology or package matched
  • Severity1.8/10CVSS 1.8
  • No patch0/5No signal

What would change the score

  • Would score about 57 if added to CISA KEV
  • Would score about 52 if CISA's SSVC rates exploitation active
  • Would score about 24 if advisories confirm default setups are exposed

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

Published
Last modified
Published
Not listed in CISA KEV
2/100 · provisional
Fix
Fixed in 0.41.0
None on Exploit-DB, Metasploit or GitHub

Summary

Node Version Manager (nvm) versions 0.27.0 through 0.40.8 can be tricked into rewriting or making world-writable a config file of the attacker's choosing when a user runs `nvm use --delete-prefix` in a project with a crafted `.npmrc`. A local attacker with no login needed can corrupt a file such as `~/.bashrc`, or leave a file writable by other local users on a shared machine, but only if the victim is persuaded to run that command.

Read the original 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.

What to do

  • Upgrade to a fixed version: 0.41.0.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • nvm-sh nvm

    From 0.27.0 · fixed in 0.41.0

Evidence 2

  1. Advisory
  2. Patch

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

FAQ

Questions about CVE-2026-121748

Is CVE-2026-121748 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: cve.now feed data

Which versions are affected by CVE-2026-121748?

nvm: from 0.27.0 before 0.41.0.Source: cve.now feed data

How do I fix CVE-2026-121748?

Upgrade to a fixed version: 0.41.0.Source: cve.now feed data