# CVE-2026-121751: nvm evaluates a malicious mirror's index.tab version strings as shell arithmetic via stored LTS aliases


- **Severity:** Low 2.1 (`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`)
- **Exploited in the wild:** Not known
- **Fix available:** No
- **Published:** 4 Nov 2026
- **Updated:** 9 Nov 2026
- **Also known as:** GHSA-7prg-rw9c-82h7

## What is CVE-2026-121751?

CVE-2026-121751 is a low-severity vulnerability in nvm-sh nvm, published on 4 Nov 2026. 

### Official description

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 `lts/*`. Exploitation requires the victim to use a hostile mirror -- via a compromised mirror or CDN, a network man-in-the-middle of an `http://` mirror, or a maliciously configured `NVM_NODEJS_ORG_MIRROR` -- and to run an affected command. The same sink is also reachable from a project `.nvmrc`, which is treated as hardening. dash is not affected. Version 0.41.0 only passes an all-digit `lts/-N` offset to arithmetic and drops `index.tab` rows whose version is not a valid version string.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2026-121751?


## How do I fix CVE-2026-121751?

No fix has been published for CVE-2026-121751 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-121751 being exploited?

There is no known exploitation of CVE-2026-121751 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-121751 and fix it if it is affected.

What it is: CVE-2026-121751 is a low-severity vulnerability in nvm-sh nvm, published on 4 Nov 2026. 
Exploitation: There is no known exploitation of CVE-2026-121751 in the wild and no public exploit code.

Affected product: nvm-sh nvm. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-121751/ (Markdown: https://insights.sbomify.com/CVE-2026-121751/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-121751
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-121751
- OSV: https://osv.dev/vulnerability/CVE-2026-121751

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-121751/
Summaries are generated and may contain mistakes; the official description above is the record.
