Skip to content

Add mcp_schema_change_then_use trait for MCP tool-digest change followed by use (#317) - #536

Merged
blitzcrieg1 merged 8 commits into
blitzcrieg1:masterfrom
rumangsanya:mcp-schema-change-then-use
Nov 30, 2026
Merged

blitzcrieg1 merged 8 commits into
blitzcrieg1:masterfrom
rumangsanya:mcp-schema-change-then-use

Conversation

@rumangsanya

Copy link
Copy Markdown
Contributor

Slice of #317 under the bounty program (#454), claimed in the issue comments. Same shape as my #521.

What it detects: an mcp_schema event whose status is changed for a server (its tool digest moved), followed later in the same session by a successful call to that same server. Both recorded call shapes are covered: client-hook events carrying the mcp__<server>__<tool> qualified name, and proxy-recorded calls (mcp_audit_proxy) carrying tool.server. Server identity is matched through the same server_id() hashing the schema events already use, so no new stored fields and no schema changes — the signal is computed entirely from fields already recorded.

Mapping: ATLAS AML.T0109 (rug-pull), registered in DETECTION_ATLAS. The Detection keeps empty ATT&CK lists on purpose, following atlas.py's doctrine that ATT&CK has no honest id for this.

Contents:

  • Rule mcp-schema-change-then-use (severity high) in the detection registry — published rules 20 → 21
  • Corpus: attack case (digest move, then a call to the changed server) + benign case (digest move, no later use of that server), registered in corpus.yaml
  • New dedicated test file tests/test_detection_mcp_schema_change.py — 14 tests: fires on both call shapes; silent for use-before-change, other server, new/same/rebaselined status, denied call, and window expiry
  • Docs rows (detection-rules, Sentinel integration), generated Sigma rule, README counts updated

Verification:

  • Benchmark: 126 cases, 66/66 expected firings detected, 0 missed, 0 false positives
  • Full suite: all new tests pass; no regressions (failure set identical to a pristine-master baseline — pre-existing environment failures in async tests)
  • ruff check clean on touched files

Two existing guard tests were extended deliberately, not weakened: the ATLAS mapping guard now expects exactly two mapped rules (this slice is the second, per #317 naming AML.T0109), and the README number-words table was extended past twenty. Both assertions are unchanged in strength.

@blitzcrieg1
blitzcrieg1 merged commit d923e8e into blitzcrieg1:master Nov 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants