Skip to content
Back to search

damn-vulnerable-MCP-server

Damn Vulnerable MCP Server

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/harishsg993010--damn-vulnerable-mcp-server/badge.svg)](/listings/harishsg993010--damn-vulnerable-mcp-server)

HTML

<a href="/listings/harishsg993010--damn-vulnerable-mcp-server"><img src="/api/listings/harishsg993010--damn-vulnerable-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Once you have cloned the repository, run the following commands:

docker build -t dvmcp .
docker run -p 9001-9010:9001-9010 dvmcp

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 138 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Damn Vulnerable Model Context Protocol (DVMCP)
  2. A deliberately vulnerable implementation of the Model Context Protocol (MCP) for educational purposes.
  3. ## Overview
  4. The Damn Vulnerable Model Context Protocol (DVMCP) is an educational project designed to demonstrate security vulnerabilities in MCP implementations. It contains 15 challenges of increasing difficulty that showcase different types of vulnerabilities and attack vectors.
  5. This project is intended for security researchers, developers, and AI safety professionals to learn about potential security issues in MCP implementations and how to mitigate them.
  6. ## What is MCP?
  7. The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is a standardized protocol that allows applications to provide context for Large Language Models (LLMs) in a structured way. It separates the concerns of providing context from the actual LLM interaction, enabling applications to expose resources, tools, and prompts to LLMs.
  8. ## Recommended MCP Clients
  9. CLINE - VSCode Extension
  10. Refer to this [Connecting to a Remote Server - Cline](https://docs.cline.bot/mcp/connecting-to-a-remote-server) for connecting Cline with MCP server
  11. ## Quick Start
  12. Once you have cloned the repository, run the following commands:
  13. ```sh
  14. docker build -t dvmcp .
  15. docker run -p 9001-9015:9001-9015 dvmcp
  16. ```
  17. Each challenge is a Streamable HTTP MCP server. Challenge 1 is `http://localhost:9001/mcp`, and the rest follow through port 9015.
  18. ## Disclaimer
  19. It's not stable in a Windows environment. If you don't want to use Docker then please use Linux environment.
  20. I recommend Docker to run the LAB and I am 100% percent sure it works well in the Docker environment
  21. ## Security Risks
  22. While MCP provides many benefits, it also introduces new security considerations. This project demonstrates various vulnerabilities that can occur in MCP implementations, including:
  23. 1. **Prompt Injection**: Manipulating LLM behavior through malicious inputs
  24. 2. **Tool Poisoning**: Hiding malicious instructions in tool descriptions
  25. 3. **Excessive Permissions**: Exploiting overly permissive tool access
  26. 4. **Rug Pull Attacks**: Exploiting tool definition mutations
  27. 5. **Tool Shadowing**: Overriding legitimate tools with malicious ones
  28. 6. **Indirect Prompt Injection**: Injecting instructions through data sources
  29. 7. **Token Theft**: Exploiting insecure token storage
  30. 8. **Malicious Code Execution**: Executing arbitrary code through vulnerable tools
  31. 9. **Remote Access Control**: Gaining unauthorized system access
  32. 10. **Multi-Vector Attacks**: Combining multiple vulnerabilities
  33. ## Project Structure
  34. ```
  35. damn-vulnerable-MCP-server/
  36. ├── README.md # Project overview
  37. ├── requirements.txt # Python dependencies
  38. ├── challenges/ # Challenge implementations
  39. │ ├── easy/ # Easy difficulty challenges (1-3)
  40. │ │ ├── challenge1/ # Basic Prompt Injection
  41. │ │ ├── challenge2/ # Tool Poisoning
  42. │ │ └── challenge3/ # Excessive Permission Scope
  43. │ ├── medium/ # Medium difficulty challenges (4-7)
  44. │ │ ├── challenge4/ # Rug Pull Attack
  45. │ │ ├── challenge5/ # Tool Shadowing
  46. │ │ ├── challenge6/ # Indirect Prompt Injection
  47. │ │ └── challenge7/ # Token Theft
  48. │ └── hard/ # Hard difficulty challenges (8-10)
  49. │ ├── challenge8/ # Malicious Code Execution
  50. │ ├── challenge9/ # Remote Access Control
  51. │ └── challenge10/ # Multi-Vector Attack
  52. ├── docs/ # Documentation
  53. │ ├── setup.md # Setup instructions
  54. │ ├── challenges.md # Challenge descriptions
  55. │ └── mcp_overview.md # MCP protocol overview
  56. ├── solutions/ # Solution guides
  57. └── common/ # Shared code and utilities
  58. ```
  59. ## Getting Started
  60. See the [Setup Guide](docs/setup.md) for detailed instructions on how to install and run the challenges.
  61. ## Challenges
  62. The project includes 15 challenges across five difficulty groups:
  63. ### Easy Challenges
  64. 1. **Basic Prompt Injection**: Exploit unsanitized user input to manipulate LLM behavior
  65. 2. **Tool Poisoning**: Exploit hidden instructions in tool descriptions
  66. 3. **Excessive Permission Scope**: Exploit overly permissive tools to access unauthorized resources
  67. ### Medium Challenges
  68. 4. **Rug Pull Attack**: Exploit tools that change their behavior after installation
  69. 5. **Tool Shadowing**: Exploit tool name conflicts to override legitimate tools
  70. 6. **Indirect Prompt Injection**: Inject malicious instructions through data sources
  71. 7. **Token Theft**: Extract authentication tokens from insecure storage
  72. ### Hard Challenges
  73. 8. **Malicious Code Execution**: Execute arbitrary code through vulnerable tools
  74. 9. **Remote Access Control**: Gain remote access to the system through command injection
  75. 10. **Multi-Vector Attack**: Chain multiple vulnerabilities for a sophisticated attack
  76. ### Identity Challenges
  77. 11. **JWT Claim Forgery**: Leak the signing secret and forge an admin token
  78. 12. **Hidden Identity Override**: Read another employee's HR record through an undocumented parameter
  79. 13. **Privilege Escalation via Workflow IDOR**: Apply another user's approved role change
  80. ### Supply Chain Challenges
  81. 14. **Marketplace Plugin Poisoning**: Load an unverified plugin and follow its hidden instruction
  82. 15. **Dependency Confusion**: Install the highest public version and follow its hidden instruction
  83. See the [Challenges Guide](docs/challenges.md) for detailed descriptions of each challenge.
  84. ## Solutions
  85. Solution guides are provided for educational purposes. It's recommended to attempt the challenges on your own before consulting the solutions.
  86. See the [Solutions Guide](solutions/README.md) for detailed solutions to each challenge.
  87. ## Disclaimer
  88. This project is for educational purposes only. The vulnerabilities demonstrated in this project should never be implemented in production systems. Always follow security best practices when implementing MCP servers.
  89. ## License
  90. This project is licensed under the MIT License - see the LICENSE file for details.
  91. ## Author
  92. This project is created by Harish Santhanalakshmi Ganesan using cursor IDE and Manus AI.
  93. thanks to Ankit who presented this in Blackhat Canada and Blackhat Asia

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.