feat(analyzer): implement MCP rug-pull detection (RP1-RP3)#125
Open
tcconnally wants to merge 1 commit into
Open
feat(analyzer): implement MCP rug-pull detection (RP1-RP3)#125tcconnally wants to merge 1 commit into
tcconnally wants to merge 1 commit into
Conversation
Replaces the mcp_rug_pull analyzer stub with full RP1-RP3 detection. RP1: Unpinned MCP server references — detects npx, uvx, pip install, and docker commands that reference MCP servers/packages without version pinning (@Version, ==version, :tag, @sha256:). RP2: Permission pre-staging — detects manifest language suggesting future permission/capability expansion (rug-pull pre-staging). RP3: Version unpinned — detects wildcard/broad version constraints in manifest version field allowing silent major-version updates. Includes 8 unit tests covering all three rules. Previously tracked as TODO(SADD B.3.3) stub. Signed-off-by: Perseus Computing <51974392+tcconnally@users.noreply.github.com>
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.
Summary
Implements the MCP rug-pull analyzer that was previously a TODO stub (
mcp_rug_pull.py— SADD B.3.3). Adds three detection rules for supply-chain rug-pull risks in agent skills.New Detection Rules
RP1: Unpinned MCP Server References (MEDIUM)
Detects MCP server/package references without version pinning:
npx @scope/server(no@version)uvx package-name(no==version)pip install mcp-server(no==version)docker run org/image(no:tagor@sha256:)Uses a two-step approach: find command references, then check line context for version pinning indicators. This avoids the backtracking false positives that simpler regex-only approaches produce.
RP2: Permission Pre-Staging (LOW)
Detects manifest language suggesting future permission/capability expansion — a common pre-staging tactic for rug-pull attacks.
RP3: Version Unpinned (LOW)
Detects wildcard (
*,latest,any) or broad (>=,^) version constraints in manifest metadata that allow silent major-version updates.Testing
tests/test_mcp_rug_pull.pyDesign Notes
@scope/mcp-server@1.2.3.versionkey directly from manifest dict rather than regex onstr()output, which is more robust against different dict serialization formats.