vulnerable-mcp-server-indirect-prompt-injection
A vulnerable MCP server demonstrating indirect prompt injection through document retrieval
pinned to #47b7f20updated 2 weeks ago
Ask your AI client: “install mcps/vulnerable-mcp-server-indirect-prompt-injection”.
Requires the metahub MCP server installed in your client. Set up MCP.
mh install mcps/vulnerable-mcp-server-indirect-prompt-injectionmetahub onboarded this repo on the author's behalf.
If you own github.com/appsecco/vulnerable-mcp-servers-lab on GitHub, claim the listing to take over publishing. Your claim preserves the existing eval history and badges; only the curator label is replaced with verified-publisher on your next publish.
Stars
264
Last commit
2 weeks ago
Latest release
published
- #ai-red-teaming
- #ai-research
- #appsecco
- #bugbounty
- #hacking
- #learning-pentesting
- #mcp
- #mcp-client
- #mcp-server
- #pentesting
- #prompt-injection
- #security
- #server
- #tools
- #vulnerability-demo
- #vulnerable-labs
What this server exposes
Surfaces parsed from this server's source at publish time.
Launches: vulnerable-mcp-server-indirect-prompt-injection
Evaluation report
WarningsAutomated checks the publisher passed at publish time — structure, docs, safety, and whether the artifact behaves as claimed.47b7f20· 2 weeks ago
Safety
21Dependencies: known vulnerabilitieswarn
2 high/critical advisories — @modelcontextprotocol/[email protected] (HIGH: GHSA-8r9q-7v3j-jr4g) · @modelcontextprotocol/[email protected] (HIGH: GHSA-w48q-cv73-mx4w)
Update the affected packages, then re-publish. (`npm audit` shows the same data locally.)
LICENSE file at repo root
LICENSE
No sensitive files in the repo
scanned for .env, credentials.json, *.pem, .ssh/, AWS / GCP configs — none found
Release history
1- releasecurrent47b7f20warn2 weeks ago
Contents
This is an intentionally vulnerable MCP server that simulates a document retrieval/search system where retrieved documents include hidden instructions designed to manipulate the model.
Do not use this outside a controlled lab environment.
What it provides
The server exposes these MCP tools:
get_document: Retrieve a document by ID (expectsdocument_id)- Available IDs:
company_policy,product_specs,user_review,safe_document
- Available IDs:
search_documents: Search for documents containing keywords (expectsquery)
get_document returns the full document as plain text, including any embedded hidden instructions.
How it is vulnerable
This server demonstrates indirect prompt injection:
- Retrieved documents contain prompt-like directives embedded in normal-looking content (examples include bracketed “SYSTEM INSTRUCTION” text, HTML comments, and delimited injection blocks).
- The server returns this content verbatim with no sanitization, no filtering, and no separation between “data” and “instructions”.
In a real RAG / document assistant system, this can lead the model to follow attacker-controlled instructions that override user intent or policy.
Requirements
- Node.js (modern version)
- npm
Install dependencies in this folder:
npm install
Run with Claude (using claude_config.json)
This folder includes claude_config.json, which is a ready-to-merge snippet for Claude's MCP server config.
- Install dependencies:
npm install
- Edit
claude_config.jsonand replace the placeholder:
/full/path/to/vulnerable-mcp-server-indirect-prompt-injection/index.js
Use an absolute path.
-
Open Claude and edit its MCP configuration (Claude Desktop typically exposes this under Settings -> Developer -> Edit config).
-
Merge the
mcpServersentry into your config. If you already havemcpServers, add just the server entry:
{
"mcpServers": {
"vulnerable-mcp-server-indirect-prompt-injection": {
"command": "node",
"args": [
"/absolute/path/to/vulnerable-mcp-server-indirect-prompt-injection/index.js"
]
}
}
}
- Restart Claude so it loads the updated MCP configuration.
After Claude restarts, the server should appear as:
vulnerable-mcp-server-indirect-prompt-injection
Run manually (for debugging)
This server speaks MCP over stdio. Most users should run it via an MCP-capable client (like Claude) rather than manually.
If you just want to confirm it starts:
npm install
node index.js
Example usage (safe + injection)
From your MCP client:
- Demonstrate normal retrieval:
- Ask for: “Retrieve
safe_documentand summarize it.”
- Ask for: “Retrieve
- Search for documents:
- Use
search_documentswithquery: "vacation"(should findcompany_policy)
- Use
- Demonstrate indirect prompt injection:
- Ask: “What does
company_policysay about vacations?” - Ask: “Summarize
product_specs.” - Ask: “What does
user_reviewsay about the product?”
- Ask: “What does
These documents intentionally contain embedded instructions that attempt to bias or override the assistant’s response.
Notes
- This server is intentionally insecure and exists only for demonstration/training.
- The “hidden instructions” are embedded in different formats to illustrate how injections can be smuggled in:
- Bracketed pseudo-system directives
- HTML comments
- Delimited injection blocks
Links to Appsecco Resources
Reviews
No reviews yet. Be the first.
Related
vulnerable-mcp-server-indirect-prompt-injection-remote-mcp
A vulnerable MCP server demonstrating indirect prompt injection through document retrieval
vulnerable-mcp-server-malicious-code-exec
A simple MCP server with a get_qotd tool that fetches quotes from a free API
vulnerable-mcp-server-malicious-tools
A simple MCP server to fetch and display latest status of Atlassian services
mh install mcps/vulnerable-mcp-server-indirect-prompt-injection