Summary
PraisonAI contains an authentication bypass in its Call API agent invocation endpoints when a localhost-only disabled-auth mode is configured.
Because the bind host check trusts the client-controlled Host header, a remote attacker can spoof localhost and list or invoke agents without authentication.
Affected context
This vulnerability occurs in PraisonAI deployments that:
- Enable the Call API with PRAISONAI_CALL_AUTH=disabled for ease of local development or integration
- Rely on a localhost-only binding safeguard to prevent remote unauthenticated use
- Run behind HTTP infrastructure that forwards or preserves the Host header from clients
In these conditions, the service uses request.url.hostname, derived from the Host header, to decide whether unauthenticated requests are allowed, creating a trust gap when exposed over a network.
Exploit preconditions
- Attack surface: HTTP endpoints for the Call API:
- GET /api/v1/agents
- POST /api/v1/agents/{agent_id}/invoke
- Required access: Network reachability to the PraisonAI service (e.g., over LAN, VPN, or internet), with PRAISONAI_CALL_AUTH=disabled configured.
- Trigger point: Sending requests with a spoofed
Host: 127.0.0.1(or equivalent localhost value) header to the affected endpoints. - Why exploitation is possible: The localhost-only restriction is enforced by reading request.url.hostname, which is populated from the client-controlled Host header rather than from the actual server bind address or connection context. This allows remote clients to masquerade as localhost and bypass authentication checks.
Why this happens
The underlying issue is an authentication decision based on untrusted request metadata, mapping to CWE-287 (Improper Authentication).
Instead of binding the disabled-auth mode to a trusted property of the server or connection (such as the listening interface or source address), the implementation derives the bind host from request.url.hostname, which is influenced by the HTTP Host header supplied by the client.
This design treats the Host header as a reliable indicator of locality, conflating routing information with security guarantees and enabling remote clients to claim localhost status and skip authentication.
Potential impact
- Remote, unauthenticated listing of all registered agents and their identifiers
- Unauthenticated invocation of agents, potentially triggering sensitive workflows or data access
- Abuse of agents to perform unintended actions, such as calling external APIs, processing private content, or modifying connected systems
- Facilitation of lateral movement if agents can reach internal services or privileged resources
- Expanded blast radius in multi-tenant or shared environments where agents encapsulate distinct users or projects
General mitigation guidance
Effective mitigation centers on decoupling authentication decisions from client-controlled headers and enforcing secure defaults:
- Avoid using request.url.hostname, Host, or similar client-provided values as trust anchors for deciding whether authentication can be skipped.
- If a localhost-only mode is needed, tie it to server configuration (explicit bind addresses) or verified connection properties (e.g., source IP checked against a trusted local range).
- Prefer enabling authentication consistently, even for local development, using lightweight tokens or API keys rather than full opt-out modes.
- Limit exposure of the Call API endpoints with network-layer controls, ensuring they are not reachable from untrusted networks when authentication is disabled.
- Apply least-privilege to agents and their actions so that any unintended invocation has constrained impact.
How teams detect issues like this
Detection can focus on both code-level patterns and runtime signals:
- Static analysis / code review:
- Flag authentication or authorization logic that relies on request headers such as Host, X-Forwarded-For, or other client-controlled values to determine trust level.
- Review configuration switches (e.g., auth-disable flags) to ensure they are guarded by environment constraints, not by request metadata.
- Look for special-case "localhost-only" bypasses and confirm they use robust checks (e.g., server configuration or socket properties).
- Runtime monitoring:
- Log all unauthenticated access to agent listing and invocation endpoints, including Host headers and source IPs, to spot anomalous usage.
- Implement alerting on unexpected remote access patterns to endpoints that are assumed to be local-only.
- Policy enforcement:
- Use automated security review tools or CI checks that highlight unsafe trust decisions and weak authentication gating.
- Enforce deployment policies that prohibit disabling authentication on services reachable from untrusted networks.

