{"affected":[{"defaultStatus":"unaffected","product":"nvm","source":"CNA: harborist","vendor":"nvm-sh","versions":[{"lessThan":"0.41.0","status":"affected","version":"0.5.0","versionType":"semver"}]}],"cveId":"CVE-2026-121749","cwes":["CWE-88"],"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`.","epss":null,"exploits":[],"kev":null,"metrics":[{"score":4.6,"severity":"medium","source":"CNA: harborist","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","version":"4.0"},{"score":3.3,"severity":"low","source":"CNA: harborist","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N","version":"3.1"},{"score":4.6,"severity":"medium","source":"NVD: 7ffcee3d-2c14-4c3e-b844-86c6a321a158","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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","version":"4.0"},{"score":3.3,"severity":"low","source":"NVD: 7ffcee3d-2c14-4c3e-b844-86c6a321a158","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N","version":"3.1"}],"modifiedAt":1793830674700,"publishedAt":1793827875245,"references":[{"source":"CNA: harborist","tags":["vendor-advisory"],"url":"https://github.com/nvm-sh/nvm/security/advisories/GHSA-xmxw-6r9w-89gc"},{"source":"CNA: harborist","tags":["patch"],"url":"https://github.com/nvm-sh/nvm/commit/bce663e3873fadbe8ebbc6e07e8d76fb12d5d69e"},{"source":"7ffcee3d-2c14-4c3e-b844-86c6a321a158","tags":[],"url":"https://github.com/nvm-sh/nvm/commit/bce663e3873fadbe8ebbc6e07e8d76fb12d5d69e"},{"source":"7ffcee3d-2c14-4c3e-b844-86c6a321a158","tags":[],"url":"https://github.com/nvm-sh/nvm/security/advisories/GHSA-xmxw-6r9w-89gc"}],"remediation":[{"kind":"fix","source":"CNA: harborist","text":"Upgrade to nvm 0.41.0 or later."},{"kind":"workaround","source":"CNA: harborist","text":"Until upgrading, check that `.nvmrc` does not start with `-` before running nvm in an untrusted project directory."},{"kind":"fix","source":"CNA: harborist","text":"The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches.","url":"https://github.com/nvm-sh/nvm/commit/bce663e3873fadbe8ebbc6e07e8d76fb12d5d69e"}],"revision":"d004a282afc8092a3f018a3e62bd57fa6a6ce434edc85cb3035c013b26328d7f","sources":[{"modifiedAt":1793827875245,"name":"CNA: harborist","retrievedAt":1793830356571,"url":"https://www.cve.org/CVERecord?id=CVE-2026-121749"},{"modifiedAt":1793830674700,"name":"NVD","retrievedAt":1793838299312,"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-121749"}],"ssvc":null,"status":"published","title":"nvm passes the version pattern to grep without -e, letting a .nvmrc inject grep options and read local files","updatedAt":1793838299312}