kenhuangus_mcp-vulnerable-server-demo
If you are the rightful owner of kenhuangus_mcp-vulnerable-server-demo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project demonstrates a vulnerable MCP server and multiple clients, including a proof-of-concept attack client and also a good client.
The Insecure MCP Demo is an educational project designed to showcase potential security vulnerabilities in a Model Context Protocol (MCP) server. It includes a vulnerable MCP server and multiple clients, such as a proof-of-concept attack client and a good client. The project structure consists of a vulnerable server script, a good client script for normal interactions, an attack client script to demonstrate exploitation, and a requirements file for dependencies. The project highlights several vulnerabilities, including SQL injection, arbitrary code execution, sensitive data exposure, and lack of access control. It also provides mitigation strategies to secure a real-world MCP server, such as using parameterized queries, restricting dangerous tools, implementing authentication and authorization, validating and sanitizing input, limiting environment variable access, auditing and monitoring usage, and adhering to the principle of least privilege. The project is intended for educational purposes only and should not be deployed in production environments.
Features
- insert_record: Inserts a name/address record into the database. Vulnerability: Prone to SQL injection due to direct string interpolation of user input into SQL queries.
- query_records: Lists all records in the database. Vulnerability: Exposes all data without authentication or access control.
- execute_sql: Executes arbitrary SQL queries provided by the client. Vulnerability: Allows any SQL command, including destructive ones (e.g., data exfiltration, schema changes).
- get_env_variable: Returns the value of any environment variable requested. Vulnerability: Leaks sensitive environment variables (e.g., secrets, API keys).