Repository navigation
fix(deps): accept GitHub's new release-asset redirect host in the npm wrapper - #127
Merged
Merged
Conversation
… wrapper `npm install -g nodeupx` has been failing on every platform since v1.1.0. The wrapper validates the redirect GitHub serves for release-asset downloads against a host allowlist, and GitHub now serves release assets from `release-assets.githubusercontent.com` — a host the allowlist did not list. The wrapper refused the redirect and the install aborted before it could fetch the binary: nodeup: refusing to follow redirect from https://github.com/dipto0321/nodeup/releases/download/v1.2.0/checksums.txt to https://release-assets.githubusercontent.com/...: host release-assets.githubusercontent.com is not in the allowlist The allowlist was introduced in #91 (cb425a9, 2026-07-04), when GitHub was still redirecting to `objects.githubusercontent.com`. The CDN host changed out from under the wrapper and nothing failed loudly until the next install, so the breakage was silent for four months. Both hosts are GitHub-controlled, so allowing both preserves the security property #91 was after: an attacker still cannot redirect the download to a host they control. The off-CDN rejection test still passes. Ships as v1.2.1 — the Go binary is unchanged from v1.2.0, and the wrapper's binaryVersion stays pinned at 1.2.0 so it keeps fetching the already-published v1.2.0 binary. Co-Authored-By: puku-ai-2.8 <noreply@puku.sh>
|
✔️ 114f66c - Conventional commits check succeeded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the npm install path, which has been broken for every user
since v1.1.0.
nodeup-npm/scripts/install.jsvalidates the redirect that GitHubserves for release-asset downloads against a host allowlist. GitHub
now serves release assets from
release-assets.githubusercontent.com,but the allowlist only listed
objects.githubusercontent.com— so thewrapper refused the redirect and the install aborted:
npm install -g nodeupxtherefore cannot install the binary. TheHomebrew tap, the Scoop bucket, and direct binary downloads are
unaffected — they don't go through this redirect-validation path.
The allowlist was introduced in #91 (
cb425a9, 2026-07-04), whenGitHub was still redirecting to
objects.githubusercontent.com. The CDNhost changed out from under the wrapper, and nothing failed loudly
until the next install.
Changes
nodeup-npm/scripts/install.js— addrelease-assets.githubusercontent.comtoALLOWED_REDIRECT_HOSTS.Both hosts are GitHub-controlled, so allowing both preserves the
security property fix(deps): verify npm-wrapper binary download against release checksums #91 was after (an attacker cannot redirect the
download to a host they control) while surviving the CDN migration.
nodeup-npm/scripts/install_test.js— mirror the allowlist changeand add a
followHops_allowsGitHubToReleaseAssetsCdnRedirectregression test that exercises the new host.
Verification
node --test scripts/— 21 tests pass, including the newregression test
wrapper's postinstall downloads the archive, verifies its SHA256
against the published
checksums.txt(exact match), extracts it,and the resulting binary reports
nodeup version 1.2.0redirect target is still refused
Release plan
This ships as v1.2.1 — a patch release. The Go binary is
unchanged from v1.2.0; only the npm wrapper's
install.jschanged.Tagging
v1.2.1triggers the standard release workflow, whichrebuilds the identical Go binaries and republishes
nodeupxwith thefixed wrapper. The wrapper's
binaryVersionstays pinned at1.2.0so it keeps fetching the v1.2.0 binary — no need for users to
re-download a new Go binary, and the Go and npm versions continue to
move independently as the wrapper is designed to.
Closes #126
🤖 Generated with puku-cli