CVE-2026-121748 · Package
NO FIX YET · SEE WHAT TO DO
nvm's `nvm use --delete-prefix` runs npm config deletes in the current directory without naming a config file, so a project's `.npmrc` can pick which file gets rewritten. An attacker who writes a cloned repository or shared directory can corrupt a file such as `~/.bashrc` or leave a global config writable by other local users.
first public Nov 4, 2026 · 1 source
Check it with your coding agent
It checks your repository and tells you if you’re affected, with the fix.
Developers who run nvm on a machine where they clone or open untrusted repositories, or on shared machines where other local users can write parent directories. Exposure requires a project .npmrc that sets prefix and a user who runs nvm use --delete-prefix in that directory. Teams that only use nvm on their own trusted projects on a single-user machine have low exposure.
Not affected if no-npmrc-prefix, nvm-0.41.0-or-later, nvm-below-0.27.0, single-user-machine
Who cares developer-workstations, node, nvm, shell
nvm --version or the installed nvm script version; versions 0.27.0 through 0.40.8 are affected.prefix setting in project .npmrc files you use with nvm use.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 edits.
Are you affected?
Tell InfraStack what you run. It checks this one, and every next one, against your stack.
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
0.41.0 or later, which no longer lets a project .npmrc select the file --delete-prefix edits.--delete-prefixThis page as .md · .json · 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/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
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.