CVE-2026-10796: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in nvm-sh nvm
nvm (Node Version Manager) through 0.40.4 executes arbitrary commands from version strings supplied by the configured Node.js/io.js mirror. Commands such as `nvm install` read the available versions from the mirror's index.tab and use the selected version, without sanitization, to build download URLs and shell/awk commands. Two sinks are affected by the same untrusted input: nvm_download() built a curl/wget command string and ran it with `eval`, so a version field containing command substitution (for example $(id)) was executed by the local shell; and nvm_get_checksum() interpolated the version-derived download slug into an awk program, so a crafted version could execute arbitrary commands via awk's system(). An attacker who controls the configured mirror, supplies mirror content to a user or CI on a non-default mirror, or machine-in-the-middles a non-TLS mirror can ∴ run arbitrary commands with the privileges of the user running nvm. The default mirror (https://nodejs.org over TLS) is not affected. Fixed on master (pending the next tagged release) by passing every argument as a literal argv element instead of using eval, by passing the value to awk as data via -v instead of interpolating it into the program, and by rejecting any version outside the Node.js/io.js version grammar before it is used.
AI Analysis
Technical Summary
The vulnerability in nvm-sh's nvm up to version 0.40.4 involves improper neutralization of special elements in OS commands (CWE-78). Specifically, nvm_download() uses eval on a curl/wget command string constructed from untrusted version strings, allowing command substitution execution. Similarly, nvm_get_checksum() interpolates untrusted version data into an awk program, enabling arbitrary command execution via awk's system(). Attackers who control or manipulate the configured mirror or perform man-in-the-middle attacks on non-TLS mirrors can exploit this to run arbitrary commands as the user running nvm. The default mirror (https://nodejs.org over TLS) is not vulnerable. The issue is fixed on the master branch by eliminating eval usage, passing arguments as literal argv elements, using awk's -v option for data, and validating version strings against the Node.js/io.js version grammar before use.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary OS commands with the privileges of the user running nvm. This can lead to full compromise of the user's environment where nvm is run. The vulnerability requires control over the mirror content or the ability to intercept and modify mirror data on non-TLS connections. The default official mirror over TLS is not affected, reducing risk for users who do not use custom or insecure mirrors.
Mitigation Recommendations
A fix is available on the nvm-sh master branch but has not yet been released in a tagged version. Users should avoid configuring nvm to use non-default or non-TLS mirrors until an official patched release is available. When the patched version is released, users should upgrade promptly. Until then, users should ensure they only use the official Node.js mirror over TLS (https://nodejs.org) to avoid exposure. Patch status is not yet confirmed in a released version — check the vendor's repository for the latest updates and official releases.
CVE-2026-10796: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in nvm-sh nvm
Description
nvm (Node Version Manager) through 0.40.4 executes arbitrary commands from version strings supplied by the configured Node.js/io.js mirror. Commands such as `nvm install` read the available versions from the mirror's index.tab and use the selected version, without sanitization, to build download URLs and shell/awk commands. Two sinks are affected by the same untrusted input: nvm_download() built a curl/wget command string and ran it with `eval`, so a version field containing command substitution (for example $(id)) was executed by the local shell; and nvm_get_checksum() interpolated the version-derived download slug into an awk program, so a crafted version could execute arbitrary commands via awk's system(). An attacker who controls the configured mirror, supplies mirror content to a user or CI on a non-default mirror, or machine-in-the-middles a non-TLS mirror can ∴ run arbitrary commands with the privileges of the user running nvm. The default mirror (https://nodejs.org over TLS) is not affected. Fixed on master (pending the next tagged release) by passing every argument as a literal argv element instead of using eval, by passing the value to awk as data via -v instead of interpolating it into the program, and by rejecting any version outside the Node.js/io.js version grammar before it is used.
CVSS v4.0
Score 7.5high
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in nvm-sh's nvm up to version 0.40.4 involves improper neutralization of special elements in OS commands (CWE-78). Specifically, nvm_download() uses eval on a curl/wget command string constructed from untrusted version strings, allowing command substitution execution. Similarly, nvm_get_checksum() interpolates untrusted version data into an awk program, enabling arbitrary command execution via awk's system(). Attackers who control or manipulate the configured mirror or perform man-in-the-middle attacks on non-TLS mirrors can exploit this to run arbitrary commands as the user running nvm. The default mirror (https://nodejs.org over TLS) is not vulnerable. The issue is fixed on the master branch by eliminating eval usage, passing arguments as literal argv elements, using awk's -v option for data, and validating version strings against the Node.js/io.js version grammar before use.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary OS commands with the privileges of the user running nvm. This can lead to full compromise of the user's environment where nvm is run. The vulnerability requires control over the mirror content or the ability to intercept and modify mirror data on non-TLS connections. The default official mirror over TLS is not affected, reducing risk for users who do not use custom or insecure mirrors.
Mitigation Recommendations
A fix is available on the nvm-sh master branch but has not yet been released in a tagged version. Users should avoid configuring nvm to use non-default or non-TLS mirrors until an official patched release is available. When the patched version is released, users should upgrade promptly. Until then, users should ensure they only use the official Node.js mirror over TLS (https://nodejs.org) to avoid exposure. Patch status is not yet confirmed in a released version — check the vendor's repository for the latest updates and official releases.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- openjs
- Date Reserved
- 2026-06-03T21:17:14.118Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a21ba77e29bf47b50be41ed
Added to database: 6/4/2026, 5:48:39 PM
Last enriched: 6/4/2026, 6:03:48 PM
Last updated: 6/5/2026, 5:02:02 AM
Views: 12
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.