Hijack all emails sent to any domain that uses Cloudflare Email Forwarding
A flaw in zone ownership verification allowed an attacker to set up email routing for a domain they did not own, overriding the existing configuration. This let the attacker read all incoming emails and prevent them from reaching the original destination.
Originally disclosed on HackerOne
- Triaged in 43 hours
- Fixed in 7 days
- Paid in 6 days
- Disclosed after 8 months
Summary by the program
The Email Routing feature enables Cloudflare users to create any number of custom email addresses and route all incoming messages to the user's preferred inboxes. Due to a bug in zone ownership verification, it was possible to configure Email Routing to redirect e-mail messages for an unverified zone (with Email Routing enabled) to a different mailbox. In addition, the vulnerability allowed the e-mail forwarding configuration created by the zone owner to be overwritten.
The issue has since been fixed by the Engineering team and zone ownership verification is working as expected when setting up Email forwarding rules. We investigated the exploit and validated it had only been found by the security researcher who responsibly disclosed the issue.
Summary by the researcher
This vulnerability made it possible to deploy a rogue Email Routing configuration for an unverified zone (i.e. a domain you don't own) that would override the existing configuration on Cloudflare's mail servers.
This made it possible to 1. read any email sent to the target domain; and 2. stop any email sent to the target domain from arriving at the original destination address.
The target domain had to already be using Cloudflare Email Routing as the vulnerability did not enable modification of DNS records.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could read any email sent to the target domain and stop any email from arriving at the original destination, but only if the domain already used Cloudflare Email Routing.
What the attacker needed
Target domain uses Cloudflare Email Routing; attacker can access Cloudflare Email Routing setup
The fix
The issue was fixed by the Engineering team and zone ownership verification now works as expected when setting up email forwarding rules.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Cloudflare Email Routing lets a domain owner forward incoming emails to another inbox. The bug meant that someone could pretend to own a domain and change where its emails go, even without proving ownership. So they could read all emails sent to that domain and stop the real owner from getting them.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.