GitHub API 403 when GITHUB_TOKEN set + target org has IP allow list (e.g. aquasecurity/trivy, databricks/cli) #9119
Unanswered
jasonwbarnett
asked this question in
Troubleshooting and bug reports
Replies: 1 comment 15 replies
-
|
Seems true... I don't understand why GitHub does this |
Beta Was this translation helpful? Give feedback.
15 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
When
GITHUB_TOKEN(orMISE_GITHUB_TOKEN) is set, mise sendsAuthorization: Bearer {token}on all requests toapi.github.com. If the target GitHub organization has an IP allow list enabled, GitHub blocks the authenticated request with 403 — even for fully public repos.The counterintuitive part: the same request without the Authorization header succeeds (GitHub explicitly exempts anonymous public repo access from IP allow lists). So setting
GITHUB_TOKENto get a higher rate limit actually breaks tool installation for orgs with IP allow lists.Affected tools
Any tool whose GitHub org has an IP allow list enabled. Examples we hit in CI:
aqua:aquasecurity/trivygithub:databricks/cliExact 403 response body
{ "message": "Although you appear to have the correct authorization credentials, the `aquasecurity` organization has an IP allow list enabled, and your IP address is not permitted to access this resource.", "documentation_url": "https://docs.github.com/rest/releases/releases#list-releases", "status": "403" }Key:
x-ratelimit-remainingis ~15,000 in these responses. This is not a rate limit issue.Verification (same IP, same token, same moment)
Why this happens
Per GitHub docs, IP allow lists block access to public resources when a user is authenticated (PATs, OAuth tokens, GitHub App installation tokens). Anonymous access to public resources is explicitly exempted.
So by authenticating, mise opts itself into IP allow list enforcement that anonymous requests bypass.
Proposed fix
In the HTTP layer (
src/http.rs/src/github.rs), when a request toapi.github.comreturns 403 and the response body contains"IP allow list", retry the same request without theAuthorizationheader.This is safe because:
Workaround
Pre-install affected binaries via CDN before
mise installruns. Since CDN downloads work fine with auth, download the tarball directly and place the binary at the path mise expects (~/.local/share/mise/installs/{tool}/{version}/). mise detects it as already installed and skips the API calls entirely.mise version
2026.4.11 linux-x64 (also reproduced on earlier versions)
Beta Was this translation helpful? Give feedback.
All reactions