Summary
PraisonAI's code generator produces a Flask API server that exposes LLM orchestration endpoints over 0.0.0.0 with authentication disabled by default.
When users follow the quickstart instructions, the generated /chat and /agents endpoints accept arbitrary JSON, run praisonai.run() using in-process API key materials, and do not enforce any access control.
Affected context
This vulnerability affects PraisonAI deployments created via the documented quickstart flow (praisonai deploy --type api) where the generated Flask server:
- Binds to
0.0.0.0(network-accessible from other hosts), - Exposes
/chatand/agentsendpoints, - Uses
praisonai.run()on user-supplied JSON, - Inherits API keys and related secrets from the process environment.
In these configurations, authentication is disabled by default unless consciously turned on via APIConfig(auth_enabled=True, auth_token=...), making internet-exposed instances particularly risky.
Exploit preconditions
- Attack surface: Network-accessible Flask API server generated by PraisonAI.
- Required access: Ability to reach the host and port where the server listens (commonly over the public internet when bound to
0.0.0.0). - Trigger point: Sending HTTP requests to
/chator/agentswith crafted JSON payloads. - Why exploitation is possible: The generated server does not enforce authentication or authorization by default (CWE-306), and the configuration defaults leave
auth_enabled=False, resulting in unrestricted remote invocation of LLM orchestration flows and use of embedded credentials (CWE-1188: Insecure Default Initialization).
Why this happens
The underlying bug class is missing enforcement of authentication and authorization controls in a network-exposed service, compounded by insecure default configuration. The API generator's template initializes APIConfig with auth_enabled=False, emitting a Flask app that listens on 0.0.0.0 and exposes powerful orchestration endpoints without any access control.
This maps to CWE-306 (Missing Authentication for Critical Function) because the /chat and /agents endpoints perform privileged actions—invoking LLM workflows using environment-based API keys—but are callable by any remote party. It also aligns with CWE-1188 (Insecure Default Initialization of Resource) as the default configuration is unsafe and requires explicit, opt-in changes to enable authentication.
Potential impact
- Unauthenticated users may remotely drive LLM multi-agent workflows using the deployment's API keys.
- Attackers could exfiltrate or indirectly abuse sensitive model API keys and other environment-based secrets.
- Generated agents can be manipulated to perform unwanted actions, such as data extraction or integration abuse in connected systems.
- The service may be consumed for large volumes of requests, causing cost inflation, resource exhaustion, or denial-of-service conditions.
- Downstream systems integrated with PraisonAI agents could be misconfigured, probed, or receive malicious instructions via orchestrated prompts.
General mitigation guidance
Effective mitigation focuses on establishing secure defaults and enforcing access control at the API boundary. Recommended patterns include:
- Treat any generated API server as an internet-facing service and require authentication for all sensitive endpoints.
- Configure
APIConfigor equivalent constructs to enable access control by default, using strong, rotated tokens or integrating with existing identity providers. - Avoid binding to
0.0.0.0unless protected behind API gateways, firewalls, or reverse proxies that enforce authentication and rate limits. - Minimize the exposure of secrets in process environments; use restricted execution roles and scoped credentials to reduce blast radius.
- Implement least-privilege for agents and workflows so that even authenticated requests cannot arbitrarily access all backend systems.
How teams detect issues like this
Organizations can identify this class of issues through a combination of configuration review and application security checks:
- Inspect generated code templates for authentication and authorization guards on
/chat,/agents, and similar endpoints. - Use static analysis and policy-as-code to flag API servers that bind to
0.0.0.0without access control middleware or token validation logic. - Incorporate security-focused code review steps in CI/CD to ensure that any scaffolding or generators produce secure-by-default configurations.
- Monitor runtime logs and network telemetry for unusual unauthenticated traffic patterns or high-volume usage from unknown sources.
- Leverage automated tools that scan for insecure default settings, missing auth decorators, or public-facing endpoints handling sensitive operations.

