[Fix] `nvm_download`: avoid `eval` so mirror-supplied version strings can't inject commands
Before adoption: this commit came in with the history the project adopted, so no landing records it.
`nvm_download` built a curl/wget command string and ran it with `eval`. The download URLs embed the version string taken from the mirror's `index.tab`, which is untrusted. Wrapping each argument in double quotes inside the `eval` does not prevent command substitution, so a version field such as `v1$(touch /tmp/proof)` was executed by the shell. This bypassed the earlier quoting hardening in 0ce8f5a. Pass every argument as a literal argv element instead of constructing a string for `eval`, on both the curl and wget paths, so URL arguments are never re-parsed by the shell. The wget flag translation is now done per-argument with a POSIX `set --` loop rather than `sed` over the joined string. The auth header is sanitized and added once, before invoking the downloader.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+134 added−33 removed
- tests:+86 added−0 removed
- other:+48 added−33 removed