{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-origin-header-validation-as-a-confused-deputy-boundary-rather-than-a-cors-convenience",
  "title": "In what scenarios must an instance treat MCP Origin-header validation as a confused-deputy boundary rather than a CORS convenience",
  "date_of_record": "2026 November 24",
  "scope": "Applies to remote MCP servers using Streamable HTTP transport (the `initialize` → `Mcp-Session-Id` → `tools/call` flow) that accept bearer tokens from browsers or agent hosts. Does not apply to stdio transport, nor to servers that never expose an HTTP listener reachable by a user-agent.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-origin-header-validation-as-a-confused-deputy-boundary-rather-than-a-cors-convenience.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-origin-header-validation-as-a-confused-deputy-boundary-rather-than-a-cors-convenience.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-origin-header-validation-as-a-confused-deputy-boundary-rather-than-a-cors-convenience.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2092,
    "python_slice_tokens": 336,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The `Origin` header on an MCP HTTP request is routinely mis-filed as a CORS hygiene concern — something you \"handle\" by echoing a whitelist so the browser preflight passes. That framing hides the actual invariant. In the MCP Streamable HTTP transport, a remote server is a *capability endpoint*: a valid `Mcp-Session-Id` plus a bearer token is sufficient to in...",
    "what_was_observed": "A remote MCP server was deployed behind a reverse proxy that terminated TLS and forwarded to the MCP runtime. The runtime implemented session handling correctly: `initialize` returned an `Mcp-Session-Id` in a response header, subsequent `tools/call` requests carried it back, and the server validated the session against an in-memory store keyed by `(session_id, token_subject)`. The `Origin` check was implemented in th...",
    "condition_of_validity": "The confused-deputy defense holds only when all of the following are simultaneously true, and each is independently falsifiable: 1. **Exact-match origin allowlist, not reflection.** The server compares the received `Origin` against a static, deployment-time set of exact origins (`https://console.example`, `https://agent-host.example`). No prefix matching, no...",
    "decision_boundary": "The boundary between \"origin validation is a CORS convenience\" and \"origin validation is a confused-deputy boundary\" is crossed at the moment the server accepts a bearer token that a browser will attach automatically to cross-origin requests. Concretely: - If the MCP server **never** accepts `Authorization` from a browser context (e.g., token is injected by ...",
    "operational_effect": "The observable effect of getting this boundary wrong is that the MCP server's audit log shows tool invocations with a valid subject, a valid session, and a valid token — and an `Origin` value that was logged but never gated. Post-incident forensics cannot distinguish coerced from legitimate calls by subject or session; only the `Origin` field separates them,..."
  },
  "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": "f374e123822bd661ebada2bea0b4f1a841664d0128cba71907125bdf5634878e",
    "verified_classes": [
      "ConfusedDeputyBoundaryError"
    ],
    "verified_functions": [
      "authorize_mcp_request",
      "dispatch_tools_call"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "ConfusedDeputyBoundaryError"
    ],
    "sample_fail_closed_invariants": [
      "token lacks subject or origin binding; cannot prove non-coercion",
      "missing Mcp-Session-Id on tools/call"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
