CVE-2026-1664: Agents Cloudflare Agents SDK Has Insecure Vulnerability

MODERATE
Advisory Identifier: GHSA-r7x9-8ph7-w8cg
CWE-639
Published
Advisory Summary

CVE-2026-1664 is a MODERATE cloudflare agents sdk has insecure vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Agents libraries in the npm ecosystem. The issue involves cloudflare agents sdk has insecure direct object reference (idor) via header-based email routing. Remediation is available by upgrading affected packages to version 0.3.7.

CVE-2026-1664 at a Glance

CVE Identifier CVE-2026-1664
GHSA Identifier GHSA-r7x9-8ph7-w8cg
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product Agents
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-1664

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

agents fixed: 0.3.7
npm install agents@0.3.7
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 agents

How to Check if You Are Affected

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

npm ls agents

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

Note: The npm ls agents 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 Agents, 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 An Insecure Direct Object Reference (CWE-639) has been found to exist in createHeaderBasedEmailResolver() function within the Cloudflare Agents SDK. The issue occurs because the Message-ID and References headers are parsed to derive the target agentName and agentId without proper validation or origin checks, allowing an external attacker with control of these headers to route inbound mail to arbitrary Durable Object instances and namespaces. ### Root cause The createHeaderBasedEmailResolver() function lacks cryptographic verification or origin validation for the headers used in the routing logic, effectively allowing external input to dictate internal object routing. ### Impact Insecure Direct Object Reference (IDOR) in email routing lets an attacker steer inbound mail to arbitrary Agent instances via spoofed Message-ID. ### Patches Agents-sdk users should upgrade to agents@0.3.7. PR: https://github.com/cloudflare/agents/pull/811 This [documentation](https://github.com/cloudflare/agents/blob/main/docs/email.md) provides the necessary architectural context for coding agents to mitigate the issue by refactoring the resolver to enforce strict identity boundaries.

CVE-2026-1664 Affected Agents Versions

1 component(s)
Fixed Versions:
0.3.7
Product / Package Ecosystem Affected Versions Fixed Version
agents
npm
< 0.3.7
0.3.7

References

Frequently Asked Questions

What is CVE-2026-1664?
CVE-2026-1664 is a security vulnerability in Agents involving Cloudflare Agents SDK has Insecure Direct Object Reference (IDOR) via Header-Based Email Routing under CWE-639: Authorization Bypass Through User-Controlled Key.
Which Agents versions are affected?
Affected versions include releases prior to 0.3.7 across affected packages: agents.
What version fixes CVE-2026-1664?
Upgrading to 0.3.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is agents affected?
Yes, agents is affected in releases prior to 0.3.7. Upgrade your dependency to 0.3.7 or later.
What CWE is associated with CVE-2026-1664?
CVE-2026-1664 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-1664?
Run the dependency tree command: 'npm ls agents'. 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-r7x9-8ph7-w8cg",
  "modified" : "2026-02-03T18:42:01Z",
  "published" : "2026-02-03T18:42:01Z",
  "aliases" : [ "CVE-2026-1664" ],
  "summary" : "Cloudflare Agents SDK has Insecure Direct Object Reference (IDOR) via Header-Based Email Routing",
  "details" : "### Summary\nAn Insecure Direct Object Reference (CWE-639) has been found to exist in createHeaderBasedEmailResolver() function within the Cloudflare Agents SDK. The issue occurs because the Message-ID and References headers are parsed to derive the target agentName and agentId without proper validation or origin checks, allowing an external attacker with control of these headers to route inbound mail to arbitrary Durable Object instances and namespaces.\n\n### Root cause\nThe createHeaderBasedEmailResolver() function lacks cryptographic verification or origin validation for the headers used in the routing logic, effectively allowing external input to dictate internal object routing.\n\n### Impact\nInsecure Direct Object Reference (IDOR) in email routing lets an attacker steer inbound mail to arbitrary Agent instances via spoofed Message-ID.\n\n\n\n### Patches\nAgents-sdk users should  upgrade to agents@0.3.7. \nPR: https://github.com/cloudflare/agents/pull/811\nThis [documentation](https://github.com/cloudflare/agents/blob/main/docs/email.md) provides the necessary architectural context for coding agents to mitigate the issue by refactoring the resolver to enforce strict identity boundaries.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "agents"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/agents/security/advisories/GHSA-r7x9-8ph7-w8cg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-1664"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cloudflare/agents"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/agents/blob/main/docs/email.md"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-639" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-03T18:42:01Z",
    "nvd_published_at" : "2026-02-03T12:16:11Z"
  }
}