nvm 0.40.6 Fixes Version-String Command Injection

P1 — VALIDATE AND UPDATEHigh · 7.1 (CVSS v4.0); 7.0 (CVSS v3.1)EXPLOITATION: NOT STATED

Quick Answer

nvm CVE-2026-118905 affects versions 0.31.2 through 0.40.5. Inventory developer and CI installations, .nvmrc handling and auto-switch hooks, update to 0.40.6, review untrusted repositories where warranted, validate Node workflows, and retain evidence.

Confirm Scope And Apply The Supported Remediation

What to do now: Inventory nvm installations on developer, build and automation systems, exact versions, shell hooks, scripts that read .nvmrc, repository trust boundaries, owners, and deployment images. Confirm that an attacker-influenced version string can reach nvm_ls. Do not assume bare nvm use is exposed: its parser strips comments, but documented auto-switch hooks and custom cat-based scripts can remain exposed. Upgrade nvm to 0.40.6 or later, rebuild development and CI images, and disable or harden auto-switch hooks until the fixed version is active. Confirm nvm --version and loaded shell functions, test supported Node switching, inspect hooks and recent untrusted repositories, review command or file anomalies where warranted, and retain evidence.

Open the authoritative advisory

Last verified: 2026-10-29 UTC. Recheck the authoritative advisory and supported distribution channel before changing production.

Scope And Authority

Product scopeNode Version Manager nvm_ls version filtering and documented directory auto-switch hooks
AdvisoryGHSA-vgqf-vc3m-4wv3
CVECVE-2026-118905
Authoritative release date2026-10-29 05:22:35.156 UTC
Authority revision date2026-10-29 05:22:35.156 UTC
Affected versionsnvm 0.31.2 through 0.40.5 when an attacker-influenced version string reaches nvm_ls; documented bash cdnvm and zsh load-nvmrc hooks can pass a malicious .nvmrc as-is.
Fixed versionNode Version Manager 0.40.6 or later
CVSS base score7.1 (CVSS v4.0); 7.0 (CVSS v3.1)
CVSS severityHigh
Exploitation statusThe nvm project does not state that this vulnerability is being maliciously exploited.; no exploitation claim is inferred.

What Changed

The nvm project fixed sed command injection that can execute commands or access files when crafted version strings reach nvm_ls, including through documented auto-switch hooks.

What To Validate Now

  1. Inventory. Inventory nvm installations on developer, build and automation systems, exact versions, shell hooks, scripts that read .nvmrc, repository trust boundaries, owners, and deployment images.
  2. Establish applicability. Confirm that an attacker-influenced version string can reach nvm_ls. Do not assume bare nvm use is exposed: its parser strips comments, but documented auto-switch hooks and custom cat-based scripts can remain exposed.
  3. Remediate. Upgrade nvm to 0.40.6 or later, rebuild development and CI images, and disable or harden auto-switch hooks until the fixed version is active.
  4. Validate. Confirm nvm --version and loaded shell functions, test supported Node switching, inspect hooks and recent untrusted repositories, review command or file anomalies where warranted, and retain evidence.
  5. Retain evidence. Preserve asset and owner identifiers, the applicability decision, before-and-after versions, change approval, installation output, validation results, and any exception or rollback record.

Operational Cautions

Exploitation runs as the developer or automation account and can expose signing, package, or cloud credentials. Preserve shell and repository evidence before cleanup when suspicious activity exists.

Evidence To Retain

  • Exact product, release stream, package or application version, enabled feature, environment, and accountable owner.
  • UTC timestamps, authority revision, approved change record, installer or package-manager output, and resulting version.
  • Relevant logs and monitoring evidence, test results, exceptions, compensating controls, and rollback decisions.

Related TechGeeks Resources

Authoritative References

Correction policy: If the authority changes affected versions, fixed versions, severity, exploitation information, mitigations, or required action, TechGeeks will update this notice and its verification date.