{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-accept-a-poisoned-mcp-tool-after-a-clean-manifest-re-verification-the-toctou-gap-between-manifest-signature-validation-and-tool-c",
  "title": "Why does an instance accept a poisoned MCP tool after a clean manifest re-verification? The TOCTOU gap between manifest signature validation and tool-call dispatch in MCP server supply chains",
  "date_of_record": "2026 December 1",
  "scope": "Applies to LLM agent runtimes that discover MCP servers via a registry, validate a signed manifest (tool schemas, hashes, provenance attestation) once at session or connection establishment, and then dispatch tool calls over a long-lived stdio/SSE/HTTP transport. Does not cover per-call re-verification architectures, or servers whose tool list is immutable for the connection's lifetime by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-accept-a-poisoned-mcp-tool-after-a-clean-manifest-re-verification-the-toctou-gap-between-manifest-signature-validation-and-tool-c.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-accept-a-poisoned-mcp-tool-after-a-clean-manifest-re-verification-the-toctou-gap-between-manifest-signature-validation-and-tool-c.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-accept-a-poisoned-mcp-tool-after-a-clean-manifest-re-verification-the-toctou-gap-between-manifest-signature-validation-and-tool-c.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2319,
    "python_slice_tokens": 534,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Manifest signature validation proves *what the server claimed its tools were at the moment the manifest was signed*. It does not prove *what the server will return when a tool is actually invoked*, and it does not prove the tool list is stable across `tools/list` calls. The boundary most runtimes miss is that **the signed manifest and the live tool surface a...",
    "what_was_observed": "A runtime established an MCP session with a server whose manifest carried a valid ed25519 signature over a canonicalized JSON of `{name, version, tools:[{name, inputSchema, outputSchema, description_hash}]}`. The manifest listed three tools; all schema hashes matched the registry's published attestation. Validation passed and the connection was pinned as trusted. The runtime then performed a `tools/list` to hydrate i...",
    "condition_of_validity": "The manifest-signature guardrail is only sound under a conjunction of conditions, all of which must hold simultaneously: - **Set equality:** the set of tool names returned by the live `tools/list` must equal the set of tool names in the signed manifest. Any extra tool is a hard rejection, not a warning. A *missing* tool is a degraded-but-safe condition; an *...",
    "decision_boundary": "The decision boundary is **not** \"is the signature valid?\" It is **\"is the dispatched surface a subset of the signed surface, byte-for-byte, at the moment of dispatch?\"** Concretely: - On `tools/list` at hydration: compute `served_names == signed_names` and per-tool hash equality on served bytes. On mismatch → refuse the connection entirely. Do not \"register...",
    "operational_effect": "The practical consequence is that supply-chain integrity for MCP is a *continuous* property, not a *point-in-time* one. A signed manifest establishes provenance for a document; it does not establish that the process you are now talking to is serving that document. The runtime must treat the manifest as a *pinned expectation* and the live transport as an *unt..."
  },
  "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": "686dabccad8f3d3a13d09a12f6cf7512b5ea918643bfa8857a38343eafbc0103",
    "verified_classes": [
      "SurfaceDivergenceError",
      "SignedTool",
      "PinnedManifest"
    ],
    "verified_functions": [
      "_sha256",
      "reconcile_surface",
      "hydrate_session",
      "on_tools_list_changed",
      "resume_from_checkpoint"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SurfaceDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
