
run-code MCP ToolProof of Concept exploit for CVE-2026-5029 — a critical unauthenticated Remote Code Execution vulnerability in Code Runner MCP Server, triggered via the
run-codeMCP tool when the server is run with--transport http.
Code Runner MCP Server exposes a JSON-RPC /mcp endpoint on port 3088 when launched with the --transport http flag. This endpoint is reachable with zero authentication — no API key, no session token, no origin check.
Any unauthenticated remote attacker who can reach the port can directly invoke the run-code MCP tool, which accepts arbitrary source code and a language identifier, writes it to a temp file, and executes it via child_process.exec() using the corresponding interpreter (bash, python, powershell, and 30+ others).
Since there is no sanitization applied to the code parameter at any stage, this results in full unauthenticated Remote Code Execution with the privileges of the process running the MCP server.
┌──────────┐ JSON-RPC tools/call ┌───────────────────────┐ exec() ┌──────────┐
│ Attacker │ ──── run-code tool ─────▶│ /mcp (port 3088) │ ─────────▶ │ RCE │
│ │ (no auth needed) │ Code Runner MCP │ │ on Host │
└──────────┘ └───────────────────────┘ └──────────┘
/mcp endpoint and enumerate available MCP toolsrun-code tool's input schema (code, languageId)tools/call JSON-RPC request with attacker-controlled codecode to a temp file and executes it via the selected interpreter.
├── exploit.py # 🎯 Interactive RCE exploit shell (Rich-based terminal UI)
└── README.md # 📖 You are here
exploit.py — Interactive ExploitThe primary exploit script, built for professional use in security assessments and case studies. Connects to the target MCP server and drops into an interactive shell where any command is executed live through the vulnerable run-code tool.
Features include:
-l (defaults to shellscript)pip package manager# Clone the repository
git clone https://github.com/0x00phantom-hat/CVE-2026-5029-Exploit.git
cd CVE-2026-5029-RCE-Exploit
# Install dependencies
pip install fastmcp rich
# Drop into an interactive RCE shell (default: shellscript)
python3 exploit.py -u http://TARGET:3088/mcp
# Use a specific language interpreter
python3 exploit.py -u http://TARGET:3088/mcp -l python
# List all languages the MCP server advertises support for
python3 exploit.py -u http://TARGET:3088/mcp --available
# Probe which language runtimes are actually installed on the target
python3 exploit.py -u http://TARGET:3088/mcp --installed -v
# Show the help menu
python3 exploit.py -h
Once connected, the exploit drops into an interactive prompt:
PhantomHat-MCP@Exploit-CVE-2026-5029 $ id
Type exit to close the session.
--transport http on any network-reachable interface — stick to the default stdio transport127.0.0.1 and place it behind an authenticated reverse proxy or VPNrun-code invocations and unusual child processesThis tool is provided for authorized security testing and educational purposes only.
Unauthorized access to computer systems is illegal under laws including the Computer Fraud and Abuse Act (CFAA), the Computer Misuse Act, and similar legislation worldwide. The author assumes no liability for misuse of this software.
Only use this tool against systems you own or have explicit written authorization to test.
Author: Phantom Hat
For authorized penetration testing and security research only.
| Property | Detail |
|---|
| CVE ID | CVE-2026-5029 |
| CVSS Score | 8.7 / 10 — High |
| CWE | CWE-306 — Missing Authentication for Critical Function |
| Affected Product | Code Runner MCP Server |
| Affected Versions | (Unpatched) All versions exposing the run-code tool via --transport http |
| Authentication | None required (Unauthenticated) |
| Patch Status | Not Fixed |
| Discovered By | Phantom Hat |
| Flag | Description | Default |
|---|
-u, --url | (Required) MCP server URL | — |
-l, --language | Language to use for code execution | shellscript |
-a, --available | List all supported languages | flag |
-i, --installed | Probe installed language runtimes on target | flag |
-v, --verbose | Verbose output mode | flag |
-h, --help | Show help menu | — |
| Phase | Name | Description |
|---|
| 1 | 🔍 Enumeration | Connect to /mcp and enumerate available MCP tools |
| 2 | 🧪 Schema Discovery | Confirm run-code's input schema (code, languageId) |
| 3 | 💣 Exploit Delivery | Send a crafted tools/call request with attacker-controlled code |
| 4 | 🚀 Interactive Execution | Drop into a live shell — every command runs on the target host |