Repository navigation
fix(mitm): forward passthrough traffic to the real requested host (#10479) - #10762
Merged
diegosouzapw merged 1 commit intoAug 19, 2026
Merged
Conversation
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…eaper-inference#10479) (cheaper-inference#10762) Co-authored-by: Markus Hartung <mail@hartmark.se>
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 #10479
Root cause: AgentBridge's standalone MITM proxy (
src/mitm/server.cjs) misrouted passthrough traffic for any host outsideTARGET_HOSTS.getTargetHost()'s fallback branch hardcoded"daily-cloudcode-pa.sandbox.googleapis.com"instead of the real requested Host header — dead code in the original Antigravity DNS-spoof flow (where the Host header is guaranteed to be a TARGET_HOSTS member), but the new transparent-redirect/HTTP-proxypassthrough()call path lets clients reach arbitrary internet hosts through the same function, so any host NOT in TARGET_HOSTS was silently forwarded to Google's Cloud Code API instead of the actual requested destination.Fix:
getTargetHost()now always returns the real requested Host header.Regression test: tests/unit/mitm-passthrough-real-host-10479.test.ts. Verified no regression against 36 existing tests in mitm-server-connect.test.ts, mitm-manager-bypass-json.test.ts, agentbridge-antigravity-cert-hosts-6494.test.ts.