From dbd7afb412b5e94f934dd6f9b8443db7ec5b4e18 Mon Sep 17 00:00:00 2001 From: Rex Liu Date: Tue, 11 Aug 2026 16:39:25 -0700 Subject: [PATCH] sync ghsa-vmf9-xx9w-86wx details --- .../2026/06/GHSA-vmf9-xx9w-86wx/GHSA-vmf9-xx9w-86wx.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/advisories/github-reviewed/2026/06/GHSA-vmf9-xx9w-86wx/GHSA-vmf9-xx9w-86wx.json b/advisories/github-reviewed/2026/06/GHSA-vmf9-xx9w-86wx/GHSA-vmf9-xx9w-86wx.json index 5b5fc94ffc81..a7f0ffff6cec 100644 --- a/advisories/github-reviewed/2026/06/GHSA-vmf9-xx9w-86wx/GHSA-vmf9-xx9w-86wx.json +++ b/advisories/github-reviewed/2026/06/GHSA-vmf9-xx9w-86wx/GHSA-vmf9-xx9w-86wx.json @@ -6,8 +6,8 @@ "aliases": [ "CVE-2026-57112" ], - "summary": "PraisonAI ToolsMCPServer legacy SSE transport accepts attacker Host/Origin and exposes registered tools", - "details": "# PraisonAI ToolsMCPServer legacy SSE transport accepts attacker Host/Origin and exposes registered tools\n\n## Summary\n\n`praisonaiagents.mcp.ToolsMCPServer.run_sse()` builds a Starlette MCP\nHTTP+SSE server around `mcp.server.sse.SseServerTransport`. The server exposes\n`/sse` and `/messages/`, but it does not validate `Origin`, does not validate\n`Host`, and does not require any authentication.\n\nThis is reachable through supported PraisonAI code paths that wrap configured\nMCP server tools and re-expose them over legacy SSE:\n\n- `praisonai mcp run --transport sse`\n- `praisonai serve mcp --name --transport sse`\n- direct use of `ToolsMCPServer(...).run_sse(...)` or\n `launch_tools_mcp_server(..., transport=\"sse\")`\n\nA malicious website can use DNS rebinding against a local or internal\nPraisonAI SSE MCP server and send requests with attacker-controlled `Host` and\n`Origin` headers. The local PoV binds only to `127.0.0.1`, sends an attacker\n`Host` and `Origin`, lists the registered tool, and invokes it successfully.\n\nThe same attacker `Origin` is rejected by PraisonAI's current Streamable HTTP\ntransport with HTTP 403. The vulnerability is therefore a sibling transport\nguard gap in the legacy SSE wrapper, not intended behavior.\n\n## Affected product\n\n- Repository: `MervinPraison/PraisonAI`\n- Packages:\n - `praisonaiagents`\n - `praisonai`\n- Primary component:\n `src/praisonai-agents/praisonaiagents/mcp/mcp_server.py`\n- CLI wrappers:\n - `src/praisonai/praisonai/cli/commands/mcp.py`\n - `src/praisonai/praisonai/cli/commands/serve.py`\n- Latest verified release/current head:\n - `praisonaiagents 1.6.58`\n - `PraisonAI 4.6.58`\n - repo head `1ad58ca02975ff1398efeda694ea2ab78f20cf3e`\n\nSuggested affected ranges:\n\n- `praisonaiagents >= 0.6.0, <= 1.6.58`\n- `praisonai >= 3.10.0, <= 4.6.58`\n\nNo fixed version is known at submission time.\n\nConfirmed source sweep:\n\n```text\nv3.0.0 ToolsMCPServer.run_sse helper present, no Origin/Host/auth checks\nv3.10.0 praisonai mcp run --transport sse wraps configured tools into helper\nv3.12.3 praisonai serve mcp --name --transport sse wraps configured tools\nv4.0.0 same vulnerable helper and CLI wrapping paths\nv4.4.12 same vulnerable helper and CLI wrapping paths\nv4.5.0 same vulnerable helper and CLI wrapping paths\nv4.5.56 same vulnerable helper and CLI wrapping paths\nv4.5.139 same vulnerable helper and CLI wrapping paths\nv4.6.57 same vulnerable helper and CLI wrapping paths\nv4.6.58 same vulnerable helper and dynamic PoV succeeds\n```\n\n## Impact\n\nIf a PraisonAI user starts a local or internal legacy SSE MCP server with\nregistered tools, an attacker who gets that user to visit a malicious website\ncan use DNS rebinding to interact with the SSE server through the browser. The\nattacker can discover exposed tools and invoke them as the local user.\n\nImpact depends on the configured tools. In realistic PraisonAI MCP deployments,\nregistered tools may access local files, repositories, issue trackers, cloud\nAPIs, internal services, or other automation targets. This can lead to\nconfidentiality, integrity, and availability impact for the resources reachable\nby the exposed tools.\n\nThe PoV is local-only and harmless. It exposes one marker tool that writes a\ncanary string to a temporary directory.\n\n## Root cause\n\nCurrent `ToolsMCPServer.run_sse()` constructs a Starlette app directly:\n\n```python\nsse_path = \"/sse\"\nmessages_path = \"/messages/\"\nsse_transport = SseServerTransport(messages_path)\n\nasync def handle_sse(request: Request):\n async with sse_transport.connect_sse(\n request.scope, request.receive, request._send\n ) as (read_stream, write_stream):\n await mcp._mcp_server.run(\n read_stream,\n write_stream,\n mcp._mcp_server.create_initialization_options()\n )\n\napp = Starlette(\n debug=self._debug,\n routes=[\n Route(sse_path, endpoint=handle_sse),\n Mount(messages_path, app=sse_transport.handle_post_message),\n ]\n)\n\nuvicorn.run(app, host=host, port=port)\n```\n\nThere is no middleware or route-level check for:\n\n- `Origin`\n- `Host`\n- `Authorization`\n- API key\n- allowed origins / allowed hosts\n\nThe configured CLI wrapper exposes this path:\n\n```python\nfrom praisonaiagents.mcp import MCP, ToolsMCPServer\ncmd_string = \" \".join(cmd)\nmcp = MCP(cmd_string, timeout=60, env=server.env or {})\ntools = mcp.get_tools()\nmcp_server = ToolsMCPServer(name=name, tools=tools)\nmcp_server.run_sse(host=host, port=port)\n```\n\nBy contrast, the current Streamable HTTP transport validates `Origin` and\nreturns HTTP 403 for an invalid origin:\n\n```python\norigin = request.headers.get(\"Origin\")\nif not self._validate_origin(origin):\n return JSONResponse(..., status_code=403)\n```\n\n## Local-only PoV\n\nRun from the harness checkout:\n\n```bash\nuv run --with mcp --with starlette --with uvicorn --with httpx --with anyio \\\n python submission-bundle/praisonai-prai-cand-015-mcp-sse-host-origin-bypass/poc/pov_prai_cand_015_sse_mcp_host_origin_bypass.py \\\n --repo-src artifacts/repos/praisonai-v4.6.58/src\n```\n\nObserved current-head result:\n\n```json\n{\n \"candidate\": \"PRAI-CAND-015\",\n \"http_stream_control\": {\n \"attacker_origin\": \"http://attacker.example.test\",\n \"rejects_attacker_origin\": true,\n \"status_code\": 403,\n \"transport\": \"current_http_stream\"\n },\n \"source_checks\": {\n \"has_auth_check\": false,\n \"has_host_check\": false,\n \"has_origin_check\": false,\n \"has_sse_transport\": true,\n \"route_count\": 2\n },\n \"sse_probe\": {\n \"attacker_headers\": {\n \"Host\": \"attacker.example.test:62380\",\n \"Origin\": \"http://attacker.example.test:62380\"\n },\n \"bind_host\": \"127.0.0.1\",\n \"marker_value\": \"executed-from-attacker-origin\",\n \"marker_written\": true,\n \"server_started\": true,\n \"tool_call_content\": [\n \"recorded:executed-from-attacker-origin\"\n ],\n \"tool_call_error\": false,\n \"tool_names\": [\n \"record_marker\"\n ],\n \"vulnerable\": true\n },\n \"vulnerable\": true\n}\n```\n\nThe PoV:\n\n1. imports the current `ToolsMCPServer`;\n2. registers one marker tool;\n3. monkey-patches `uvicorn.run` only to capture the exact Starlette app created\n by `run_sse()`;\n4. starts that app on `127.0.0.1`;\n5. connects to `/sse` with attacker-controlled `Host` and `Origin`;\n6. lists tools and calls the marker tool;\n7. runs a control against PraisonAI's current Streamable HTTP transport and\n confirms the same attacker `Origin` is rejected with HTTP 403.\n\n## Why this is not intended behavior\n\nThis is not only a trust-model disagreement.\n\nPraisonAI's MCP documentation describes Streamable HTTP, WebSocket, and legacy\nSSE as supported MCP transport mechanisms. The same documentation says the MCP\nmodule's security properties include origin validation, authentication headers,\nand secure session IDs. The transport guide also has a dedicated security\nsection for origin validation as DNS rebinding prevention and authentication.\n\nThe official MCP specification warns that HTTP transports need origin\nvalidation to prevent DNS rebinding, should bind locally for local servers, and\nshould implement authentication. It also says that without those protections,\nremote websites can interact with local MCP servers.\n\nThe upstream MCP Python SDK advisory `GHSA-9h52-p55h-vw2f` / `CVE-2025-66416`\nclassifies unauthenticated localhost HTTP/SSE MCP servers without DNS rebinding\nprotection as a High severity issue because malicious websites can invoke tools\nor access resources exposed by the local MCP server. That advisory also says\ncustom low-level `SseServerTransport` configurations should explicitly configure\ntransport security settings when running unauthenticated localhost servers.\n\nPraisonAI's current Streamable HTTP implementation already enforces an Origin\nguard and rejects the exact attacker Origin used in the PoV. The issue is that\nthe legacy SSE sibling path lacks the same boundary.\n\n\n## Suggested severity\n\nSuggested severity: High.\n\nRationale:\n\n- `AV`: the attack uses browser-origin HTTP requests to a local/internal\n service.\n- `AC`: practical exploitation requires DNS rebinding or equivalent browser\n origin setup.\n- `PR`: no PraisonAI credentials are required by the SSE server.\n- `UR`: the user must visit an attacker-controlled page.\n- `S`: the vulnerable transport exposes tools that operate on resources\n outside the HTTP transport itself.\n- `C/I/A`: exposed tools may read, mutate, or disrupt local/internal\n resources depending on the configured MCP server.\n\n## Suggested fix\n\nBring legacy SSE server security in line with the current Streamable HTTP\ntransport, or disable the legacy SSE server path.\n\nRecommended changes:\n\n1. Add explicit allowed-origin and allowed-host validation to both `/sse` and\n `/messages/`.\n2. Reject invalid `Origin` with HTTP 403 before opening the SSE stream or\n accepting POST messages.\n3. Validate `Host` for local and internal deployments to mitigate DNS rebinding\n even when browsers omit or vary `Origin`.\n4. Require authentication for all non-stdio MCP HTTP transports, including SSE.\n5. Add `--api-key`, `--allowed-origins`, and `--allowed-hosts` options to\n `praisonai mcp run` and `praisonai serve mcp` when `--transport sse` is used.\n6. Where the installed MCP SDK supports it, configure the SDK transport-security\n settings for low-level `SseServerTransport` usage instead of mounting it\n without Host/Origin protection.\n7. Consider deprecating or disabling `--transport sse` server mode in favor of\n the current Streamable HTTP implementation.\n8. Add regression tests proving that attacker `Host` and `Origin` values are\n rejected on both `/sse` and `/messages/`, and that current Streamable HTTP and\n legacy SSE enforce the same boundary.", + "summary": "ToolsMCPServer Legacy SSE Transport Accepts Attacker Host/Origin and Exposes Registered Tools", + "details": "## Summary\n\n`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.\n\nThis is reachable through supported PraisonAI code paths that wrap configured MCP server tools and re-expose them over legacy SSE:\n\n- `praisonai mcp run --transport sse`\n- `praisonai serve mcp --name --transport sse`\n- direct use of `ToolsMCPServer(...).run_sse(...)` or `launch_tools_mcp_server(..., transport=\"sse\")`\n\nA 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.\n\nThe 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.\n\n## Technical Details\n\nCurrent `ToolsMCPServer.run_sse()` constructs a Starlette app directly:\n\n```python\nsse_path = \"/sse\"\nmessages_path = \"/messages/\"\nsse_transport = SseServerTransport(messages_path)\n\nasync def handle_sse(request: Request):\n async with sse_transport.connect_sse(\n request.scope, request.receive, request._send\n ) as (read_stream, write_stream):\n await mcp._mcp_server.run(\n read_stream,\n write_stream,\n mcp._mcp_server.create_initialization_options()\n )\n\napp = Starlette(\n debug=self._debug,\n routes=[\n Route(sse_path, endpoint=handle_sse),\n Mount(messages_path, app=sse_transport.handle_post_message),\n ]\n)\n\nuvicorn.run(app, host=host, port=port)\n```\n\nThere is no middleware or route-level check for:\n\n- `Origin`\n- `Host`\n- `Authorization`\n- API key\n- allowed origins / allowed hosts\n\nThe configured CLI wrapper exposes this path:\n\n```python\nfrom praisonaiagents.mcp import MCP, ToolsMCPServer\ncmd_string = \" \".join(cmd)\nmcp = MCP(cmd_string, timeout=60, env=server.env or {})\ntools = mcp.get_tools()\nmcp_server = ToolsMCPServer(name=name, tools=tools)\nmcp_server.run_sse(host=host, port=port)\n```\n\nBy contrast, the current Streamable HTTP transport validates `Origin` and returns HTTP 403 for an invalid origin:\n\n```python\norigin = request.headers.get(\"Origin\")\nif not self._validate_origin(origin):\n return JSONResponse(..., status_code=403)\n```\n\n### Why This Is Not Intended Behavior\n\nThis is not only a trust-model disagreement.\n\nPraisonAI'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.\n\nThe 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.\n\nThe 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.\n\nPraisonAI'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.\n\n## PoV\n\nRun from a local reproduction checkout:\n\n```bash\nuv run --with mcp --with starlette --with uvicorn --with httpx --with anyio \\\n python poc/pov_poc.py \\\n --repo-src /path/to/PraisonAI\n```\n\nObserved current-head result:\n\n```json\n{\n \"http_stream_control\": {\n \"attacker_origin\": \"http://attacker.example.test\",\n \"rejects_attacker_origin\": true,\n \"status_code\": 403,\n \"transport\": \"current_http_stream\"\n },\n \"source_checks\": {\n \"has_auth_check\": false,\n \"has_host_check\": false,\n \"has_origin_check\": false,\n \"has_sse_transport\": true,\n \"route_count\": 2\n },\n \"sse_probe\": {\n \"attacker_headers\": {\n \"Host\": \"attacker.example.test:62380\",\n \"Origin\": \"http://attacker.example.test:62380\"\n },\n \"bind_host\": \"127.0.0.1\",\n \"marker_value\": \"executed-from-attacker-origin\",\n \"marker_written\": true,\n \"server_started\": true,\n \"tool_call_content\": [\n \"recorded:executed-from-attacker-origin\"\n ],\n \"tool_call_error\": false,\n \"tool_names\": [\n \"record_marker\"\n ],\n \"vulnerable\": true\n },\n \"vulnerable\": true\n}\n```\n\nThe PoV:\n\n1. imports the current `ToolsMCPServer`;\n2. registers one marker tool;\n3. monkey-patches `uvicorn.run` only to capture the exact Starlette app created by `run_sse()`;\n4. starts that app on `127.0.0.1`;\n5. connects to `/sse` with attacker-controlled `Host` and `Origin`;\n6. lists tools and calls the marker tool;\n7. runs a control against PraisonAI's current Streamable HTTP transport and confirms the same attacker `Origin` is rejected with HTTP 403.\n\n## PoC\n\nThe PoV section above contains the local reproduction command, input, and decisive output.\n\n## Impact\n\nIf 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.\n\nImpact 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.\n\nThe PoV is local-only and harmless. It exposes one marker tool that writes a canary string to a temporary directory.\n\n### Severity\n\nSuggested severity: High.\n\nSuggested CVSS 3.1:\n\n```text\nCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H\n```\n\nScore: 8.3.\n\nRationale:\n\n- `AV:N`: the attack uses browser-origin HTTP requests to a local/internal service.\n- `AC:H`: practical exploitation requires DNS rebinding or equivalent browser origin setup.\n- `PR:N`: no PraisonAI credentials are required by the SSE server.\n- `UI:R`: the user must visit an attacker-controlled page.\n- `S:C`: the vulnerable transport exposes tools that operate on resources outside the HTTP transport itself.\n- `C/I/A:H`: exposed tools may read, mutate, or disrupt local/internal resources depending on the configured MCP server.\n\nSuggested CWEs:\n\n- `CWE-346`: Origin Validation Error\n- `CWE-306`: Missing Authentication for Critical Function\n- `CWE-862`: Missing Authorization\n\n## Suggested Fix\n\nBring legacy SSE server security in line with the current Streamable HTTP transport, or disable the legacy SSE server path.\n\nRecommended changes:\n\n1. Add explicit allowed-origin and allowed-host validation to both `/sse` and `/messages/`.\n2. Reject invalid `Origin` with HTTP 403 before opening the SSE stream or accepting POST messages.\n3. Validate `Host` for local and internal deployments to mitigate DNS rebinding even when browsers omit or vary `Origin`.\n4. Require authentication for all non-stdio MCP HTTP transports, including SSE.\n5. Add `--api-key`, `--allowed-origins`, and `--allowed-hosts` options to `praisonai mcp run` and `praisonai serve mcp` when `--transport sse` is used.\n6. 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.\n7. Consider deprecating or disabling `--transport sse` server mode in favor of the current Streamable HTTP implementation.\n8. 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.\n\n## Affected Package/Versions\n\n- Repository: `MervinPraison/PraisonAI`\n- Packages:\n- `praisonaiagents`\n- `praisonai`\n- Primary component: `src/praisonai-agents/praisonaiagents/mcp/mcp_server.py`\n- CLI wrappers:\n- `src/praisonai/praisonai/cli/commands/mcp.py`\n- `src/praisonai/praisonai/cli/commands/serve.py`\n- Latest verified release/current head:\n- `praisonaiagents 1.6.58`\n- `PraisonAI 4.6.58`\n- repo head `1ad58ca02975ff1398efeda694ea2ab78f20cf3e`\n\nSuggested affected ranges:\n\n- `praisonaiagents >= 0.6.0, <= 1.6.58`\n- `praisonai >= 3.10.0, <= 4.6.58`\n\nNo fixed version is known at submission time.\n\nConfirmed source sweep:\n\n```text\nv3.0.0 ToolsMCPServer.run_sse helper present, no Origin/Host/auth checks\nv3.10.0 praisonai mcp run --transport sse wraps configured tools into helper\nv3.12.3 praisonai serve mcp --name --transport sse wraps configured tools\nv4.0.0 same vulnerable helper and CLI wrapping paths\nv4.4.12 same vulnerable helper and CLI wrapping paths\nv4.5.0 same vulnerable helper and CLI wrapping paths\nv4.5.56 same vulnerable helper and CLI wrapping paths\nv4.5.139 same vulnerable helper and CLI wrapping paths\nv4.6.57 same vulnerable helper and CLI wrapping paths\nv4.6.58 same vulnerable helper and dynamic PoV succeeds\n```\n\n## Advisory History\n\nVisible PraisonAI advisories were checked before this report was prepared.\n\nNearby advisories are distinct:\n\n- `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.\n- `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.\n- `GHSA-wv94-5qcp-6m36`: unbounded session accumulation in MCP HTTP server. This report is a cross-origin/host authorization boundary issue.\n- `GHSA-9cr9-25q5-8prj`: arbitrary file read in MCP CLI tools. This report is transport-level unauthorized access to whichever registered tools are exposed.\n- prior reports: none cover `ToolsMCPServer.run_sse()` or the legacy SSE Host/Origin/Auth guard gap.\n\n## References\n\nhttps://github.com/MervinPraison/PraisonAI/security/policy\n- PraisonAI MCP transport docs: https://docs.praison.ai/docs/mcp/transports\n- PraisonAI MCP tools docs: https://docs.praison.ai/docs/mcp/mcp-tools\n- MCP transport security warning: https://modelcontextprotocol.io/specification/2025-11-25/basic/transports\n- Upstream MCP Python SDK DNS rebinding advisory: https://github.com/advisories/GHSA-9h52-p55h-vw2f\n- Prior PraisonAI HTTP Stream Origin advisory: https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-wj6g-v78p-6fx3\n", "severity": [ { "type": "CVSS_V3", @@ -81,4 +81,4 @@ "github_reviewed_at": "2026-06-18T13:52:40Z", "nvd_published_at": null } -} \ No newline at end of file +}