Summary
PraisonAI's legacy Server-Sent Events (SSE) wrapper may expose /sse and /messages/ endpoints without reliable Host, Origin, or authentication enforcement. When a reachable local or internal SSE server is targeted through DNS rebinding, a malicious website may enumerate registered tools and invoke them with the server user's privileges.
Affected context
The issue occurs in deployments using PraisonAI's legacy SSE transport through ToolsMCPServer.run_sse(). Risk is higher when the SSE server is reachable from a user's browser or from internal network locations, and when registered tools can perform sensitive actions under the server process's account. The newer Streamable HTTP transport applies stronger Origin handling, so exposure depends on the legacy SSE wrapper being enabled and accessible.
Exploit preconditions
- Attack surface: Legacy SSE endpoints at
/sseand/messages/ - Required access: Network reachability to the SSE server, potentially through a local or internal service
- Trigger point: A browser-originated request reaches the SSE service after DNS rebinding or equivalent origin-control bypass conditions
- Why exploitation is possible: The legacy wrapper does not consistently require authentication or validate Host and Origin headers before exposing tools and accepting tool-invocation requests
Why this happens
The underlying issue is missing access-control enforcement at a network-facing protocol boundary. The legacy SSE wrapper mounts transport endpoints without secure-by-default authentication and origin validation, allowing requests that should be rejected to reach tool discovery and invocation logic. This maps primarily to CWE-306: Missing Authentication for Critical Function, with related concerns involving CWE-346: Origin Validation Error and CWE-862: Missing Authorization.
Potential impact
- An attacker may enumerate tools exposed by the SSE server
- An attacker could invoke tools with the privileges of the server process
- Sensitive data may be disclosed or modified
- Files, services, or connected infrastructure could be affected
- A compromised tool endpoint can enable lateral movement or broader application abuse
General mitigation guidance
Mitigation generally focuses on removing unauthenticated access to legacy SSE endpoints and enforcing a clear trust boundary before tool discovery or invocation.
Common defensive patterns include:
- Requiring authentication and authorization for every SSE and message request
- Validating Host and Origin values against an explicit allowlist
- Preferring transport implementations with secure-by-default origin and access-control behavior
- Binding administrative or local services only to intended interfaces
- Limiting exposed tools and running the server with least privilege
- Separating browser-accessible services from high-privilege tool execution
- Applying network controls that prevent untrusted browser contexts from reaching internal SSE services
How teams detect issues like this
Organizations can look for this weakness through:
- Static analysis checks for SSE route registration without authentication middleware
- Code review searches for transport wrappers that accept Host or Origin headers without allowlist validation
- Tests that send cross-origin, missing-origin, and unexpected-host requests to every tool endpoint
- Inventory and policy checks identifying locally or internally reachable SSE services
- Runtime logging of tool enumeration, invocation, authentication failures, and unusual Origin values
- Automated security review tools that flag missing authentication and authorization on network-facing routes

