Описание
PraisonAI: Unauthenticated Information Disclosure of Agent Instructions via /api/agents in AgentOS
Summary
The AgentOS deployment platform exposes a GET /api/agents endpoint that returns agent names, roles, and the first 100 characters of agent system instructions to any unauthenticated caller. The AgentOS FastAPI application has no authentication middleware, no API key validation, and defaults to CORS allow_origins=["*"] with host="0.0.0.0", making every deployment network-accessible and queryable from any origin by default.
Details
The AgentOS._register_routes() method at src/praisonai/praisonai/app/agentos.py:118 registers all routes on a plain FastAPI app with no authentication dependencies:
The AgentAppConfig at src/praisonai-agents/praisonaiagents/app/config.py:12-55 has no authentication fields — no api_key, no auth_middleware, no token_secret. The only middleware added is CORS with wildcard origins:
Notably, the older api_server.py:58 includes a check_auth() guard on its /agents endpoint, indicating the project is aware that authentication is required for agent listing endpoints. The newer AgentOS implementation regressed by omitting all authentication.
The truncation to 100 characters is insufficient mitigation — the opening of a system prompt typically contains the most sensitive role definitions and behavioral directives.
PoC
Step 1: List all agents and their instructions (unauthenticated)
Expected output:
Step 2: Extract full instructions via unauthenticated chat endpoint
Step 3: Cross-origin exfiltration (from any website, due to CORS *)
Impact
- Agent instruction disclosure: Any network-reachable attacker can enumerate all deployed agents and read the first 100 characters of their system prompts. System prompts frequently contain proprietary business logic, internal API references, credential hints, and behavioral directives that operators consider confidential.
- Cross-origin exfiltration: Due to CORS
*, any website visited by a user on the same network as the AgentOS deployment can silently query the API and exfiltrate agent configurations. - Full instruction extraction (via chaining): The unauthenticated
/api/chatendpoint allows prompt injection to extract complete system instructions beyond the 100-character truncation. - Reconnaissance for further attacks: Leaked agent names, roles, and instruction fragments reveal the application's architecture, tool configurations, and potential attack surface for more targeted exploitation.
Recommended Fix
Add an optional API key authentication dependency to AgentOS and enable it by default when an API key is configured:
Additionally, the /api/agents endpoint should not return instructions content at all — agent names and roles are sufficient for the listing use case. Instruction content should only be available through a dedicated admin endpoint with stronger auth requirements.
Пакеты
PraisonAI
< 4.5.128
4.5.128
Связанные уязвимости
PraisonAI is a multi-agent teams system. Prior to 4.5.128, the AgentOS deployment platform exposes a GET /api/agents endpoint that returns agent names, roles, and the first 100 characters of agent system instructions to any unauthenticated caller. The AgentOS FastAPI application has no authentication middleware, no API key validation, and defaults to CORS allow_origins=["*"] with host="0.0.0.0", making every deployment network-accessible and queryable from any origin by default. This vulnerability is fixed in 4.5.128.