You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assess whether MCP (Model Context Protocol) server dependencies are sourced from verified original publishers or from potentially malicious forks and namespace squats.
284
+
285
+
**Threat model:** Attackers systematically fork legitimate MCP server repositories and republish them under their own npm scopes or PyPI packages without disclosure (e.g., iflow-mcp mass-fork campaign, 2025 -- hundreds of MCP servers forked and republished). Unlike typosquatting (misspelled names), fork republishing creates legitimate-looking scoped packages (e.g., `@attacker-org/mcp-server-github` vs. the original `@modelcontextprotocol/server-github`) that may contain injected payloads.
286
+
287
+
**What to look for in code and configuration:**
288
+
289
+
- MCP server packages installed from npm scoped packages or PyPI that do not match the original publisher's namespace.
290
+
-`mcp.json`, `claude_desktop_config.json`, or agent configuration files referencing MCP servers by package name without verifying the publisher.
291
+
- MCP server dependencies without pinned exact versions or integrity hashes (SRI).
292
+
- Missing provenance verification for MCP tool packages.
293
+
294
+
**Detection methods using allowed tools:**
295
+
296
+
```
297
+
# Find MCP server configuration and usage
298
+
Grep: "mcp|model.context.protocol|mcp-server|mcpServers" in **/*.{json,yaml,yml,toml,py,ts,js}
299
+
Grep: "@.*mcp.*server|mcp.server" in **/package.json **/requirements*.txt **/pyproject.toml
300
+
301
+
# Check for integrity hashes on MCP packages
302
+
Grep: "integrity|sha512-|sha256-" in **/package-lock.json **/yarn.lock
303
+
304
+
# Find MCP configuration files
305
+
Glob: **/mcp.json
306
+
Glob: **/claude_desktop_config.json
307
+
Glob: **/.mcp/**
308
+
```
309
+
310
+
**What constitutes a finding:**
311
+
312
+
| Condition | Severity |
313
+
|---|---|
314
+
| MCP server package installed from unverified fork (publisher does not match upstream repo) | High |
315
+
| MCP server dependencies without pinned exact versions | High |
316
+
| No integrity hash verification (SRI) on MCP server packages | Medium |
317
+
| MCP server configuration references packages without publisher verification guidance | Medium |
318
+
| No process for cross-checking MCP package publisher identity against upstream repo | Medium |
319
+
320
+
**MITRE ATLAS mapping:** AML.T0010 (ML Supply Chain Compromise) -- attacker substitutes a legitimate MCP tool component with a modified fork.
321
+
322
+
**SLSA v1.0 mapping:** Verify MCP server packages have provenance linking to the original source repository. Use `npm audit signatures` and check for Sigstore attestations.
323
+
324
+
**Recommended mitigations:**
325
+
326
+
1.**Verify provenance and publisher identity**: Run `npm audit signatures`; confirm publisher matches the upstream repo owner (e.g., `github.com/modelcontextprotocol/servers`).
327
+
2.**Pin exact versions with integrity hashes**: Use `npm install --save-exact` with SRI hashes in lockfiles; for Python, use `pip install --require-hashes`.
328
+
3.**Monitor for fork divergence**: Periodically diff installed MCP server packages against the original repository.
329
+
330
+
---
331
+
332
+
### Step 4c -- MCP Server Schema Vulnerabilities
333
+
334
+
Assess whether MCP server implementations contain exploitable schema vulnerabilities that attackers can leverage through malformed tool calls.
335
+
336
+
**Threat model:** Research by Munio (March 2026) scanning 763 publicly accessible MCP servers found that 31% contained exploitable schema vulnerabilities — including improper input validation, missing type checks, and unsafe parameter handling in tool request handlers. These vulnerabilities can be triggered by an attacker controlling an MCP client or by a compromised agent that sends crafted tool invocations.
337
+
338
+
**What to look for:**
339
+
340
+
- MCP server tool handlers that do not validate input against declared schema types before processing.
- Path traversal risks in file-system MCP tools that accept filename parameters.
343
+
- SQL injection or command injection in MCP tool backends that incorporate tool parameters into queries or shell commands without sanitization.
344
+
- Missing error handling that leaks internal state through MCP error responses.
345
+
346
+
**Grep patterns:**
347
+
```
348
+
Grep: "def.*tool|async def.*tool|@tool|tool_handler|handle_call" in **/server.py **/index.ts **/handler.ts
349
+
Grep: "subprocess|exec|shell=True|os.system" in **/server.py (MCP tools calling shell commands)
350
+
```
351
+
352
+
**Finding format:** For each MCP server tool, verify: (1) schema validation is enforced before parameter use, (2) file-system tools enforce path canonicalization, (3) shell-invoking tools use allowlisted arguments.
353
+
354
+
**Severity:** High if tool parameters are used in shell commands, SQL queries, or file operations without validation.
Assess whether MCP tool result content is treated as trusted data that can influence agent behavior (indirect prompt injection via supply chain vector).
361
+
362
+
**Threat model:** The ContextCrush/Context7 vulnerability (March 2026) demonstrated that MCP documentation retrieval tools can return content containing adversarial instructions that alter an LLM agent's behavior. Because MCP tool results are inserted directly into the agent's context window, a compromised or malicious MCP server can inject instructions that override the system prompt or redirect agent actions — without any vulnerability in the agent framework itself.
363
+
364
+
This is a supply chain attack: the MCP server is the attack vector, not the agent code.
365
+
366
+
**What to look for:**
367
+
368
+
- Agent code that passes raw MCP tool results directly into the LLM context without sanitization or trust boundary enforcement.
369
+
- MCP tool results that contain natural-language instructions, system-prompt-like content, or role-switching directives (`"Ignore previous instructions"`, `"You are now..."`).
370
+
- Missing output validation: agent frameworks that do not filter or flag unusual instruction-like patterns in tool results before including them in context.
1.**Treat MCP tool results as untrusted user content**, not as system context. Apply the same scrutiny as HTTP response bodies from external APIs.
376
+
2.**Add injection detection layer**: before inserting tool results into context, scan for instruction-like patterns (role switches, system override phrases).
377
+
3.**Principle of least context**: only include MCP tool result content that is strictly necessary for the task; truncate or summarize large result blobs before context insertion.
378
+
4.**Verify MCP server provenance**: a malicious fork or compromised MCP server is the primary delivery vehicle for this attack class.
**OWASP LLM mapping:** LLM07:2025 (System Prompt Leakage) and LLM02:2025 (Sensitive Information Disclosure) as downstream consequences.
383
+
384
+
---
385
+
281
386
### Step 5 -- Model Card Evaluation
282
387
283
388
Assess the completeness and accuracy of model documentation as a supply chain trust signal.
@@ -422,6 +527,7 @@ Assess whether architectural and procedural controls exist to detect model backd
422
527
| MITRE ATLAS | AML.T0010 | ML Supply Chain Compromise -- adversary introduces compromised ML artifacts |
423
528
| MITRE ATLAS | AML.T0020 | Poison Training Data -- adversary manipulates training data to alter model behavior |
424
529
| MITRE ATLAS | AML.T0043 | Craft Adversarial Data -- adversary creates inputs designed to cause misclassification or misbehavior |
530
+
| MITRE ATLAS | AML.T0010.002 | ML Supply Chain Compromise: Package Registry -- attacker substitutes legitimate ML tool packages with modified forks |
425
531
| NIST AI RMF 1.0 | MAP 2.3 | Scientific integrity and data quality in AI system lifecycle |
426
532
| NIST AI RMF 1.0 | GOVERN 1.5 | Ongoing monitoring and periodic review of the risk management process and its outcomes (applied here to third-party AI component risks) |
0 commit comments