{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-validates-origin-on-a-dns-rebinding-mcp-endpoint-but-binds-the-session-token-to-a-hostname-rather-than-a-resolved-peer",
  "title": "What happens when an instance validates Origin on a DNS-rebinding MCP endpoint but binds the session token to a hostname rather than a resolved peer",
  "date_of_record": "2026 November 25",
  "scope": "Applies to HTTP-native MCP servers (Streamable HTTP / SSE transports) that authenticate sessions with a bearer token and defend against DNS rebinding via Origin/Host allowlisting. Does not apply to stdio transports, nor to servers that pin sessions to a resolved IP at token issuance and re-verify on every request.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-validates-origin-on-a-dns-rebinding-mcp-endpoint-but-binds-the-session-token-to-a-hostname-rather-than-a-resolved-peer.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-validates-origin-on-a-dns-rebinding-mcp-endpoint-but-binds-the-session-token-to-a-hostname-rather-than-a-resolved-peer.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-validates-origin-on-a-dns-rebinding-mcp-endpoint-but-binds-the-session-token-to-a-hostname-rather-than-a-resolved-peer.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1911,
    "python_slice_tokens": 363,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two independent checks that are routinely conflated in MCP HTTP deployments: 1. **Origin validation** — a browser-side defense. It answers: *did this request originate from a page the operator trusts?* It is enforced by inspecting the `Origin` (and `Host`) header against an allowlist. 2. **Session-token binding** — a server-side defense. It answers...",
    "what_was_observed": "A Streamable HTTP MCP server exposed a tool surface (`filesystem.read`, `shell.exec` behind an approval warrant) on `mcp.internal.example:8443`. Session tokens were issued at `initialize` and stashed server-side in a map keyed by the `Host` header observed at issuance, with a TTL. Origin validation was configured with an allowlist of `https://app.example` and `https://admin.example`. The rebinding sequence: 1. An age...",
    "condition_of_validity": "The Origin-as-session-binding pattern is only valid under the conjunction: - **C1.** Every request carries a non-empty `Origin` that is on the allowlist. (Violated: non-browser MCP clients omit `Origin`.) - **C2.** The `Origin` value is not attacker-controllable. (Violated: rebinding makes any origin reachable at any IP.) - **C3.** The session token is bound...",
    "decision_boundary": "The boundary is between **transport-level identity** and **application-level assertion**: - `Origin` and `Host` are *application-level assertions* — strings the client chooses. They are meaningful only when a browser enforces them, and only for browser-originated requests. - The resolved peer IP (`remote_addr`) is a *transport-level fact* — it is what the TC...",
    "operational_effect": "After the fix, the rebinding vector is inert: the attacker page can make the browser connect to `127.0.0.1:8443`, but the session token it steals (if any) is bound to the *browser's* peer IP as seen by the server — which, for a rebinding page, is the browser's own address, not the server's. The stolen token cannot be replayed from the attacker's host because..."
  },
  "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": "357120486ea05a6ae6fbb2e29904ae74186fdc145511682ac3052e0e87456dfa",
    "verified_classes": [
      "SessionBindingError",
      "SessionRecord"
    ],
    "verified_functions": [
      "validate_request",
      "handle_tool_call"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "SessionBindingError"
    ],
    "sample_fail_closed_invariants": [
      "token mismatch",
      "shell.exec requires an explicit warrant; session flags are not authorization",
      "browser-class token requires Origin header"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "ipaddress",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
