CVE-2026-121751 · Other
NO FIX YET · SEE WHAT TO DO
nvm stores unvalidated version strings from a remote mirror's index.tab and later evaluates them in shell arithmetic, so crafted values run commands. An attacker who controls or intercepts the mirror gets commands run as the user under bash or zsh.
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 0.39.6 through 0.40.8 under bash or zsh and use a remote mirror that could be compromised or intercepted, including over plain http. Projects whose .nvmrc files are untrusted also reach the same code path, which the sources treat as hardening rather than the main risk. dash is not affected, and systems on 0.41.0 or outside the affected range can skip it.
Not affected if dash, default-mirror-only, trusted-https-mirror, version-outside-0.39.6-0.40.8
Who cares bash, node, nvm, zsh
0.39.6 through 0.40.8.$NVM_DIR/alias/lts/ and look for unexpected lts alias values containing $( or other shell syntax.NVM_NODEJS_ORG_MIRROR is set to a non-default or untrusted mirror, and whether http:// mirrors are in use.Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.39.6 through 0.40.8, nvm ls-remote (and other commands that refresh remote LTS aliases) store the version column of the mirror's index.tab in $NVM_DIR/alias/lts/ without validating it, and nvm_normalize_lts later evaluates any suffix of an lts/-N value inside shell arithmetic $((N+1)). Under bash and zsh, arithmetic evaluation expands command substitutions in array subscripts, so a stored value such as lts/-10*path[$(cmd)1] runs cmd as the user when the alias is later resolved by purely local commands (nvm ls, nvm alias, nvm use --lts, nvm which lts/), and in every new shell when the default alias is . Exploitation requires the victim to use a hostile mirror -- via a compromised mirror or CDN, a network man-in-the-middle of an mirror, or a maliciously configured -- and to run an affected command. The same sink is also reachable from a project , which is treated as hardening. dash is not affected. Version 0.41.0 only passes an all-digit offset to arithmetic and drops rows whose version is not a valid version string.
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.0lts/*http://NVM_NODEJS_ORG_MIRROR.nvmrclts/-Nindex.tabThis page as .md · .json · CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/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
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.