Vulnerabilities in pkg:npm/@agenticmail/api

PACKAGE
Advisory Identifier: GHSA-hjwc-26pj-v3pm
Advisory Summary

CVE-2026-57494 is a HIGH cross-agent task authorization bypass vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting AgenticMail libraries in the npm ecosystem. The issue involves cross-agent task authorization bypass in agenticmail api. Remediation is available by upgrading affected packages to version 0.9.64.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@agenticmail/api

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@agenticmail/api. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hjwc-26pj-v3pm CVE-2026-57494 HIGH AgenticMail: Cross-agent task authorization bypass in AgenticMail API
GHSA-wjjv-3mj2-39hf CVE-2026-47255 HIGH AgenticMail API/storage and outbound relay hardening fixes

CVE-2026-57494 at a Glance

CVE Identifier CVE-2026-57494
GHSA Identifier GHSA-hjwc-26pj-v3pm
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product AgenticMail
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-57494

To remediate this vulnerability, upgrade all affected AgenticMail dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@agenticmail/api fixed: 0.9.64
npm install @agenticmail/api@0.9.64
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @agenticmail/api

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-57494, inspect your project dependencies using npm:

npm ls @agenticmail/api

Analyze the terminal output to locate any version of AgenticMail in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.64), your application is affected.

Note: The npm ls @agenticmail/api command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. In AgenticMail, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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 before `createAccountRoutes(...)` and `createTaskRoutes(...)`, so these routes are reachable by any valid bearer token. - `packages/api/src/routes/accounts.ts`: `GET /accounts/directory` is available to any authenticated user and returns agent names. - `packages/api/src/routes/tasks.ts`: `GET /tasks/pending?assignee=name` resolves 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/:id` do 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: 1. List agent names using `/accounts/directory`. 2. Query another agent's task queue using `/tasks/pending?assignee=<victimName>`. 3. Read sensitive task payloads intended for the victim agent. 4. 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: 1. `GET /api/agenticmail/tasks/pending?assignee=Bob` with `Authorization: Bearer ak_alice`. 2. The response is HTTP 200 and includes Bob's task ID and payload: `task-for-bob`, `{ "task": "secret task intended for Bob" }`. 3. Alice then sends `POST /api/agenticmail/tasks/task-for-bob/complete` with her own bearer token and an attacker-controlled result. 4. The task status becomes `completed` and the stored result is controlled by Alice. The local verification command was: ```bash npm run test --workspace=@agenticmail/api -- task-routes-authz.test.ts ``` Result: ```text 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/:id` should 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

CVE-2026-57494 Affected AgenticMail Versions

1 component(s)
Fixed Versions:
0.9.64
Product / Package Ecosystem Affected Versions Fixed Version
@agenticmail/api
npm
< 0.9.64
0.9.64

References

Frequently Asked Questions

What is CVE-2026-57494?
CVE-2026-57494 is a security vulnerability in AgenticMail involving Cross-agent task authorization bypass in AgenticMail API under CWE-639: Authorization Bypass Through User-Controlled Key.
Which AgenticMail versions are affected?
Affected versions include releases prior to 0.9.64 across affected packages: @agenticmail/api.
What version fixes CVE-2026-57494?
Upgrading to 0.9.64 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @agenticmail/api affected?
Yes, @agenticmail/api is affected in releases prior to 0.9.64. Upgrade your dependency to 0.9.64 or later.
What CWE is associated with CVE-2026-57494?
CVE-2026-57494 is classified under CWE-639: Authorization Bypass Through User-Controlled Key (The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.).
How can I check npm dependencies for CVE-2026-57494?
Run the dependency tree command: 'npm ls @agenticmail/api'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hjwc-26pj-v3pm",
  "modified" : "2026-07-20T22:00:53Z",
  "published" : "2026-06-18T17:20:55Z",
  "aliases" : [ "CVE-2026-57494" ],
  "summary" : "AgenticMail: Cross-agent task authorization bypass in AgenticMail API",
  "details" : "## Summary\n\nA 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.\n\nBecause 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.\n\n## Affected component\n\nPackage: `@agenticmail/api`\nObserved version: `0.9.62`\nRepository: `agenticmail/agenticmail`\n\nRelevant code paths:\n\n- `packages/api/src/app.ts`: `createAuthMiddleware(...)` is mounted before `createAccountRoutes(...)` and `createTaskRoutes(...)`, so these routes are reachable by any valid bearer token.\n- `packages/api/src/routes/accounts.ts`: `GET /accounts/directory` is available to any authenticated user and returns agent names.\n- `packages/api/src/routes/tasks.ts`: `GET /tasks/pending?assignee=name` resolves arbitrary agent names and returns that agent's pending/claimed tasks.\n- `packages/api/src/routes/tasks.ts`: `/tasks/:id/claim`, `/tasks/:id/result`, `/tasks/:id/complete`, `/tasks/:id/fail`, and `/tasks/:id` do not check whether the authenticated caller is the task assignee, assigner, or otherwise authorized for the task.\n\n## Impact\n\nAn attacker only needs a valid agent API key. They can:\n\n1. List agent names using `/accounts/directory`.\n2. Query another agent's task queue using `/tasks/pending?assignee=<victimName>`.\n3. Read sensitive task payloads intended for the victim agent.\n4. Use the disclosed task ID to complete/fail/claim the victim's task or submit attacker-controlled results.\n\n## Local reproduction\n\nI 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:\n\n1. `GET /api/agenticmail/tasks/pending?assignee=Bob` with `Authorization: Bearer ak_alice`.\n2. The response is HTTP 200 and includes Bob's task ID and payload: `task-for-bob`, `{ \"task\": \"secret task intended for Bob\" }`.\n3. Alice then sends `POST /api/agenticmail/tasks/task-for-bob/complete` with her own bearer token and an attacker-controlled result.\n4. The task status becomes `completed` and the stored result is controlled by Alice.\n\nThe local verification command was:\n\n```bash\nnpm run test --workspace=@agenticmail/api -- task-routes-authz.test.ts\n```\n\nResult:\n\n```text\nPASS src/__tests__/task-routes-authz.test.ts (1 test)\n```\n\n## Expected behavior\n\nTask listing and task mutation endpoints should enforce an authorization relationship between the authenticated caller and the task. For example:\n\n- `GET /tasks/pending?assignee=<name>` should either be restricted to the current agent, master/admin callers, or an explicit delegated relationship.\n- `/tasks/:id/claim`, `/tasks/:id/result`, `/tasks/:id/complete`, `/tasks/:id/fail`, and `/tasks/:id` should verify that the caller is the assignee, assigner, master/admin, or otherwise explicitly authorized.\n- If capability-based task IDs are retained, the API should not expose those IDs to unrelated agents through the assignee-name listing path.\n\n## Credit\n\nPlease credit the finder as: Yaohui Wang",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@agenticmail/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.9.64"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/agenticmail/agenticmail/security/advisories/GHSA-hjwc-26pj-v3pm"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/agenticmail/agenticmail"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-639", "CWE-862" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-18T17:20:55Z",
    "nvd_published_at" : null
  }
}