Summary
PraisonAI Serve exposes agent execution endpoints without enforcing the configured bearer-token or X-API-Key requirements. An attacker who can reach these POST endpoints may invoke agents without valid authentication, potentially causing unauthorized actions or resource use.
Affected context
The issue occurs in PraisonAI deployments that expose the serve agents application and use the affected implementation of _create_agents_app(). Although the service parses an API key from configuration, the POST routes for /agents and /agents/{agent_name} may process requests without verifying bearer or X-API-Key credentials.
Exploit preconditions
- Attack surface: Network-accessible PraisonAI Serve HTTP endpoints
- Required access: Connectivity to the agent execution service; valid credentials may not be required
- Trigger point: POST requests to
/agentsor/agents/{agent_name} - Why exploitation is possible: The application reads configured authentication values but does not consistently enforce them before dispatching requests to agent execution
Why this happens
The vulnerability results from an authentication enforcement gap in the web application layer. Configuration values for bearer or API-key authentication are parsed, but the affected POST handlers do not reliably validate incoming credentials before allowing agent execution. This behavior maps to CWE-306: Missing Authentication for Critical Function, because a security-sensitive operation is reachable without the intended authentication check.
Potential impact
- Unauthorized users may invoke configured agents
- Attackers could consume compute, model, or other connected resources
- Agent workflows may perform unintended actions using the service's permissions
- Sensitive information could be exposed through agent responses or downstream integrations
- The service could be abused as an authenticated internal component
General mitigation guidance
Mitigation generally focuses on enforcing authentication at every route that can initiate agent execution and making denial the secure default.
Common defensive patterns include:
- Apply centralized authentication middleware to both collection and named-agent POST routes
- Reject missing, malformed, or invalid bearer and API-key credentials before request dispatch
- Avoid relying solely on parsed configuration values without binding them to route authorization
- Reduce the permissions and network reach of the service and its agents
- Use explicit authorization policies to limit which callers can invoke particular agents
- Protect secrets through managed secret storage and prevent them from being exposed in logs or responses
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and route audits that identify sensitive handlers lacking authentication middleware
- Code review checks comparing authentication configuration with actual enforcement on every execution endpoint
- Integration tests covering missing, invalid, and valid bearer and API-key credentials
- API gateway or service-mesh policies requiring authentication before requests reach agent routes
- Monitoring for unauthenticated POST requests, unexpected agent invocations, and abnormal execution volume
Automated security review tools may help identify routes that perform privileged actions without consistent access-control checks.

