# CVE-2026-1664: Insecure Direct Object Reference (IDOR) via Header-Based Email Routing

> Attackers can route inbound emails to arbitrary agent instances by spoofing headers, potentially accessing or modifying data in unauthorized Durable Objects.

- **Severity:** Medium 6.9 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Feb 2026
- **Updated:** 3 Feb 2026
- **Also known as:** GHSA-r7x9-8ph7-w8cg

## What is CVE-2026-1664?

CVE-2026-1664 is a medium-severity missing authorization vulnerability in agents, published on 3 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Summary

An Insecure Direct Object Reference 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.

Mitigation:

  *  PR:  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.
  *  Agents-sdk users should  upgrade to agents@0.3.7

Weakness: CWE-639 (Authorization Bypass Through User-Controlled Key)

## Which versions are affected by CVE-2026-1664?

2 open source packages ship an affected version, including agents.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `agents` | npm | All versions | 0.3.7 |
| `agents` | npm | All versions | 0.3.7 |

## How do I fix CVE-2026-1664?

Upgrade agents to 0.3.7 or later.

## Is CVE-2026-1664 being exploited?

There is no known exploitation of CVE-2026-1664 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-1664 and fix it if it is affected.

What it is: CVE-2026-1664 is a medium-severity missing authorization vulnerability in agents, published on 3 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-1664 in the wild and no public exploit code.

Affected packages and fixed versions:
- agents (npm): affected all versions; fixed in 0.3.7
- agents (npm): affected all versions; fixed in 0.3.7

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-1664/ (Markdown: https://insights.sbomify.com/CVE-2026-1664/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-1664
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-1664
- OSV: https://osv.dev/vulnerability/CVE-2026-1664

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-1664/
Summaries are generated and may contain mistakes; the official description above is the record.
