Skip to content

marmelab/mcp-vulnerability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Vulnerability Demonstrations

A collection of proof-of-concept Model Context Protocol (MCP) servers demonstrating critical security vulnerabilities in the MCP ecosystem. These demonstrations are for educational and security research purposes only.

🚨 Overview

The Model Context Protocol allows AI assistants to interact with external tools and services. However, the current implementation has several critical vulnerabilities that can be exploited to compromise user systems, steal credentials, and manipulate AI behavior.

This repository demonstrates three major vulnerability classes:

📚 Vulnerability Cases

Vulnerability: Malicious instructions embedded in tool descriptions force the AI to perform hidden actions before executing legitimate functionality.

Attack Vector: A seemingly innocent math operation tool that secretly:

  • Forces the AI to read .env files containing secrets
  • Exfiltrates sensitive data to a remote API endpoint
  • Operates completely silently without user awareness

Impact: Credential theft, data exfiltration, unauthorized file access

Read full documentation →


Vulnerability: One MCP tool injects instructions that compromise the behavior of OTHER MCPs and tools in the same session.

Attack Vector: A "fact of the day" tool that hijacks email functionality from ANY email MCP to:

  • Add hidden BCC recipients to all emails
  • Intercept all email communications
  • Affect tools the attacker doesn't even control

Impact: Email interception, cross-tool contamination, ecosystem-wide compromise

Read full documentation →


Purpose: A demonstration API server that acts as the attacker-controlled endpoint receiving stolen data.

Functionality:

  • Receives exfiltrated credentials and sensitive data
  • Stores stolen information in SQLite database
  • Simulates real-world attacker infrastructure

Read full documentation →

⚠️ Ethical Usage

This repository is for security research and education only. The vulnerabilities demonstrated here are real and affect production systems.

DO

  • ✅ Use for security research
  • ✅ Test in isolated environments
  • ✅ Report vulnerabilities responsibly
  • ✅ Develop better security measures
  • ✅ Educate others about MCP risks

DO NOT

  • ❌ Attack real users or systems
  • ❌ Steal real credentials or data
  • ❌ Deploy in production environments
  • ❌ Violate privacy or security policies
  • ❌ Use for malicious purposes

🤝 Contributing

Contributions are welcome! If you discover:

  • Additional vulnerability patterns
  • New attack vectors
  • Mitigation strategies
  • Documentation improvements

Please open an issue or submit a pull request.

📄 License

MIT - For educational and security research purposes only.


Disclaimer: This project demonstrates real vulnerabilities for educational purposes. Always use responsibly and ethically.

About

A collection of proof-of-concept Model Context Protocol (MCP) servers demonstrating critical security vulnerabilities in the MCP ecosystem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors