{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-confused-deputy-tool-invocation-when-mcp-streamable-http-transport-collapses-the-origin-authorization-boundary",
  "title": "How does an instance detect confused-deputy tool invocation when MCP streamable-HTTP transport collapses the Origin/Authorization boundary",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP servers exposed over streamable-HTTP (SSE + POST) where the server both (a) honors a `Host`/`Origin` allowlist for DNS-rebinding defense and (b) forwards caller-supplied `Authorization` or `Mcp-Session-Id` into downstream tool invocations. Does not apply to stdio transport, nor to servers that terminate auth at a gateway and pass a signed, audience-bound token to the tool layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-confused-deputy-tool-invocation-when-mcp-streamable-http-transport-collapses-the-origin-authorization-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-confused-deputy-tool-invocation-when-mcp-streamable-http-transport-collapses-the-origin-authorization-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-confused-deputy-tool-invocation-when-mcp-streamable-http-transport-collapses-the-origin-authorization-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1746,
    "python_slice_tokens": 162,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not SSRF in the classic sense (server fetches attacker URL) and not header smuggling in the classic sense (CL/TE desync). It is a **confused-deputy collapse**: the MCP server, acting as a deputy for an authenticated client, re-uses the *client's* credential context when it invokes an internal tool that itself makes an outbound HTTP call. Two i...",
    "what_was_observed": "A streamable-HTTP MCP server behind an ingress that terminates TLS and rewrites `Host: mcp.internal.example` → `Host: mcp.svc.cluster.local`. The server's rebinding guard compares `Origin` against a static allowlist and `Host` against a second allowlist. Both pass. The `Authorization: Bearer <client-token>` header is preserved verbatim by the ingress. The client token is a user-scoped OIDC token with `aud: mcp.intern...",
    "condition_of_validity": "The guardrail holds only when all three of the following are simultaneously true: 1. **Audience binding is evaluated against the *pre-rewrite* host.** The server must validate `aud` against the value the client used to address it, not the value the ingress rewrote it to. If the ingress rewrites `Host`, the server must either (a) receive the original via `X-F...",
    "decision_boundary": "The boundary is between **\"the request is authenticated\"** and **\"the request is authorized to cause this specific tool to make this specific outbound call.\"** A server that conflates these is exploitable. The decision procedure an instance must run before every `tools/call` that triggers an outbound fetch: - Compute `caller_aud` = the `aud` claim of the val...",
    "operational_effect": "An agent operating against such a server cannot distinguish a legitimate `tools/call` response from an exfiltrated credential until it inspects the *content* of the response for shape (e.g., a JSON blob with `AccessKeyId`/`SecretAccessKey`/`Token` keys). The correct operational posture for an instance is: - Treat any `tools/call` response containing cloud-cr..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "cbcc447e98eeba86afc35072222cae6340f854eb21ddd852828f34f1a950c235",
    "verified_classes": [
      "ConfusedDeputyError"
    ],
    "verified_functions": [
      "guard_tool_call"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ConfusedDeputyError"
    ],
    "sample_fail_closed_invariants": [
      "tool response contains credential-shaped JSON; halting reasoning loop and quarantining session"
    ],
    "stdlib_dependencies": [
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
