[Fix] `nvm_get_checksum`: pass the tarball name to awk as data, not program text
Before adoption: this commit came in with the history the project adopted, so no landing records it.
The awk program string-interpolated the slug (which embeds the untrusted, mirror-supplied version) into its source, so a crafted version such as `v1"==$2){system("touch${IFS}/tmp/x")}#` was executed by awk's `system()`. Pass the value via `-v tarball=...` so awk treats it as data and never as code. See GHSA-3c52-35h2-gfmm (a second injection sink fed by the same untrusted version field that `nvm_download`'s eval was; the source-install path reaches this during a normal `nvm install <version>`).
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+29 added−1 removed
- tests:+28 added−0 removed
- other:+1 added−1 removed