Skip to content

fix(deps): accept GitHub's new release-asset redirect host in the npm wrapper - #127

Merged
dipto0321 merged 1 commit into
mainfrom
fix/deps/npm-wrapper-redirect-host
Nov 1, 2026
Merged

dipto0321 merged 1 commit into
mainfrom
fix/deps/npm-wrapper-redirect-host

Conversation

@dipto0321

Copy link
Copy Markdown
Owner

Summary

Fixes the npm install path, which has been broken for every user
since v1.1.0.

nodeup-npm/scripts/install.js validates the redirect that GitHub
serves 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 the
wrapper refused the redirect and the install aborted:

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

npm install -g nodeupx therefore cannot install the binary. The
Homebrew 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), 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.

Changes

  • nodeup-npm/scripts/install.js — add
    release-assets.githubusercontent.com to ALLOWED_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 change
    and add a followHops_allowsGitHubToReleaseAssetsCdnRedirect
    regression test that exercises the new host.

Verification

  • node --test scripts/ — 21 tests pass, including the new
    regression test
  • Live end-to-end against the published v1.2.0 release: the
    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.0
  • The off-CDN rejection test still passes — an attacker-controlled
    redirect 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.js changed.

Tagging v1.2.1 triggers the standard release workflow, which
rebuilds the identical Go binaries and republishes nodeupx with the
fixed wrapper. The wrapper's binaryVersion stays pinned at 1.2.0
so 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

… 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>
@cocogitto-bot

cocogitto-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

✔️ 114f66c - Conventional commits check succeeded.

@dipto0321
dipto0321 merged commit 2be28cf into main Nov 1, 2026
11 checks passed
@dipto0321
dipto0321 deleted the fix/deps/npm-wrapper-redirect-host branch November 1, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(deps): npm wrapper rejects GitHub's new release-asset redirect host, breaking every npm install

1 participant