Описание
PraisonAI serve agents --api-key is ignored, allowing unauthenticated remote agent execution
Summary
PraisonAI's praisonai serve agents command exposes --api-key as the documented
authentication control for production/external deployments, but the configured key is not
enforced on the public agent invocation compatibility endpoints.
An operator can start the server with --api-key and bind it to 0.0.0.0, but any network-
reachable caller can still invoke agents through POST /agents or POST /agents/ {agent_name} without Authorization, X-API-Key, a query token, or any other credential.
Confirmed vulnerable:
- v4.6.48 / commit
d5f1114aaf1a2e9f121a6e66b929149ca2201f1d - v4.6.34 / commit
e5928449f73f66cc8af1de61621aa974ab255133
Likely affected range: >= 4.6.34, <= 4.6.48.
This is distinct from CVE-2026-44338 / GHSA-6rmh-7xcm-cpxj, which covered the legacy Flask
api_server.py path before 4.6.34. This report concerns the newer FastAPI serve agents --api-key code path and is confirmed in v4.6.48.
Details
The CLI accepts and forwards an API key:
src/praisonai/praisonai/cli/commands/serve.py:156definespraisonai serve agentssrc/praisonai/praisonai/cli/commands/serve.py:162exposes--api-keysrc/praisonai/praisonai/cli/commands/serve.py:175-176forwards the supplied keysrc/praisonai/praisonai/cli/features/serve.py:191handles theagentssubcommandsrc/praisonai/praisonai/cli/features/serve.py:199parsesapi_keyinto the config
However, _create_agents_app() never uses config["api_key"] to create middleware or a
FastAPI auth dependency:
src/praisonai/praisonai/cli/features/serve.py:228creates the FastAPI appsrc/praisonai/praisonai/cli/features/serve.py:287registersPOST {path}with no auth dependencysrc/praisonai/praisonai/cli/features/serve.py:346registersPOST /agents/{agent_name}with no auth dependencysrc/praisonai/praisonai/cli/features/serve.py:356-370executes the registered agent directly
The same app also mounts praisonai.api.agent_invoke, whose /api/v1/agents/{agent_id}/ invoke route is protected separately by CALL_SERVER_TOKEN. That means the protected / api/v1 route and the unauthenticated /agents compatibility routes coexist in the same
server. Setting --api-key does not protect the compatibility routes.
PoC
This local-only PoC does not open a network listener and does not call an LLM provider. It
constructs the FastAPI app through the real ServeHandler._create_agents_app() path with
api_key set, registers a fake agent, and sends an unauthenticated request using FastAPI
TestClient.
Пакеты
PraisonAI
>= 4.6.34, < 4.6.58
4.6.58
Связанные уязвимости
PraisonAI is a multi-agent teams system. From praisonai 4.6.34 until 4.6.58, praisonai serve agents accepts --api-key but _create_agents_app() does not authenticate POST /agents or POST /agents/{agent_name}. A network caller can invoke configured agents without credentials even when an API key was supplied. This issue is fixed in version 4.6.58.