#!/bin/sh WORK="${TMPDIR:-/tmp}/nvm_version_injection.$$" PROOF="${WORK}/PWNED" cleanup () { unset -f die cleanup nvm_download rm -rf "${WORK}" } die () { echo "$@" ; cleanup ; exit 1; } \. ../../../nvm.sh mkdir -p "${WORK}" export NVM_DIR="${WORK}" # GHSA-3c52-35h2-gfmm: a mirror-supplied version with shell/awk metacharacters # must be rejected before it is used in URLs, paths, or awk. Neutralize network. nvm_download () { return 0; } # given a version containing command-substitution syntax # when nvm_download_artifact is asked to download it # then it is rejected for disallowed characters and nothing is executed rm -f "${PROOF}" out="$(nvm_download_artifact node source std 'v1$(touch '"${PROOF}"')' 2>&1 &1