mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-11-27 02:59:47 +03:00
Every download went to the fixed `<archive>.unverified`, and curl opens its `-o` file only on the first body byte, so a curl left running by an earlier install of the same version (past the install lock via `nvm cache clear`, a stale-lock takeover, or a removed lock) survived the `rm -f`, then opened the same file and could rewrite it after the checksum passed, while `tar` read it, and leave it in the cache that `--offline` trusts. Downloading into a `mktemp -d` directory in the same cache dir keeps the rename atomic and the file's mode following the umask. Leftover `.unverified*` paths from interrupted installs are still removed first. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-XUXR5LQ4.