CVE-2026-57124: PraisonAI: Missing Authentication for Critical Function and Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in praisonai
PraisonAI 4.6.48 and earlier lets an unauthenticated client run commands on the host through the UI's `POST /api/mcp/connect` endpoint. The endpoint starts whatever local process the request names, as the PraisonAI UI service user. `praisonai ui` binds to `0.0.0.0` by default. Upgrade to 4.6.59.
Published Jun 18, 2026 · Updated Jul 20, 2026 · Analysis Oct 25, 2026
What an attacker can do
The PraisonAI UI host apps (praisonai ui, praisonai ui agents, praisonai claw, and anything built on create_host_app() or build_host_app()) serve the PraisonAIUI Starlette app from aiui==0.3.121. Its api_mcp_connect handler reads JSON with a command and args, then connect_mcp_server builds a StdioMCPClient that launches that process. Authentication is opt-in: AuthEnforcementMiddleware only enforces it when AUTH_ENFORCE=true, and create_app defaults to require_auth=False.
A single request such as {"name":"evil","command":"/usr/bin/touch","args":["/tmp/pwned-by-ui-mcp"]} is enough. The researcher's proof of concept created the marker file even though the MCP handshake failed with a version mismatch between aiui and mcp. The process had already started, and the PoC retries to win the race.
Anyone who can reach the UI port gets code execution as the service user. Swap the touch for a shell and they can steal API keys and provider secrets in the environment, change files, or leave a long-running process. Teams that expose praisonai ui on a LAN, cloud host or container with a published port are the ones at risk.
Who is affected
The praisonai pip package at 4.6.48 and earlier. Version 4.6.48 (tag v4.6.48, commit d5f1114) was confirmed. The reporter says earlier releases that expose the same UI app are likely affected, and tested only the latest at the time. You are exposed when you run the UI commands or a host app with the ui or claw extras installed and the port is reachable. Check:
pip show praisonai aiuipraisonai
- Ecosystem
- PyPI
- Affected
- <= 4.6.48
- Fixed in
- 4.6.59
- Check
pip show praisonai
How to fix it
Upgrade to praisonai 4.6.59 or later.
pip install --upgrade "praisonai>=4.6.59"The advisory does not describe the code change. The reporter's recommendations were to remove caller-supplied command and args from the HTTP API, require auth on /api/mcp/connect, /api/mcp/disconnect/* and /api/mcp/servers, and bind to 127.0.0.1. Check the 4.6.59 release notes to see which were applied. Until you upgrade, bind the UI to localhost with --host 127.0.0.1 or put it behind a firewall or VPN. Setting AUTH_ENFORCE=true is a plausible mitigation but the advisory does not confirm it blocks this route, so test it.
How to tell if you were hit
Look in the web server or access logs for POST /api/mcp/connect from addresses you don't control. The UI logs lines such as Failed to connect to MCP stdio server even when the process has started. Check the process tree under the PraisonAI UI for unexpected children, and for new files such as /tmp/pwned-by-ui-mcp or the PoC's /tmp/praisonai_host_app_mcp_touch_marker.txt. Check GET /api/mcp/servers for entries you did not add. Treat any API keys in that process's environment as exposed if you find a hit.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Unauthenticated PraisonAI UI MCP connect endpoint executes attacker-chosen local commands
Summary
PraisonAI v4.6.48 exposes the PraisonAIUI MCP client management API through the default UI host apps without authentication. A remote unauthenticated client can send POST /api/mcp/connect with a command and args field. The endpoint passes those values into the MCP stdio client, which starts the attacker-selected local process as the PraisonAI UI service user.
The issue is reachable through PraisonAI's hosted UI integration (praisonai ui, praisonai ui agents, praisonai claw, and any app using praisonai.integration.host_app.create_host_app() / build_host_app()). praisonai ui and related Typer UI commands bind to 0.0.0.0 by default.
Affected Versions
Confirmed affected:
praisonaiv4.6.48- Commit tested:
d5f1114aaf1a2e9f121a6e66b929149ca2201f1d - Tag tested:
v4.6.48 - Pinned UI dependency:
aiui==0.3.121fromsrc/praisonai/uv.lock
Likely affected:
- Any PraisonAI release that exposes
aiui/praisonaiuicreate_app()through the PraisonAI UI host apps without authentication and includes themcpdependency. I only confirmed the latest release during this audit.
Severity
Reasoning:
AV: the vulnerable endpoint is an HTTP API route.AC: a single POST request is sufficient.PR: default UI host apps do not require credentials unless opt-in auth is configured.UI: no victim interaction is needed after the server is running.S: code executes in the PraisonAI UI server process context.C/I/A: arbitrary local command execution permits secret exfiltration, file tampering, and service disruption.
Root Cause
PraisonAI depends on MCP by default and exposes PraisonAIUI via optional UI extras:
src/praisonai/pyproject.toml:11includes base dependencies.src/praisonai/pyproject.toml:19includesmcp>=1.20.0.src/praisonai/pyproject.toml:25defines theuiextra withaiui>=0.3.121,<0.4.src/praisonai/pyproject.toml:197defines theclawextra withaiui[all]>=0.3.121,<0.4.
PraisonAI's UI commands bind externally by default and launch aiui run:
src/praisonai/praisonai/cli/commands/ui.py:114setshost="0.0.0.0"forpraisonai ui.src/praisonai/praisonai/cli/commands/ui.py:163passes that host toaiui run.src/praisonai/praisonai/cli/commands/ui.py:186,:204, and:222also default subcommands to0.0.0.0.src/praisonai/praisonai/cli/commands/claw.py:41defines the full dashboard command.src/praisonai/praisonai/cli/commands/claw.py:93launchesaiui runwith the selected host.
PraisonAI's default apps create the PraisonAIUI Starlette app without forcing authentication:
src/praisonai/praisonai/ui_chat/default_app.py:18callsconfigure_host(...).src/praisonai/praisonai/ui_chat/default_app.py:142exportsapp = create_host_app().src/praisonai/praisonai/claw/default_app.py:63callsconfigure_host(...).src/praisonai/praisonai/claw/default_app.py:128exportsapp = create_host_app().src/praisonai/praisonai/integration/host_app.py:174importspraisonaiui.server.create_app.src/praisonai/praisonai/integration/host_app.py:180returnscreate_app().
In aiui==0.3.121, the exposed server registers the MCP routes and auth is opt-in:
praisonaiui/server.py:1483definesapi_mcp_connect.praisonaiui/server.py:1488reads attacker-controlled JSON.praisonaiui/server.py:1491accepts eithercommandorurl.praisonaiui/server.py:1496callsconnect_mcp_server(body).praisonaiui/server.py:2516definescreate_app(..., require_auth=False, ...).praisonaiui/server.py:2550addsAuthEnforcementMiddleware, but it only enforces auth whenAUTH_ENFORCE=true.praisonaiui/server.py:2769registers/api/mcp/servers.praisonaiui/server.py:2770registers/api/mcp/connect.
The MCP feature converts the request body into a local process launch:
praisonaiui/features/mcp.py:325definesconnect_server(self, server_config).praisonaiui/features/mcp.py:330chooses stdio transport whencommandis present.praisonaiui/features/mcp.py:332constructsStdioMCPClient(command=server_config["command"], args=server_config.get("args", [])).praisonaiui/features/mcp.py:360callsclient.connect(), which invokes the MCP stdio transport and starts the process.
Minimal PoC
PoC file: poc/praisonai-aiui-mcp-connect-rce.py
The PoC runs the PraisonAI host app in-process, sends the unauthenticated HTTP request, and asks the server to execute /usr/bin/touch /tmp/praisonai_host_app_mcp_touch_marker.txt. It does not contact an LLM provider and uses no credentials.
Observed output from the tested checkout with aiui==0.3.121 and mcp==1.25.0 available:
[19:19:55] server.py:229 WARNING No auth_token provided for Gateway server. Generated temporary token: gw_****650a. For production, set GATEWAY_AUTH_TOKEN.
[19:19:55] mcp.py:135 ERROR Failed to connect to MCP stdio server: 'tuple' object has no attribute 'initialize'
HTTP_STATUS= 200
RESPONSE= {"server":{"name":"poc-stdio-process-0","transport":"stdio","status":"error","tools":[],"last_error":"Connection failed"}}
SUCCESS_AT_ATTEMPT= 0
MARKER_EXISTS= True
MARKER_PATH= /tmp/praisonai_host_app_mcp_touch_marker.txtThe MCP handshake fails because aiui==0.3.121 is not compatible with the locked mcp==1.25.0 return shape, but the attacker-selected process is already started. Process startup can race the immediate teardown caused by this version mismatch, so the checked-in PoC retries the same unauthenticated request until /usr/bin/touch wins scheduling and creates the marker. The marker file proves local command execution despite the reported MCP connection error.
Exploit Scenario
An operator runs:
pip install "praisonai[ui]"
praisonai uiBecause praisonai ui binds to 0.0.0.0 by default and the generated app does not require authentication by default, any host that can reach the UI port can send:
POST /api/mcp/connect
Content-Type: application/json
{
"name": "evil",
"command": "/usr/bin/touch",
"args": ["/tmp/pwned-by-ui-mcp"]
}In a real attack, the command can be replaced with a shell, a credential exfiltration command, a file modification command, or a payload that starts a long-lived process as the PraisonAI UI server user.
Novelty / Non-Duplicate Analysis
Searched sources:
- OSV query for PyPI
praisonai: 51 advisories returned. - OSV query for PyPI
aiui: 0 advisories returned. - OSV query for PyPI
praisonaiui: 0 advisories returned. - GitHub Advisory Database search for exact
/api/mcp/connect,api_mcp_connect,StdioMCPClient,connect_mcp_server, andpraisonaiui.features.mcp. - NVD API searches for
PraisonAI StdioMCPClient,PraisonAI api_mcp_connect,PraisonAI /api/mcp/connect,PraisonAIUI /api/mcp/connect, andaiui StdioMCPClient: 0 results. - GitHub issue/PR searches in
MervinPraison/PraisonAIfor exact endpoint/function/class terms. Only one unrelated PR was returned for/api/mcp/connect; no issue/PR matchedapi_mcp_connect,StdioMCPClient,connect_mcp_server, orpraisonaiui.features.mcp. - Broad web searches for exact endpoint, file, class, and function terms returned no matching public vulnerability report.
Why this is distinct from known PraisonAI advisories:
- Not the excluded
praisonai serve agents --api-key/agentsauth bypass. This report targetsPOST /api/mcp/connectin the PraisonAIUI host app. - Not GHSA-9gm9-c8mq-vq7m / CVE-2026-34935 or GHSA-9qhq-v63v-fv3j / CVE-2026-41497. Those involve
MCPHandler.parse_mcp_command()command parsing. This finding usespraisonaiui.server.api_mcp_connect -> praisonaiui.features.mcp.connect_mcp_server -> StdioMCPClient. - Not GHSA-pj2r-f9mw-vrcq / CVE-2026-40159. That advisory concerns sensitive environment variables inherited by untrusted MCP subprocesses. This finding is unauthenticated network-triggered local process execution.
- Not GHSA-6rmh-7xcm-cpxj or GHSA-8444-4fhq-fxpq. Those concern unauthenticated legacy/generated agent servers. This is a distinct UI route and a distinct sink that starts arbitrary local processes.
- Not GHSA-9cr9-25q5-8prj, GHSA-9mqq-jqxf-grvw, or other MCP server file-read/path-traversal advisories. This path is the UI MCP client connector, not PraisonAI's MCP server tool dispatcher.
Recommended Fix
- Remove arbitrary
command/argsfrom the remote HTTP API. MCP stdio servers should be configured only from trusted local configuration, not caller-supplied JSON. - Require authentication and authorization on
/api/mcp/connect,/api/mcp/disconnect/*, and/api/mcp/serversregardless ofAUTH_ENFORCE. - Change UI command defaults from
0.0.0.0to127.0.0.1, or require an explicit--unsafe-exposestyle flag when binding externally without auth. - If remote MCP registration is a required feature, allow only URL-based transports with SSRF protections, or maintain an administrator-configured allowlist of commands.
- Add regression tests that unauthenticated requests to
/api/mcp/connectcannot start a subprocess, including whenAUTH_ENFORCEis unset.
Credited to huslayer826.
Questions
- Is PraisonAI 4.6.48 affected by CVE-2026-57124?
Yes, it is the confirmed version. The package data lists 4.6.48 and earlier as vulnerable and 4.6.59 as the fix.
- Does the attacker need credentials?
No. The UI host apps do not require authentication unless
AUTH_ENFORCE=trueor opt-in auth is configured, andpraisonai uilistens on0.0.0.0by default.- Does the failed MCP handshake mean the attack failed?
No. In the PoC the server returned an error status for the connection, but the attacker-chosen process had already started and created the marker file.
- Is it exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog. A proof of concept is in the advisory.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Other MCP servers and tools vulnerabilities
All Other MCP servers and tools entriesCVE-2026-77361
obsidian-tc : Symlink read-ACL scope bypass via lexical path checks
medium4.7Oct 23, 2026CVE-2026-114126
Storybook dev server vulnerable to code injection from the local network
high8.7Oct 22, 2026CVE-2026-113731
djust: Arbitrary absolute-path file read in the find_handlers_for_template MCP tool
low3.3Oct 21, 2026CVE-2026-114125
Storybook: Missing origin validation in Storybook preview allows code injection from malicious websites
critical9.4Oct 21, 2026CVE-2026-111770
MCP TypeScript server SDK: Shared transport or server instances delivered one HTTP client's messages to another
high7.7Oct 20, 2026GHSA-953h-535j-jg2v
agent-router: MCP session resume does not verify the embedded anti-hijacking subject; default Helm seed makes session IDs forgeable
medium6.8Oct 19, 2026
