docs(install): record the two trust/portability assumptions in install_node
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Comment-only, no behaviour change. Both raised by scooby in the #1229 review as non-blocking findings worth writing down rather than fixing here. F-A: the SHASUMS256.txt check gives integrity, not authenticity. TLS to $NODE_DIST_BASE is the whole trust root, and MOSAIC_NODE_DIST_BASE widens it to any mirror with no signature backstop. GPG-verifying SHASUMS256.txt.sig is filed as its own follow-up so it gets its own review. F-C: the uname map pulls the glibc build, so musl hosts fail — visibly, via node_is_suitable, not silently.
This commit is contained in:
@@ -637,6 +637,11 @@ install_node() {
|
||||
*) fail "Unsupported OS '$(uname -s)'. Install Node.js >= $NODE_MIN_MAJOR manually."; return 1 ;;
|
||||
esac
|
||||
|
||||
# Linux here means glibc. Node's official linux-x64 build is dynamically
|
||||
# linked against glibc, so on musl (Alpine) the binary will not exec — but it
|
||||
# fails visibly: node_is_suitable rejects it and ensure_node exits with
|
||||
# "install Node.js manually". No silent breakage, just a wasted download.
|
||||
# A musl host needs the unofficial build, which is out of scope here.
|
||||
case "$(uname -m)" in
|
||||
x86_64|amd64) node_arch="x64" ;;
|
||||
aarch64|arm64) node_arch="arm64" ;;
|
||||
@@ -658,6 +663,13 @@ install_node() {
|
||||
rm -rf "$work_dir"; return 1
|
||||
fi
|
||||
|
||||
# Trust assumption, stated so nobody has to infer it: this verifies INTEGRITY
|
||||
# (the tarball matches the manifest), not AUTHENTICITY (the manifest is
|
||||
# genuinely Node's). The only thing establishing that is TLS to
|
||||
# $NODE_DIST_BASE. Node publishes SHASUMS256.txt.sig signed by its release
|
||||
# keys and we do not check it, which is on par with nvm but means pointing
|
||||
# MOSAIC_NODE_DIST_BASE at an untrusted mirror has no signature backstop.
|
||||
# Tracked as a hardening follow-up (raised by scooby in the #1229 review).
|
||||
if ! curl -fsSL "${release_url}/SHASUMS256.txt" -o "$work_dir/SHASUMS256.txt"; then
|
||||
fail "Could not fetch SHASUMS256.txt; refusing to install an unverified runtime."
|
||||
rm -rf "$work_dir"; return 1
|
||||
|
||||
Reference in New Issue
Block a user