fix(install): resolve releases from the apex domain - #1140
Merged
Merged
Conversation
macOS 26.4+ runs browser-pasted Terminal commands in an XProtect sandbox and blocks the paste with "Malware Detected, Paste Blocked" when the command contacts a host Apple's website reputation service distrusts. The install script's first network call was to updates.hunk.dev, which that service flags, so `curl -fsSL https://hunk.dev/install.sh | sh` was blocked. Serve release discovery as https://hunk.dev/api/release/latest through a Vercel rewrite to the release-proxy Worker, and point the installer and `hunk update` at it, so clients only contact the apex domain.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
elucid
enabled auto-merge (squash)
October 2, 2026 18:09
elucid
disabled auto-merge
October 2, 2026 18:14
This branch was successfully deployed
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.
Problem
A user reported that pasting
curl -fsSL https://hunk.dev/install.sh | shinto Terminal.app shows "Malware Detected, Paste Blocked" with no override. Reproduced on macOS 26.5.1 (XProtect 5363) by copying the command from hunk.dev in a browser and pressing ⌘V.Root cause
macOS 26.4+ does more than pattern-match pasted text. From the unified log (
xprotectd,syspolicyd,networkserviceproxy):xprotectd.xprotectdexecutes the command in a sandboxed container (a realcurlprocess appears) and its rules engine watches what it does.websitereview.corp.apple.com, viaSafari.SafeBrowsing.Serviceover Oblivious HTTP).https://updates.hunk.dev/v1/curl/latest. That host returns a bad verdict →Killing container due to rules engine deny→ the dialog.Isolation tests, all pasted from a browser with the same
curl … | shshape:curl -fsSL https://hunk.dev/install.sh | shcurl -fsSL https://hunk.dev/robots.txt | shcurl -fsSL https://hunk.dev/install.sh | sh -s -- --help(exits before networking)curl -fsSL https://updates.hunk.dev/v1/curl/latest | shSo the command shape is fine (it is identical to Deno/Ollama/Tailscale); the problem is the hostname
updates.hunk.dev, whichinstall.shstarted contacting in #969 (0.22.0). Google Safe Browsing reports the host clean; this is Apple's list only.Fix
vercel.json: rewrite/api/release/latest→https://updates.hunk.dev/v1/curl/latest. Vercel proxies server-side and forwards headers and method, so the Worker's allowlistedX-Hunk-*logging andCache-Control: no-storeare unchanged.install.shandlatestRelease.ts(startup check,hunk update) resolve fromhttps://hunk.dev/api/release/latest. Clients now only contacthunk.dev/www.hunk.dev,api.github.com, andgithub.com— the same profile as every other installer.Non-goals: the Worker and its
updates.hunk.devcustom domain stay deployed, since 0.22–0.23 binaries still call it for update checks and fall back to GitHub on failure. Retire it in a later release. A delisting request for the host is being filed at websitereview.apple.com separately.Verification
bun run typecheck,bun run lint— cleanbun test scripts/packaging/install-sh.test.ts packages/hunk/src/core/install/latestRelease.test.ts packages/hunk/src/core/process/updateNotice.test.ts packages/hunk/src/core/install/selfUpdate.test.ts test/cli/install-vm/prepare-fixtures.test.ts— 102 passtest/cli/install-vm(requires the VM harness); Worker tests (Worker code unchanged).To verify on the Vercel preview before merge:
After merge: copy the install command from hunk.dev in a browser and ⌘V into Terminal.app on macOS 26.4+ / 27; it should paste cleanly.