{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-shares-one-http-mcp-endpoint-across-tenants-and-the-streamable-http-session-outlives-the-auth-token",
  "title": "What happens when an instance shares one HTTP MCP endpoint across tenants and the Streamable HTTP session outlives the auth token",
  "date_of_record": "2026 November 30",
  "scope": "Applies to Streamable HTTP MCP transports where a single server process multiplexes many client sessions over one listener, authenticates per-request via a bearer token on each POST/GET/DELETE, and enforces backpressure via per-session queues. Does not apply to stdio transports or to dedicated per-tenant processes, where session identity and auth identity are coextensive by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-shares-one-http-mcp-endpoint-across-tenants-and-the-streamable-http-session-outlives-the-auth-token.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-shares-one-http-mcp-endpoint-across-tenants-and-the-streamable-http-session-outlives-the-auth-token.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-shares-one-http-mcp-endpoint-across-tenants-and-the-streamable-http-session-outlives-the-auth-token.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2269,
    "python_slice_tokens": 361,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"auth bypass\" in the classic sense, and it is not \"session hijacking\" via stolen cookies. It is a **lifetime mismatch between three identities that the transport assumes are equal**: the *transport session* (established at `initialize`, keyed by `Mcp-Session-Id`), the *auth principal* (re-derived from the `Authorization` header on every re...",
    "what_was_observed": "A gateway-fronted MCP server multiplexed ~40 concurrent sessions over one listener. Auth was enforced by middleware that validated the bearer token on every request and injected `request.state.principal`. The session manager keyed sessions by `Mcp-Session-Id` and never inspected `request.state.principal` after creation. Trigger sequence, reproduced deterministically: 1. Client A initializes with token `TA` (principal...",
    "condition_of_validity": "The guardrail holds only under this conjunction: 1. **Session-principal binding is immutable.** At `initialize`, the server records `principal(session) = principal(request)`. Every subsequent request carrying `Mcp-Session-Id` must satisfy `principal(request) == principal(session)`; on mismatch, the server MUST respond `403` and MUST terminate the session (cl...",
    "decision_boundary": "The operator must choose, per deployment, where the binding is enforced, because the MCP server cannot always see the principal: - **Server-enforced binding** (recommended when tokens are JWTs with `sub`): the MCP server derives principal from the validated token and enforces rule 1 inline. Cost: every handler must consult the session-principal map before to...",
    "operational_effect": "The observable signature of the defect in production is not an auth error—it is a **quota anomaly paired with a data-delivery anomaly that never appears in auth logs**. Specifically: - Per-principal request counts show `bob` receiving responses whose payloads reference `alice`'s tool-call IDs. This is the leak. - Per-session credit counters show a session's ..."
  },
  "matched_failure_symptoms": [
    "SECRET_OR_PII_LEAK_IN_LOGS"
  ],
  "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": "17bfca027b2759f4f508dff1bdf0ab1e88dc65207d53c6fba82ad86779df0d95",
    "verified_classes": [
      "SessionPrincipalMismatch",
      "SessionTerminated",
      "Session",
      "PrincipalBudget",
      "MultiplexedMCPServer"
    ],
    "verified_functions": [
      "__init__",
      "_budget_for",
      "initialize",
      "dispatch",
      "drain"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "SessionPrincipalMismatch",
      "SessionTerminated"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
