Summary
AgenticMail: Cross-agent task authorization bypass in AgenticMail API
A low-privileged authenticated AgenticMail agent can enumerate another agent's pending/claimed tasks by supplying the target agent name to GET /api/agenticmail/tasks/pending?assignee=<name>. The returned task objects include the task IDs and payloads. The same task IDs can then be used with the capability-style task mutation endpoints (/tasks/:id/claim, /tasks/:id/result, /tasks/:id/complete, /tasks/:id/fail) to claim, complete, or fail tasks assigned to a different agent.
Because ordinary authenticated agents can discover agent names through GET /api/agenticmail/accounts/directory, the task ID effectively stops being a secret capability. This turns the intended capability model into a cross-agent authorization bypass.
Affected component
Package: @agenticmail/api
Observed version: 0.9.62
Repository: agenticmail/agenticmail
Relevant code paths:
packages/api/src/app.ts:createAuthMiddleware(...)is mounted beforecreateAccountRoutes(...)andcreateTaskRoutes(...), so these routes are reachable by any valid bearer token.packages/api/src/routes/accounts.ts:GET /accounts/directoryis available to any authenticated user and returns agent names.packages/api/src/routes/tasks.ts:GET /tasks/pending?assignee=nameresolves arbitrary agent names and returns that agent's pending/claimed tasks.packages/api/src/routes/tasks.ts:/tasks/:id/claim,/tasks/:id/result,/tasks/:id/complete,/tasks/:id/fail, and/tasks/:iddo not check whether the authenticated caller is the task assignee, assigner, or otherwise authorized for the task.
Local reproduction
I reproduced this locally with a focused Vitest test mounted directly on createTaskRoutes. The test creates two agents, Alice and Bob, and one pending task assigned to Bob. Alice authenticates with her own agent key and performs the following sequence:
GET /api/agenticmail/tasks/pending?assignee=BobwithAuthorization: Bearer ak_alice.- The response is HTTP 200 and includes Bob's task ID and payload:
task-for-bob,{ "task": "secret task intended for Bob" }. - Alice then sends
POST /api/agenticmail/tasks/task-for-bob/completewith her own bearer token and an attacker-controlled result. - The task status becomes
completedand the stored result is controlled by Alice.
The local verification command was:
npm run test --workspace=@agenticmail/api -- task-routes-authz.test.ts
Result:
PASS src/__tests__/task-routes-authz.test.ts (1 test)
Expected behavior
Task listing and task mutation endpoints should enforce an authorization relationship between the authenticated caller and the task. For example:
GET /tasks/pending?assignee=<name>should either be restricted to the current agent, master/admin callers, or an explicit delegated relationship./tasks/:id/claim,/tasks/:id/result,/tasks/:id/complete,/tasks/:id/fail, and/tasks/:idshould verify that the caller is the assignee, assigner, master/admin, or otherwise explicitly authorized.- If capability-based task IDs are retained, the API should not expose those IDs to unrelated agents through the assignee-name listing path.
Credit
Please credit the finder as: Yaohui Wang
Impact
An attacker only needs a valid agent API key. They can:
- List agent names using
/accounts/directory. - Query another agent's task queue using
/tasks/pending?assignee=<victimName>. - Read sensitive task payloads intended for the victim agent.
- Use the disclosed task ID to complete/fail/claim the victim's task or submit attacker-controlled results.
The application does not perform an authorization check before performing a sensitive operation. Typical impact: unauthorized access to restricted functionality or data.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-57494? CVE-2026-57494 is a high-severity missing authorization vulnerability in @agenticmail/api (npm), affecting versions < 0.9.64. It is fixed in 0.9.64. The application does not perform an authorization check before performing a sensitive operation.
- Which versions of @agenticmail/api are affected by CVE-2026-57494? @agenticmail/api (npm) versions < 0.9.64 is affected.
- Is there a fix for CVE-2026-57494? Yes. CVE-2026-57494 is fixed in 0.9.64. Upgrade to this version or later.
- Is CVE-2026-57494 exploitable, and should I be worried? Whether CVE-2026-57494 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-57494 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-57494? Upgrade
@agenticmail/apito 0.9.64 or later.