mcp-breach-to-fix-labs
by PawelKozy
Overview
GitHub code review assistant demonstrating prompt injection vulnerability and its mitigation in an MCP server.
Installation
docker compose up github-public-issue-vulnerableEnvironment Variables
- CH09_OWNER
- LOG_LEVEL
- CHALLENGE_HOST
- CHALLENGE_PORT
Security Notes
The 'vulnerable' server component is intentionally designed to be highly insecure for demonstration purposes. It suffers from a critical prompt injection vulnerability where malicious instructions embedded in public GitHub issues are executed verbatim by the AI agent. This allows unauthorized tool calls to 'get_repo_webhooks' (exfiltrating sensitive webhook URLs and GitHub API tokens) and 'create_issue_comment' (posting these secrets back to a public issue). The 'secure' server component mitigates these risks through multi-layered defenses: (1) Role-Based Access Control (RBAC) with default-deny, (2) automatic permission demotion when untrusted public content is viewed, (3) sanitization of issue content to remove directives, and (4) output validation to prevent comments containing sensitive patterns. Due to the intentional vulnerabilities in the 'vulnerable' component, it is not safe for deployment outside of isolated lab environments.
Similar Servers
mcp-for-beginners
Develop and test custom Model Context Protocol (MCP) servers providing tools for simulated weather information, GitHub repository cloning, and opening projects in VS Code, primarily intended for AI agent development workflows within the AI Toolkit environment.
mcp-scanner
A Python tool for scanning MCP (Model Context Protocol) servers and tools for potential security findings, combining Cisco AI Defense inspect API, YARA rules, and LLM-as-a-judge to detect malicious MCP tools.
mcp-watch
A comprehensive security scanner for Model Context Protocol (MCP) servers, detecting various vulnerabilities in their implementations.
mcp-server-fuzzer
A comprehensive CLI-based fuzzing tool for Model Context Protocol (MCP) servers, designed to find vulnerabilities and validate server conformance through both tool argument fuzzing and protocol type fuzzing across multiple transport protocols (HTTP, SSE, Stdio, StreamableHTTP).