An interactive educational resource for learning about Model Context Protocol (MCP) security vulnerabilities, attack vectors, and defensive best practices.
MCP enables AI assistants to connect to external data sources and tools. This creates unique security challenges because MCP tools receive inputs that may be influenced by untrusted content processed by AI models. badMCP teaches you to recognize and prevent these vulnerabilities through:
- Side-by-side comparisons of vulnerable vs. secure code
- Real-world attack scenarios and threat modeling
- Interactive quizzes to test your knowledge
- A comprehensive security best practices checklist
- Path Traversal - Preventing unauthorized file access
- Command Injection - Safe execution of system commands
- Credential Exposure - Proper secrets management
- Tool Description Injection - Defending against malicious MCP servers
- Response Injection - Handling untrusted tool outputs
- Verbose Error Disclosure - Secure error handling
Open index.html in a browser to explore the lab locally, or deploy to any static hosting service.
This lab is for educational purposes only. Use the vulnerable code examples only in isolated test environments.