Files
nvm/test
Jordan Harband e4fcf988c5 [Fix] nvm_process_nvmrc_content, nvm_is_valid_version: keep .nvmrc content out of commands' arguments
A symlinked `.nvmrc`'s content is never printed (67268ebc),
but it was still parsed with external commands that took part of it as arguments,
which every local user can read (`ps`, `/proc/<pid>/cmdline`):
the duplicate-key check passed each key (the text before a line's first `=`) to `grep -E`,
and `nvm_is_valid_version` passed prerelease-shaped text to `awk` before checking that its core is numeric.
So another local user who can place a `.nvmrc` symlink where the victim runs nvm
(or merely sources `nvm.sh`, with no default alias)
could read, for example, a WireGuard private key the victim's symlink target holds.

Compare keys with `case`, literally rather than as a regex,
and let the existing shell check validate a prerelease's core,
which makes `0.0.N-<prerelease>` valid.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-GG4I2LOU.
2026-11-16 11:34:02 -08:00
..