AgenticMail: Cross-agent task authorization bypass in AgenticMail APIGHSA-hjwc-26pj-v3pm
GHSA-hjwc-26pj-v3pm is a CWE-639 vulnerability in @agenticmail/api. A fix is available for @agenticmail/api — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-hjwc-26pj-v3pm.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@agenticmail/apinpmDescription
Summary
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.
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.
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @agenticmail/api | all versions | 0.9.64npm install @agenticmail/api@0.9.64 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @agenticmail/api, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @agenticmail/api to 0.9.64 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-hjwc-26pj-v3pm is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Frequently Asked Questions
Is GHSA-hjwc-26pj-v3pm in your dependencies?
Find it across npm, including transitive dependencies.