{"id":"CVE-2026-57128","aliases":["CVE-2026-57128","GHSA-35w5-pcw4-jx94","PYSEC-2026-3528"],"related":[],"kind":"vulnerability","state":"published","title":"PraisonAI: Unauthenticated Event Injection via SSE `/publish` Endpoint","summary":"PraisonAI is a multi-agent teams system. Prior to praisonaiagents 1.6.58, the SSE server in src/praisonai-agents/praisonaiagents/server/server.py does not consult ServerConfig.auth_token before handling /publish, /events, or /info requests. A network client that can reach the server can broadcast arbitrary events to connected clients and obtain server configuration and client-count information. This issue is fixed in praisonaiagents 1.6.58.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"PraisonAI is a multi-agent teams system. Prior to praisonaiagents 1.6.58, the SSE server in src/praisonai-agents/praisonaiagents/server/server.py does not consult ServerConfig.auth_token before handling /publish, /events, or /info requests. A network client that can reach the server can broadcast arbitrary events to connected clients and obtain server configuration and client-count information. This issue is fixed in praisonaiagents 1.6.58.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe SSE (Server-Sent Events) server in `src/praisonai-agents/praisonaiagents/server/server.py` exposes a `/publish` endpoint that broadcasts arbitrary messages to all connected clients without any authentication. The `ServerConfig` dataclass (line 24) defines an `auth_token` field, but this token is never validated in the `/publish` or `/events` request handlers. Any attacker with access to the SSE server port can inject arbitrary events into the SSE stream visible to all connected clients, or use `/info` to leak server configuration including connected client count.\n\n## Details\n\n**Vulnerable code (lines 164–180):**\n```python\nasync def publish(request):\n    try:\n        data = await request.json()\n        event_type = data.get(\"type\", \"message\")\n        event_data = data.get(\"data\", {})\n\n        self.broadcast(event_type, event_data)\n\n        return JSONResponse({\n            \"success\": True,\n            \"clients\": len(self._clients),\n        })\n```\n\nThe `auth_token` field in `ServerConfig` (line 31):\n```python\n@dataclass\nclass ServerConfig:\n    ...\n    auth_token: Optional[str] = None\n```\n\nThis `auth_token` is **never referenced** in any request handler. The `/publish` endpoint processes any POST request regardless of authentication headers. The `/info` endpoint (line 182) also has no auth and returns server configuration including `self.config.to_dict()`.\n\n**Routes registration (lines 190–194):**\n```python\nroutes = [\n    Route(\"/health\", health, methods=[\"GET\"]),\n    Route(\"/events\", events, methods=[\"GET\"]),\n    Route(\"/publish\", publish, methods=[\"POST\"]),\n    Route(\"/info\", info, methods=[\"GET\"]),\n]\n```\n\nNo authentication middleware or token validation is applied to any route.\n\n## PoC\n\n**Setup:** Start the SSE server (default port 8765). This is the documented server mode for streaming agent events.\n\n**Positive trigger — unauthenticated event injection:**\n```bash\n# From any network-reachable host:\ncurl -X POST http://localhost:8765/publish \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"type\": \"message\", \"data\": {\"text\": \"INJECTED: arbitrary content sent to all clients\"}}'\n```\n\n**Expected response:**\n```json\n{\"success\": true, \"clients\": 3}\n```\n\nThe response confirms the injection was broadcast to all connected SSE clients, and leaks the number of connected clients.\n\n**Positive trigger — info leak:**\n```bash\ncurl http://localhost:8765/info\n```\n\n**Expected response:**\n```json\n{\n  \"name\": \"PraisonAI Agent Server\",\n  \"version\": \"1.0.0\",\n  \"clients\": 3,\n  \"config\": {\n    \"host\": \"127.0.0.1\",\n    \"port\": 8765,\n    \"auth_token\": \"***\",\n    ...\n  }\n}\n```\n\n**Negative control — if auth were enforced:**\nA request without a valid `Authorization: Bearer <token>` header should return 401 Unauthorized. Currently, it returns 200 OK with no auth check.\n\n**Cleanup:** No persistent changes.\n\n## Impact\n\nAn attacker with access to the SSE server port (default 8765, bound to `127.0.0.1` by default per `DEFAULT_HOST` at line 21) can:\n\n- **Inject arbitrary events** into the SSE stream, potentially causing connected client applications to process malicious data, trigger actions, or display misleading content\n- **Leak server configuration** including number of connected clients and server settings via `/info`\n- **Use the response** to confirm connected client count, enabling reconnaissance\n\nWhile the default binds to localhost, deployments in containers or cloud environments commonly override the host to `0.0.0.0` to allow external access. When the host is overridden, this is exploitable from the network without authentication.\n\n## Suggested remediation\n\n1. **Validate `auth_token`** in the `/publish` and `/events` handlers:\n```python\nasync def publish(request):\n    token = request.headers.get(\"Authorization\", \"\").replace(\"Bearer \", \"\")\n    if self.config.auth_token and token != self.config.auth_token:\n        return JSONResponse({\"error\": \"Unauthorized\"}, status_code=401)\n    # ... proceed with broadcast\n```\n\n2. Apply the same token validation to `/events` (for reading) and `/info`.\n\n3. The default binding to `127.0.0.1` is appropriate; maintain this default and warn when overridden to `0.0.0.0`.\n\n4. Document the `auth_token` configuration option and recommend setting it in production.","format":"markdown","source":"ghsa"}],"published":"2026-06-18T13:52:13.000Z","modified":"2026-09-16T13:42:48.797Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-306"],"affected":[{"ranges":[{"version":"< 1.6.58","status":"affected"}],"vendor":"MervinPraison","product":"PraisonAI","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.6.59"}],"ecosystem":"PyPI","package":"praisonaiagents","purl":"pkg:pypi/praisonaiagents","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.6.59"}],"ecosystem":"PyPI","package":"praisonaiagents","purl":"pkg:pypi/praisonaiagents","source":"pysec"}],"references":[{"url":"https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-35w5-pcw4-jx94","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/MervinPraison/PraisonAI/commit/2f9677abb2ea68eab864ee8b6a828fd0141612e1","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/MervinPraison/PraisonAI/releases/tag/v4.6.58","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/MervinPraison/PraisonAI","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/praisonaiagents","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-35w5-pcw4-jx94","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-57128","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-09-14T15:27:09.327Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-57128","url":"https://www.cve.org/CVERecord?id=CVE-2026-57128","licence":"CVE Terms of Use","modified":"2026-09-14T15:28:17.612Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-35w5-pcw4-jx94","url":"https://github.com/advisories/GHSA-35w5-pcw4-jx94","licence":"CC-BY-4.0","modified":"2026-07-23T15:11:42.343Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-57128","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-57128","licence":"Public domain","modified":"2026-09-16T13:42:48.797Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3528","url":"https://osv.dev/vulnerability/PYSEC-2026-3528","licence":"CC-BY-4.0","modified":"2026-07-23T15:00:22.362Z"}],"updatedAt":"2026-11-25T22:59:38.283Z","epss":{"score":0.00161,"percentile":0.05532,"date":"2026-12-01T12:00:22.000Z"}}