Summary
praisonaiagents.mcp.ToolsMCPServer.run_sse() builds a Starlette MCP HTTP+SSE server around mcp.server.sse.SseServerTransport. The server exposes /sse and /messages/, but it does not validate Origin, does not validate Host, and does not require any authentication.
This is reachable through supported PraisonAI code paths that wrap configured MCP server tools and re-expose them over legacy SSE:
praisonai mcp run <name> --transport sse
praisonai serve mcp --name <name> --transport sse
- direct use of
ToolsMCPServer(...).run_sse(...) or launch_tools_mcp_server(..., transport="sse")
A malicious website can use DNS rebinding against a local or internal PraisonAI SSE MCP server and send requests with attacker-controlled Host and Origin headers. the PoV binds only to 127.0.0.1, sends an attacker Host and Origin, lists the registered tool, and invokes it successfully.
The same attacker Origin is rejected by PraisonAI's current Streamable HTTP transport with HTTP 403. The vulnerability is therefore a sibling transport guard gap in the legacy SSE wrapper, not intended behavior.
Technical Details
Current ToolsMCPServer.run_sse() constructs a Starlette app directly:
sse_path = "/sse"
messages_path = "/messages/"
sse_transport = SseServerTransport(messages_path)
async def handle_sse(request: Request):
async with sse_transport.connect_sse(
request.scope, request.receive, request._send
) as (read_stream, write_stream):
await mcp._mcp_server.run(
read_stream,
write_stream,
mcp._mcp_server.create_initialization_options()
)
app = Starlette(
debug=self._debug,
routes=[
Route(sse_path, endpoint=handle_sse),
Mount(messages_path, app=sse_transport.handle_post_message),
]
)
uvicorn.run(app, host=host, port=port)
There is no middleware or route-level check for:
Origin
Host
Authorization
- API key
- allowed origins / allowed hosts
The configured CLI wrapper exposes this path:
from praisonaiagents.mcp import MCP, ToolsMCPServer
cmd_string = " ".join(cmd)
mcp = MCP(cmd_string, timeout=60, env=server.env or {})
tools = mcp.get_tools()
mcp_server = ToolsMCPServer(name=name, tools=tools)
mcp_server.run_sse(host=host, port=port)
By contrast, the current Streamable HTTP transport validates Origin and returns HTTP 403 for an invalid origin:
origin = request.headers.get("Origin")
if not self._validate_origin(origin):
return JSONResponse(..., status_code=403)
Why This Is Not Intended Behavior
This is not only a trust-model disagreement.
PraisonAI's MCP documentation describes Streamable HTTP, WebSocket, and legacy SSE as supported MCP transport mechanisms. The same documentation says the MCP module's security properties include origin validation, authentication headers, and secure session IDs. The transport guide also has a dedicated security section for origin validation as DNS rebinding prevention and authentication.
The official MCP specification warns that HTTP transports need origin validation to prevent DNS rebinding, should bind locally for local servers, and should implement authentication. It also says that without those protections, remote websites can interact with local MCP servers.
The upstream MCP Python SDK advisory GHSA-9h52-p55h-vw2f / CVE-2025-66416 classifies unauthenticated localhost HTTP/SSE MCP servers without DNS rebinding protection as a High severity issue because malicious websites can invoke tools or access resources exposed by the local MCP server. That advisory also says custom low-level SseServerTransport configurations should explicitly configure transport security settings when running unauthenticated localhost servers.
PraisonAI's current Streamable HTTP implementation already enforces an Origin guard and rejects the exact attacker Origin used in the PoV. The issue is that the legacy SSE sibling path lacks the same boundary.
PoV
Run from a local reproduction checkout:
uv run --with mcp --with starlette --with uvicorn --with httpx --with anyio \
python poc/pov_poc.py \
--repo-src /path/to/PraisonAI
Observed current-head result:
{
"http_stream_control": {
"attacker_origin": "http://attacker.example.test",
"rejects_attacker_origin": true,
"status_code": 403,
"transport": "current_http_stream"
},
"source_checks": {
"has_auth_check": false,
"has_host_check": false,
"has_origin_check": false,
"has_sse_transport": true,
"route_count": 2
},
"sse_probe": {
"attacker_headers": {
"Host": "attacker.example.test:62380",
"Origin": "http://attacker.example.test:62380"
},
"bind_host": "127.0.0.1",
"marker_value": "executed-from-attacker-origin",
"marker_written": true,
"server_started": true,
"tool_call_content": [
"recorded:executed-from-attacker-origin"
],
"tool_call_error": false,
"tool_names": [
"record_marker"
],
"vulnerable": true
},
"vulnerable": true
}
The PoV:
- imports the current
ToolsMCPServer;
- registers one marker tool;
- monkey-patches
uvicorn.run only to capture the exact Starlette app created by run_sse();
- starts that app on
127.0.0.1;
- connects to
/sse with attacker-controlled Host and Origin;
- lists tools and calls the marker tool;
- runs a control against PraisonAI's current Streamable HTTP transport and confirms the same attacker
Origin is rejected with HTTP 403.
PoC
The PoV section above contains the local reproduction command, input, and decisive output.
Impact
If a PraisonAI user starts a local or internal legacy SSE MCP server with registered tools, an attacker who gets that user to visit a malicious website can use DNS rebinding to interact with the SSE server through the browser. The attacker can discover exposed tools and invoke them as the local user.
Impact depends on the configured tools. In realistic PraisonAI MCP deployments, registered tools may access local files, repositories, issue trackers, cloud APIs, internal services, or other automation targets. This can lead to confidentiality, integrity, and availability impact for the resources reachable by the exposed tools.
The PoV is local-only and harmless. It exposes one marker tool that writes a canary string to a temporary directory.
Severity
Suggested severity: High.
Suggested CVSS 3.1:
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
Score: 8.3.
Rationale:
AV:N: the attack uses browser-origin HTTP requests to a local/internal service.
AC:H: practical exploitation requires DNS rebinding or equivalent browser origin setup.
PR:N: no PraisonAI credentials are required by the SSE server.
UI:R: the user must visit an attacker-controlled page.
S:C: the vulnerable transport exposes tools that operate on resources outside the HTTP transport itself.
C/I/A:H: exposed tools may read, mutate, or disrupt local/internal resources depending on the configured MCP server.
Suggested CWEs:
CWE-346: Origin Validation Error
CWE-306: Missing Authentication for Critical Function
CWE-862: Missing Authorization
Suggested Fix
Bring legacy SSE server security in line with the current Streamable HTTP transport, or disable the legacy SSE server path.
Recommended changes:
- Add explicit allowed-origin and allowed-host validation to both
/sse and /messages/.
- Reject invalid
Origin with HTTP 403 before opening the SSE stream or accepting POST messages.
- Validate
Host for local and internal deployments to mitigate DNS rebinding even when browsers omit or vary Origin.
- Require authentication for all non-stdio MCP HTTP transports, including SSE.
- Add
--api-key, --allowed-origins, and --allowed-hosts options to praisonai mcp run and praisonai serve mcp when --transport sse is used.
- Where the installed MCP SDK supports it, configure the SDK transport-security settings for low-level
SseServerTransport usage instead of mounting it without Host/Origin protection.
- Consider deprecating or disabling
--transport sse server mode in favor of the current Streamable HTTP implementation.
- Add regression tests proving that attacker
Host and Origin values are rejected on both /sse and /messages/, and that current Streamable HTTP and legacy SSE enforce the same boundary.
Affected Package/Versions
- Repository:
MervinPraison/PraisonAI
- Packages:
praisonaiagents
praisonai
- Primary component:
src/praisonai-agents/praisonaiagents/mcp/mcp_server.py
- CLI wrappers:
src/praisonai/praisonai/cli/commands/mcp.py
src/praisonai/praisonai/cli/commands/serve.py
- Latest verified release/current head:
praisonaiagents 1.6.58
PraisonAI 4.6.58
- repo head
1ad58ca02975ff1398efeda694ea2ab78f20cf3e
Suggested affected ranges:
praisonaiagents >= 0.6.0, <= 1.6.58
praisonai >= 3.10.0, <= 4.6.58
No fixed version is known at submission time.
Confirmed source sweep:
v3.0.0 ToolsMCPServer.run_sse helper present, no Origin/Host/auth checks
v3.10.0 praisonai mcp run --transport sse wraps configured tools into helper
v3.12.3 praisonai serve mcp --name --transport sse wraps configured tools
v4.0.0 same vulnerable helper and CLI wrapping paths
v4.4.12 same vulnerable helper and CLI wrapping paths
v4.5.0 same vulnerable helper and CLI wrapping paths
v4.5.56 same vulnerable helper and CLI wrapping paths
v4.5.139 same vulnerable helper and CLI wrapping paths
v4.6.57 same vulnerable helper and CLI wrapping paths
v4.6.58 same vulnerable helper and dynamic PoV succeeds
Advisory History
Visible PraisonAI advisories were checked before this report was prepared.
Nearby advisories are distinct:
GHSA-wj6g-v78p-6fx3: Origin validation bypass in the MCP HTTP Stream transport. This report targets the legacy SSE ToolsMCPServer.run_sse() path, which has no Origin/Host/auth guard at all.
GHSA-pvph-5j39-v8qc: prefix-match origin validation bypass in the PraisonAI MCP HTTP server. This report is not a bypass of a weak validation function; the SSE wrapper never invokes validation.
GHSA-wv94-5qcp-6m36: unbounded session accumulation in MCP HTTP server. This report is a cross-origin/host authorization boundary issue.
GHSA-9cr9-25q5-8prj: arbitrary file read in MCP CLI tools. This report is transport-level unauthorized access to whichever registered tools are exposed.
- prior reports: none cover
ToolsMCPServer.run_sse() or the legacy SSE Host/Origin/Auth guard gap.
References
https://github.com/MervinPraison/PraisonAI/security/policy
Summary
praisonaiagents.mcp.ToolsMCPServer.run_sse()builds a Starlette MCP HTTP+SSE server aroundmcp.server.sse.SseServerTransport. The server exposes/sseand/messages/, but it does not validateOrigin, does not validateHost, and does not require any authentication.This is reachable through supported PraisonAI code paths that wrap configured MCP server tools and re-expose them over legacy SSE:
praisonai mcp run <name> --transport ssepraisonai serve mcp --name <name> --transport sseToolsMCPServer(...).run_sse(...)orlaunch_tools_mcp_server(..., transport="sse")A malicious website can use DNS rebinding against a local or internal PraisonAI SSE MCP server and send requests with attacker-controlled
HostandOriginheaders. the PoV binds only to127.0.0.1, sends an attackerHostandOrigin, lists the registered tool, and invokes it successfully.The same attacker
Originis rejected by PraisonAI's current Streamable HTTP transport with HTTP 403. The vulnerability is therefore a sibling transport guard gap in the legacy SSE wrapper, not intended behavior.Technical Details
Current
ToolsMCPServer.run_sse()constructs a Starlette app directly:There is no middleware or route-level check for:
OriginHostAuthorizationThe configured CLI wrapper exposes this path:
By contrast, the current Streamable HTTP transport validates
Originand returns HTTP 403 for an invalid origin:Why This Is Not Intended Behavior
This is not only a trust-model disagreement.
PraisonAI's MCP documentation describes Streamable HTTP, WebSocket, and legacy SSE as supported MCP transport mechanisms. The same documentation says the MCP module's security properties include origin validation, authentication headers, and secure session IDs. The transport guide also has a dedicated security section for origin validation as DNS rebinding prevention and authentication.
The official MCP specification warns that HTTP transports need origin validation to prevent DNS rebinding, should bind locally for local servers, and should implement authentication. It also says that without those protections, remote websites can interact with local MCP servers.
The upstream MCP Python SDK advisory
GHSA-9h52-p55h-vw2f/CVE-2025-66416classifies unauthenticated localhost HTTP/SSE MCP servers without DNS rebinding protection as a High severity issue because malicious websites can invoke tools or access resources exposed by the local MCP server. That advisory also says custom low-levelSseServerTransportconfigurations should explicitly configure transport security settings when running unauthenticated localhost servers.PraisonAI's current Streamable HTTP implementation already enforces an Origin guard and rejects the exact attacker Origin used in the PoV. The issue is that the legacy SSE sibling path lacks the same boundary.
PoV
Run from a local reproduction checkout:
Observed current-head result:
{ "http_stream_control": { "attacker_origin": "http://attacker.example.test", "rejects_attacker_origin": true, "status_code": 403, "transport": "current_http_stream" }, "source_checks": { "has_auth_check": false, "has_host_check": false, "has_origin_check": false, "has_sse_transport": true, "route_count": 2 }, "sse_probe": { "attacker_headers": { "Host": "attacker.example.test:62380", "Origin": "http://attacker.example.test:62380" }, "bind_host": "127.0.0.1", "marker_value": "executed-from-attacker-origin", "marker_written": true, "server_started": true, "tool_call_content": [ "recorded:executed-from-attacker-origin" ], "tool_call_error": false, "tool_names": [ "record_marker" ], "vulnerable": true }, "vulnerable": true }The PoV:
ToolsMCPServer;uvicorn.runonly to capture the exact Starlette app created byrun_sse();127.0.0.1;/ssewith attacker-controlledHostandOrigin;Originis rejected with HTTP 403.PoC
The PoV section above contains the local reproduction command, input, and decisive output.
Impact
If a PraisonAI user starts a local or internal legacy SSE MCP server with registered tools, an attacker who gets that user to visit a malicious website can use DNS rebinding to interact with the SSE server through the browser. The attacker can discover exposed tools and invoke them as the local user.
Impact depends on the configured tools. In realistic PraisonAI MCP deployments, registered tools may access local files, repositories, issue trackers, cloud APIs, internal services, or other automation targets. This can lead to confidentiality, integrity, and availability impact for the resources reachable by the exposed tools.
The PoV is local-only and harmless. It exposes one marker tool that writes a canary string to a temporary directory.
Severity
Suggested severity: High.
Suggested CVSS 3.1:
Score: 8.3.
Rationale:
AV:N: the attack uses browser-origin HTTP requests to a local/internal service.AC:H: practical exploitation requires DNS rebinding or equivalent browser origin setup.PR:N: no PraisonAI credentials are required by the SSE server.UI:R: the user must visit an attacker-controlled page.S:C: the vulnerable transport exposes tools that operate on resources outside the HTTP transport itself.C/I/A:H: exposed tools may read, mutate, or disrupt local/internal resources depending on the configured MCP server.Suggested CWEs:
CWE-346: Origin Validation ErrorCWE-306: Missing Authentication for Critical FunctionCWE-862: Missing AuthorizationSuggested Fix
Bring legacy SSE server security in line with the current Streamable HTTP transport, or disable the legacy SSE server path.
Recommended changes:
/sseand/messages/.Originwith HTTP 403 before opening the SSE stream or accepting POST messages.Hostfor local and internal deployments to mitigate DNS rebinding even when browsers omit or varyOrigin.--api-key,--allowed-origins, and--allowed-hostsoptions topraisonai mcp runandpraisonai serve mcpwhen--transport sseis used.SseServerTransportusage instead of mounting it without Host/Origin protection.--transport sseserver mode in favor of the current Streamable HTTP implementation.HostandOriginvalues are rejected on both/sseand/messages/, and that current Streamable HTTP and legacy SSE enforce the same boundary.Affected Package/Versions
MervinPraison/PraisonAIpraisonaiagentspraisonaisrc/praisonai-agents/praisonaiagents/mcp/mcp_server.pysrc/praisonai/praisonai/cli/commands/mcp.pysrc/praisonai/praisonai/cli/commands/serve.pypraisonaiagents 1.6.58PraisonAI 4.6.581ad58ca02975ff1398efeda694ea2ab78f20cf3eSuggested affected ranges:
praisonaiagents >= 0.6.0, <= 1.6.58praisonai >= 3.10.0, <= 4.6.58No fixed version is known at submission time.
Confirmed source sweep:
Advisory History
Visible PraisonAI advisories were checked before this report was prepared.
Nearby advisories are distinct:
GHSA-wj6g-v78p-6fx3: Origin validation bypass in the MCP HTTP Stream transport. This report targets the legacy SSEToolsMCPServer.run_sse()path, which has no Origin/Host/auth guard at all.GHSA-pvph-5j39-v8qc: prefix-match origin validation bypass in the PraisonAI MCP HTTP server. This report is not a bypass of a weak validation function; the SSE wrapper never invokes validation.GHSA-wv94-5qcp-6m36: unbounded session accumulation in MCP HTTP server. This report is a cross-origin/host authorization boundary issue.GHSA-9cr9-25q5-8prj: arbitrary file read in MCP CLI tools. This report is transport-level unauthorized access to whichever registered tools are exposed.ToolsMCPServer.run_sse()or the legacy SSE Host/Origin/Auth guard gap.References
https://github.com/MervinPraison/PraisonAI/security/policy