CVE-2026-94185
JSON

6.7medium

nvm alias resolution follows `..` and discloses files outside $NVM_DIR/alias

Severity
6.7medium CVSS:4.0 by harborist
Exploit likelihood
0.30% (higher than 24% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
harborist

Description

nvm resolves a requested version or alias by treating it as a filename under $NVM_DIR/alias. Before 0.40.8, nvm_alias() concatenated the requested name onto that directory and read the result with no containment check, so a name containing a `..` component escaped the alias directory; under the default layout an alias such as `../../.npmrc` resolves to a file in the user's home directory. nvm_print_alias_file() then emits every non-comment, non-empty line of whatever was opened. A version string taken from an untrusted .nvmrc reaches this path, so a developer who runs `nvm use`, `nvm install`, or `nvm which` inside an attacker-supplied repository discloses the first non-comment line of an arbitrary file readable by that user, in the resulting "is not yet installed" error message. A user-supplied `nvm alias <traversing-name>` discloses every non-comment line of the target file. There is no integrity or availability impact, and no command execution on this path.

Affected

Product or packageVersionsReported by
nvm-sh nvmup to 0.40.7
Not affected: 0.40.8
CVE List

All scores

harborist5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
harborist6.7medium CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Classification

CWE-22CWE-200

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-94185 changed 2026-09-21CVE Terms of Use
NVDCVE-2026-94185 changed 2026-09-22Public domain