Skip to main content
← Vulnerabilities

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

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

4.6MediumCNA
Exploited
No known exploitation
Fix
Fixed in 0.41.0
Who is exposed
Not reported

Do first: Upgrade to a fixed version: 0.41.0.

5Pcve.now Index 5 of 100 · methodology v3 · provisional
  • Exploitation?/40Exploitation: unknown (data gap). No CISA SSVC exploitation rating yet
  • Exposure?/25Exposure: unknown (data gap). No advisory context yet
  • Reach?/20Reach: unknown (data gap). No tracked technology or package matched
  • Severity4.6/10CVSS 4.6
  • No patch0/5No signal

What would change the score

  • Would score about 60 if added to CISA KEV
  • Would score about 55 if CISA's SSVC rates exploitation active
  • Would score about 27 if advisories confirm default setups are exposed

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.

Published
Last modified
Published
Not listed in CISA KEV
5/100 · provisional
Fix
Fixed in 0.41.0
None on Exploit-DB, Metasploit or GitHub

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.

Read the original 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

  • Upgrade to a fixed version: 0.41.0.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • nvm-sh nvm

    From 0.5.0 · fixed in 0.41.0

Evidence 2

  1. Advisory
  2. Patch

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

FAQ

Questions about CVE-2026-121749

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: cve.now feed data

Which versions are affected by CVE-2026-121749?

nvm: from 0.5.0 before 0.41.0.Source: cve.now feed data

How do I fix CVE-2026-121749?

Upgrade to a fixed version: 0.41.0.Source: cve.now feed data