Repository navigation
fix(security): identical tool definitions across servers are not a shadowing clone - #1838
Merged
Merged
Conversation
…adowing clone Two instances of one MCP server (two filesystem roots, two GitHub orgs, the release gate's mcpfixture x3) expose byte-identical tool definitions. Since R2-1 (#1714) scan-gates the first-discovery baseline, shadowing.cross_server held every one of those tools as "dangerous - possible impersonation" on trusted servers, which turned the v0.73.0-rc.1 QA gate red (matrix cells stdio/http/docker, Web UI sweep) and would do the same to users on 0.73. The clone shape exists to catch a copy with injected or rewritten prose; an identical copy has none, and server:tool namespacing keeps the two reachable apart. A same-named peer whose raw description and input/output schemas are equal (JSON compared structurally) is now skipped by both the HARD clone and the SOFT name-squat shape. Any edit at all - one word, one schema property - is judged by cloneDescriptions exactly as before (pinned by tests, including the identical-description/widened-schema and identical-pair-plus-near-clone cases). Corpus: hard negative hn_shadowing_identical_instance (master + bundled self-check copy); both scan-eval gates pass at recall 1.0 / fp 0.0. The two tests whose premise was "byte-identical is the HARD clone" now use a cosmetic edit.
Deploying mcpproxy-docs with
|
| Latest commit: |
3a74fe4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://94e3fded.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-shadowing-identical-dupl.mcpproxy-docs.pages.dev |
Dumbris
enabled auto-merge (squash)
November 7, 2026 14:59
…es, not byte-identical TestAttackerStageOneTriggersEveryEngineCheck expected shadowing.cross_server on the attacker's filesystem_read, which copied the victim's description byte-for-byte - exactly the second-instance shape the detector now exempts. The vector keeps its purpose with one cosmetic edit (trailing punctuation), which cloneDescriptions does not let launder the copy; the README row and the simulated-call note say so. Same edit for cmd/tpa-redteam's shadow-clone vector so its BaselineWant stays honest.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
v0.73.0-rc.1's QA gate went red (run 42352688067): matrix cellsstdio/http/dockerfailedcall-mcpwithTOOL_QUARANTINED / new_unapproved_tool, and the Web UI sweep sawNot callable · Needs reviewinstead ofCallable.Root cause (reproduced locally on the RC binary): R2-1 (#1714) scan-gates a trusted server's first-discovery baseline, and
detect.shadowing.cross_serverfires HARD on "same name + near-identical description" — which three instances of the same fixture produce. It is symmetric, so every instance is held,held_verdict: dangerous. The same thing happens to a user who adds one MCP server twice (two filesystem roots, two GitHub orgs) on 0.73; existing servers are unaffected (they already have a baseline marker).What
A same-named peer whose raw description and input/output schemas are equal (JSON compared structurally, so key order does not matter) is a second instance of the same software, not a clone:
identicalDefinitionskips it for both the HARD clone shape and the SOFT name-squat shape. Any edit at all — one word, one schema property — is judged bycloneDescriptionsexactly as before.hn_shadowing_identical_instanceindetect_corpus_v1.json+ the bundled self-check copy.scan-eval --gateand--review-gatepass at recall 1.0 / fp 0.0.docs/features/tool-scanner.mdclone paragraph.Verified
go test -race ./internal/security/...,./internal/runtimebaseline tests, golangci-lint v2 (CI config) clean. Live: fixed core + 3 trusted servers with an identical 2-tool set → allapproved, review queue 0 (the RC held all 6 asdangerous).Unblocks
v0.73.0-rc.2.