CVE-2026-1665
Command Injection in nvm Download Function via Unsanitized Env Variable
Publication date: 2026-01-29
Last updated on: 2026-01-29
Assigner: openjs
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| unknown_vendor | nvm | to 0.40.3 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-78 | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. |
| CWE-95 | The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval"). |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a command injection issue in nvm (Node Version Manager) versions 0.40.3 and below. Specifically, the nvm_download() function uses eval to execute wget commands, and the NVM_AUTH_HEADER environment variable is not sanitized in the wget code path. This allows an attacker who can set environment variables in a victim's shell environment to inject arbitrary shell commands. These commands execute when the victim runs nvm commands that trigger downloads, such as 'nvm install' or 'nvm ls-remote'.
How can this vulnerability impact me? :
An attacker who can control environment variables in your shell environment can inject and execute arbitrary shell commands when you run certain nvm commands that trigger downloads. This can lead to unauthorized command execution, potentially compromising your system or environment.
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability, avoid using nvm versions 0.40.3 and below. Do not run nvm commands that trigger downloads, such as 'nvm install' or 'nvm ls-remote', in environments where untrusted users can set environment variables. Ensure that environment variables like NVM_AUTH_HEADER are not set by untrusted sources, such as malicious CI/CD configurations, compromised dotfiles, or Docker images. Consider upgrading to a version of nvm that fixes this vulnerability once available.