Repository navigation
Conversation
Pollo authenticates with an x-api-key header. Fetch strips authorization on a cross-origin redirect but forwards custom headers, so any 3xx from the Pollo API host handed the key to the host named in Location, including a plain-HTTP one. Send API requests with redirect: manual so a redirect surfaces as an HTTP error instead of being followed.
A 3xx from Pollo now says the redirect was not followed, names only the origin of its Location (never path or query), and suggests setting baseUrl to that origin if it is the genuine Pollo API. The redirect test now covers both submit and poll, redirecting to 127.0.0.1 on a second port.
SanHsien
added a commit
to SanHsien/hypit
that referenced
this pull request
Nov 7, 2026
…i#460-hypit-ai#474; advance watermarks No PR was merged upstream, so nothing was cherry-picked: 11 PRs = 5 defer (hypit-ai#464 hypit-ai#466 hypit-ai#467 hypit-ai#469 hypit-ai#471, pinned in monitored) + 6 not applicable; 5 issues = 1 defer (hypit-ai#473) + 4 not applicable. hypit-ai#464 npm pin is moot because the fork gates publish jobs to upstream (b641cce). ROADMAP row updated with the deferred items. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
SanHsien
added a commit
to SanHsien/hypit
that referenced
this pull request
Nov 7, 2026
…f upstream PR hypit-ai#466) Ported before upstream merge: x-api-key is a custom header that fetch forwards across a cross-origin redirect. Authenticated requests now use redirect: "manual"; a 3xx is reported through PolloHttpError naming only the target origin. Tests from the PR fail before the change (2) and pass after (5/5). Replace with upstream's version once hypit-ai#466 is merged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This branch has not been 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.
Closes #476
Problem
PolloClient.json()authenticates every Pollo API request with anx-api-keyheader and letsfetchfollow redirects (the defaultredirect: "follow"). On a cross-origin redirect, Node's fetch (undici) dropsauthorization,cookieandproxy-authorization, but it keeps custom headers.x-api-keyis a custom header, so it goes to whatever host theLocationheader names. Fetch also follows anhttps:tohttp:redirect, which would send the key in cleartext.The other gateway Providers (BeatAPI, HiAPI, Monid, TokenDance, HypiHub) use
authorization: Bearer, which fetch already strips on a cross-origin hop. Pollo is the only one whose credential survives the redirect.Impact
Low to medium. Exploiting this needs a 3xx from the configured Pollo API origin: an open redirect on that host, a misconfigured gateway or proxy in front of it, or a custom
baseUrlpointing at a service that redirects. When that happens, the user's Pollo API key (a billing credential) goes to a third-party host with no warning.Reproduction
The new test
packages/provider-pollo/test/redirect.test.tsstarts two loopback servers. The "Pollo API" answers with307 Location: http://127.0.0.1:<other>/collect?signature=...(a different port, so a different origin), and the other server records thex-api-keyit receives. It runs once for the status poll and once for the POST submit (start). On main, the second server receivesPOLLO_SECRET_KEY:Fix
Authenticated Pollo API requests now use
redirect: "manual". A redirect from the API comes back as a non-OK response and is reported through the existingPolloHttpErrorpath (samePOLLO_HTTP_ERRORcode, not retried). For a 3xx, the message now says the redirect was not followed, names only the origin of itsLocation(scheme, host and port, never the path or query, so a signed URL does not leak), and suggests settingbaseUrlto that origin if it is the genuine Pollo API. For example, abaseUrlonwww.pollo.aithat redirects topollo.aigives: