{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-an-oauth-resource-indicator-confused-deputy-attack-on-an-http-native-mcp-transport-when-tls-pinning-is-satisfied-but-the-a",
  "title": "How does an instance detect an OAuth resource-indicator confused-deputy attack on an HTTP-native MCP transport when TLS pinning is satisfied but the audience claim is silently rewritten",
  "date_of_record": "2026 November 18",
  "scope": "Applies to HTTP-native MCP servers (Streamable HTTP / SSE transport) that accept OAuth 2.0 bearer tokens and enforce TLS pinning at the transport layer. Does not apply to stdio-local MCP servers, nor to deployments where token audience validation is delegated to a trusted reverse proxy that terminates the connection before the MCP process sees it.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-an-oauth-resource-indicator-confused-deputy-attack-on-an-http-native-mcp-transport-when-tls-pinning-is-satisfied-but-the-a.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-an-oauth-resource-indicator-confused-deputy-attack-on-an-http-native-mcp-transport-when-tls-pinning-is-satisfied-but-the-a.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-an-oauth-resource-indicator-confused-deputy-attack-on-an-http-native-mcp-transport-when-tls-pinning-is-satisfied-but-the-a.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1737,
    "python_slice_tokens": 360,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "TLS pinning proves *who you are talking to*. OAuth resource indicators (RFC 8707) prove *what the token is for*. These are orthogonal invariants, and the failure mode described here occurs precisely at the seam where one is satisfied and the other is not. A pinned TLS connection to `mcp.internal.example` can carry a perfectly valid bearer token whose `aud` c...",
    "what_was_observed": "During a red-team exercise against a three-hop MCP deployment (client → gateway MCP server → downstream MCP server), the following sequence was reproduced: 1. Client requests a token with `resource=https://mcp.internal.example/downstream` from the AS. The AS returns a token with `aud=[\"https://mcp.internal.example/downstream\"]`. 2. Client presents the token to the *gateway* MCP server at `https://mcp.internal.example...",
    "condition_of_validity": "The detection procedure below is valid only when: - The MCP server terminates TLS itself (or a trusted sidecar does) and the pin is verified against the leaf certificate, not a proxy-injected header. - The token is a JWT with a verifiable signature and an `aud` claim (opaque tokens require the AS's introspection endpoint and a different check). - The server ...",
    "decision_boundary": "The decision boundary is a single comparison, but it must be evaluated at **every** hop, not just the edge: - **Accept** iff `aud` contains the server's own canonical resource identifier *and* the token was not re-presented by an upstream hop whose own identifier is absent from `aud`. - **Reject** if `aud` names only a downstream or sibling resource, even if...",
    "operational_effect": "When the check is enforced, three things change operationally: 1. Gateway MCP servers must obtain their *own* token exchange (RFC 8693) for downstream calls rather than forwarding the caller's token. This adds a hop but makes the deputy explicit and auditable. 2. Client libraries that hardcode `resource` to the AS URL (a common bug) begin failing closed inst..."
  },
  "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": "7beb1f45fc8720bd230295419f41d355812022119fea10ea5e2c60986485d8d0",
    "verified_classes": [
      "ConfusedDeputyError",
      "TokenClaims"
    ],
    "verified_functions": [
      "assert_token_scoped_to",
      "validate_inbound_request"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ConfusedDeputyError"
    ],
    "sample_fail_closed_invariants": [
      "token has no aud claim; unscoped tokens are never acceptable"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
