GHSA-vmf9-xx9w-86wx PraisonAI ToolsMCPServer legacy SSE transport accepts attacker Host/Origin and exposes registered tools
PraisonAI ToolsMCPServer legacy SSE transport accepts attacker Host/Origin and exposes registered toolsSummary`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 local 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.Affected productRepository: `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:ImpactIf 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.Root causeCurrent `ToolsMCPServer.run_sse()` constructs a Starlette app directly:There is no middleware or route-level check for:`Origin``Host``Authorization`API keyallowed origins / allowed hostsThe configured CLI wrapper exposes this path:By contrast, the current Streamable HTTP transport validates `Origin` and
returns HTTP 403 for an invalid origin:Local-only PoVRun from the harness checkout:Observed current-head result: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.Why this is not intended behaviorThis 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.Suggested severitySuggested severity: High.Rationale:`AV`: the attack uses browser-origin HTTP requests to a local/internal
service.`AC`: practical exploitation requires DNS rebinding or equivalent browser
origin setup.`PR`: no PraisonAI credentials are required by the SSE server.`UR`: the user must visit an attacker-controlled page.`S`: the vulnerable transport exposes tools that operate on resources
outside the HTTP transport itself.`C/I/A`: exposed tools may read, mutate, or disrupt local/internal
resources depending on the configured MCP server.Suggested fixBring 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.
CVSS v3.1 score: 8.3