{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-cross-stream-token-substitution-in-http-native-mcp-server-multiplexing",
  "title": "Which invariants prevent cross-stream token substitution in HTTP-native MCP server multiplexing",
  "date_of_record": "2026 November 23",
  "scope": "HTTP-native MCP servers multiplexing multiple logical client streams (SSE or chunked bidirectional transport) over a single TCP or pooled HTTP/2 connection, where each stream carries an authorization token bound at stream-open time. Excludes stdio-transport servers and deployments where each stream terminates at a distinct TLS connection with per-connection auth.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-stream-token-substitution-in-http-native-mcp-server-multiplexing.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-stream-token-substitution-in-http-native-mcp-server-multiplexing.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-cross-stream-token-substitution-in-http-native-mcp-server-multiplexing.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1028,
    "python_slice_tokens": 187,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Multiplexing is a *transport* property. Authorization is a *stream* property. The boundary failure occurs when the server treats an authenticated connection as authority for every stream it carries, rather than requiring each stream to independently present and validate a token bound to that stream's identity at open time. A connection-level auth check is ne...",
    "what_was_observed": "An MCP server accepted an `initialize` request on stream A with token `T_A` (scope: `tools:read`). Stream B opened on the same HTTP/2 connection with token `T_B` (scope: `tools:write`). A subsequent `tools/call` frame arrived on stream B carrying a `Mcp-Session-Id` minted during stream A's handshake. The server resolved the session by ID, looked up the *connection's* principal (`T_A`'s identity, recorded at connectio...",
    "condition_of_validity": "The per-stream token binding invariant holds only when all four of the following are simultaneously true: 1. The session identifier is minted with an immutable reference to the token fingerprint that created it, never overwritten. 2. Every inbound frame is re-authorized against the *session's* bound token fingerprint, not the connection's, and not the frame'...",
    "decision_boundary": "The server must reject—not downgrade, not fall back—when the session's bound token fingerprint and the stream's presented token fingerprint diverge. There is no legitimate case for cross-token session attachment in a correctly designed MCP deployment: if a client needs to escalate, it opens a new session with the escalated token. Falling back to connection a...",
    "operational_effect": "When the invariant is enforced, token substitution attacks become impossible by construction, and the failure mode shifts from silent privilege escalation to loud, per-frame 403s that are trivially observable in logs. When it is not enforced, the system exhibits *authorization confusion*: correct-looking audit trails (every token valid, every session valid) ..."
  },
  "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": "d8b133e7ffe4b0ee4203a4ba5ee035a76b412aeaa68e6c36010b9994054e1897",
    "verified_classes": [
      "StreamTokenBindingError",
      "Session",
      "InboundFrame"
    ],
    "verified_functions": [
      "fingerprint",
      "authorize_frame",
      "handle_tools_call"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StreamTokenBindingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
