CVE-2026-1664 Overview
An Insecure Direct Object Reference (IDOR) vulnerability has been identified in the createHeaderBasedEmailResolver() function within the Cloudflare Agents SDK. The vulnerability occurs because the Message-ID and References headers are parsed to derive the target agentName and agentId without proper validation or origin checks. This allows an external attacker with control of these headers to route inbound mail to arbitrary Durable Object instances and namespaces.
Critical Impact
Attackers can steer inbound mail to arbitrary Agent instances via spoofed Message-ID headers, potentially enabling unauthorized access to internal object routing and bypassing identity boundaries.
Affected Products
- Cloudflare Agents SDK versions prior to 0.3.7
- Applications utilizing createHeaderBasedEmailResolver() for email routing
- Durable Object instances relying on header-based email resolution
Discovery Timeline
- 2026-02-03 - CVE CVE-2026-1664 published to NVD
- 2026-02-03 - Last updated in NVD database
Technical Details for CVE-2026-1664
Vulnerability Analysis
This vulnerability is classified as CWE-639: Authorization Bypass Through User-Controlled Key, commonly known as Insecure Direct Object Reference (IDOR). The flaw allows network-based attacks without requiring authentication or user interaction, enabling attackers to manipulate the routing logic of the Cloudflare Agents SDK email processing system.
The vulnerability enables unauthorized control over email routing decisions by exploiting the trust placed in user-controllable email headers. When an attacker crafts malicious Message-ID or References headers, they can direct email traffic to unintended Durable Object instances, potentially accessing or manipulating data across different agent namespaces.
Root Cause
The createHeaderBasedEmailResolver() function lacks cryptographic verification or origin validation for the headers used in the routing logic. This design flaw effectively allows external input to dictate internal object routing decisions. The function parses Message-ID and References headers to extract routing information (agentName and agentId) but fails to verify that the requesting party has legitimate access to the specified resources.
Attack Vector
The attack is network-based and can be executed by any external attacker who can send emails to a system using the vulnerable Cloudflare Agents SDK. The attacker crafts an email with specially constructed Message-ID and References headers that specify arbitrary agentName and agentId values.
When the vulnerable createHeaderBasedEmailResolver() function processes this email, it extracts routing information directly from these headers without validation. The email is then routed to the attacker-specified Durable Object instance, bypassing intended access controls. This allows the attacker to potentially interact with agent instances they should not have access to, or route malicious content to specific targets within the system.
Detection Methods for CVE-2026-1664
Indicators of Compromise
- Unusual email routing patterns where emails are delivered to unexpected Durable Object instances
- Anomalous Message-ID or References header values that don't conform to expected formats
- Increased access attempts to Durable Object namespaces from previously inactive or unauthorized sources
- Log entries showing email routing to agent instances without corresponding legitimate email conversations
Detection Strategies
- Implement logging and monitoring for all email routing decisions made by createHeaderBasedEmailResolver()
- Create alerts for routing requests that target agent instances without prior established conversations
- Monitor for patterns of emails with crafted headers attempting to access multiple different agent namespaces
- Deploy anomaly detection to identify header values that deviate from expected organizational patterns
Monitoring Recommendations
- Enable detailed logging of email header parsing operations in the Agents SDK
- Monitor Durable Object instance access patterns for unauthorized cross-namespace communications
- Track and alert on email routing decisions that bypass expected identity boundaries
- Review email processing logs regularly for suspicious Message-ID and References header manipulation
How to Mitigate CVE-2026-1664
Immediate Actions Required
- Upgrade Cloudflare Agents SDK to version 0.3.7 or later immediately
- Review applications utilizing createHeaderBasedEmailResolver() for potential exposure
- Implement additional validation layers for email header processing until patches are applied
- Audit logs for any evidence of exploitation attempts or suspicious routing patterns
Patch Information
Cloudflare has addressed this vulnerability in Agents SDK version 0.3.7. Users should upgrade to this version or later to remediate the vulnerability. The Cloudflare Agents SDK repository provides the necessary architectural context and updated documentation for implementing secure email routing with proper identity boundaries.
Workarounds
- Implement custom validation logic to verify the authenticity of Message-ID and References headers before processing
- Add cryptographic signing to email routing information to prevent header spoofing
- Restrict email routing to known and pre-authorized agent instances using allowlists
- Deploy network-level controls to limit email sources that can interact with the Agents SDK email resolver
# Upgrade Cloudflare Agents SDK to patched version
npm install agents@0.3.7
# Verify installed version
npm list agents
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


