Skip to content
Subdomain takeover Write-up Intermediate

Why “Claimable” Doesn’t Always Mean “Exploitable”: A Subdomain Takeover That Wasn’t

A subdomain had a dangling CNAME to a Mailgun domain that could be claimed in the dashboard, but Mailgun's DKIM TXT verification could not be added at the same name because it was a CNAME, so the takeover was not exploitable for sending mail. The program closed it as Informative.

0x_specter Follow

Published on medium.com

Bug Bounty

0x_specter, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

Subdomain takeover checklists tend to describe the same procedure: find a CNAME that points at a third-party service, confirm the target name is not claimed there, register it yourself, and report. The finding in this write-up followed that procedure exactly and still did not produce a working takeover.

The target was a subdomain, email.newsletter.company.com. It was delegated with a CNAME to Mailgun's EU infrastructure, eu.mailgun.org.

Setup

The researcher needed only a free Mailgun account. No special role, tooling or version is described in the report. The precondition that made the target interesting was the DNS configuration itself: the subdomain was a CNAME, which matters later.

Finding it

Querying the subdomain directly returned a 404 served from Mailgun's own infrastructure. In the standard interpretation, that response is the signal that the name is dangling: the CNAME still points at the provider, but no customer has claimed the name on the provider's side, so the provider has nothing to serve for it.

That is the first box on the checklist, and it was ticked.

Exploitation

Step 1: Confirm the dangling CNAME

The subdomain email.newsletter.company.com resolved through a CNAME to eu.mailgun.org, and a direct query against it returned a 404 from Mailgun's infrastructure. This established that the record was dangling and the name unclaimed.

Step 2: Claim the domain at the provider

The researcher created a free Mailgun account and went to add the domain. Mailgun accepted it without resistance. At this point every step of the classic takeover checklist had checked out clean: the CNAME existed, the target was unclaimed, and registration succeeded.

Step 3: The rejection

The program closed the report as Informative. The response gave a specific, verifiable technical reason rather than a generic close: Mailgun changed its domain verification process back in 2016, requiring DKIM DNS verification, in the form of a TXT record, before a claimed domain can actually be used to send mail.

The consequence is structural. email.newsletter.company.com is itself a CNAME record, and DNS does not allow a separate TXT record to be added at the same name as a CNAME. So although the domain was claimable inside Mailgun's dashboard, it was never usable for sending: the verification step that would unlock sending has no valid place to attach.

Root cause

The gap is in the checklist rather than in the claim itself. The standard takeover test proves that registration succeeds. It does not prove that the attack the impact claim depends on, here sending mail, is still possible after registration. Mailgun changed its verification process in 2016, requiring DKIM TXT verification before a claimed domain can send mail, and that record cannot be added at a name that is a CNAME.

The reason the gap is easy to miss is that the takeover still succeeds up to the point of registration. Nothing fails visibly during the claim; the capability simply never becomes available afterwards. The checklist stops at the moment the researcher stops testing.

Impact

On this target, the practical impact was none: the claimed domain could not be used to send mail, so the takeover was cosmetic. The report does not describe any other capability that the claim granted.

More generally, the impact of a claimable-but-unusable name depends on what the provider gates behind secondary verification. Where the gate can be satisfied, the classic impact applies; where it cannot, as here, the finding does not support the impact claim.

Fix

No fix is described for the target; the change the researcher made was to their own testing method. The change the researcher made was to their own testing method. Before reporting a takeover on a CNAME target, check whether the service has a secondary verification step gating the actual impact, such as DKIM/TXT for mail-sending services or ownership-file verification for some hosting providers, and specifically whether the DNS record type of the subdomain would even allow that verification to be added. If the subdomain is a CNAME and the service needs a TXT record at that same name to unlock real functionality, the takeover may be cosmetic.

Variants to test

  1. Mail-sending services with DKIM/TXT verification. Claim the dangling name, then attempt to complete DKIM verification. If the name is a CNAME, expect the claim to succeed and the verification to be impossible.
  2. **
  3. ** A positive result is a completed verification and working functionality after the claim.
  4. **

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher found a subdomain that looked like it could be taken over. The classic recipe for this kind of attack is simple: find a subdomain that points at an outside service, notice that nobody has registered that name at the outside service yet, register it yourself, and now you control the subdomain. The researcher followed that recipe exactly. Every step worked. And the report was still closed as Informative, meaning the company decided it was not a real vulnerability.

The reason is the interesting part. The outside service in question was Mailgun, a company that sends email on behalf of other companies. Mailgun had, in 2016, added a second check before it would actually let anyone send mail from a domain. That second check needs a particular kind of DNS record to be added at the exact same name as the subdomain. But the subdomain was itself a different kind of DNS record, and the rules of DNS say you cannot put both at the same name. So the researcher could claim the domain inside Mailgun's dashboard, but could never actually use it to send mail. The takeover was, in the researcher's word, cosmetic.

The lesson is that "I can claim it" and "I can do something harmful with it" are two different questions. Most subdomain takeover checklists only ask the first.

The background you need first

Before the steps make sense, here are the few ideas the whole story rests on. None of them require any special software; they are all things you can see with a browser and a bit of patience.

What a domain and a subdomain are

A domain is a name on the internet, like company.com. A subdomain is a name that sits in front of it, like email.newsletter.company.com. Companies use subdomains to split up their services: one for the shop, one for support, one for sending newsletters. Each subdomain can be set up completely separately from the others.

What DNS is

DNS (Domain Name System) is the internet's address book. Computers find each other by numbers (IP addresses), but people remember names. DNS translates the name you type into the number the computer needs. When you visit a website, your computer quietly asks a DNS server "what is the address for this name?" and gets an answer back.

What a CNAME record is

A DNS record is one entry in that address book. The most common one, an A record, says "this name belongs to this number." A CNAME record (short for Canonical Name) says something different: "this name is just another label for that other name, go look there instead." It is like a mail forwarding note on a letter: it does not tell you where the person lives, it tells you to send the letter to a different address.

A useful everyday comparison: a CNAME is a sign on a shop door saying "we have moved, please go to the shop on the high street." The sign itself is not a shop. It only points.

What a subdomain takeover is

Companies often point a subdomain at an outside service using a CNAME. For example, email.newsletter.company.com might point at a mail provider, so that the provider handles the email side of things.

Now imagine the company stops using the provider but forgets to remove the CNAME. The subdomain still points at the provider, but nobody has claimed the name there any more. The name is "dangling." If an attacker goes to the provider and registers that name in their own account, the provider may treat the attacker as the owner, subject to any verification the provider requires. That is a subdomain takeover.

What Mailgun is and what it does

Mailgun is a mail-sending service. Companies do not want to build and maintain their own email servers, so they pay a provider like Mailgun to send their newsletters and notifications. The customer adds their domain to their Mailgun account, proves they own it, and then Mailgun will send mail on behalf of that domain.

What a 404 is

A 404 is the standard web response for "this page does not exist." When you visit a web address and the server has nothing to show there, it replies with a 404. In the subdomain takeover world, a 404 coming from the provider's own servers is a strong hint: the provider is answering for that name, but has nothing configured for it, which usually means nobody has claimed it.

What DKIM and a TXT record are

DKIM (DomainKeys Identified Mail) is a way for the receiving side of an email to check that a message really came from the domain it claims to come from. It works with a special DNS record called a TXT record, which holds a short piece of text. The sending service publishes a specific piece of text in DNS, and receivers check that the text matches the signature on the email.

A TXT record is just a text note in the DNS address book. It is not an address and not a forwarding sign; it is a note attached to a name.

The DNS rule that decides the whole story

Here is the rule that makes this report what it is: at any single name in DNS, you can have a CNAME record, or you can have other records (like TXT), but not both. A CNAME says "this name is only a pointer, look elsewhere," and DNS does not allow a pointer and a note to live at the same name. It is like a sign that says "we have moved" and a note that says "opening hours are 9 to 5" on the same door: the sign says there is nothing here, so the note has nowhere to belong.

Keep that rule in mind. It is the reason the takeover did not work.

The setup

The researcher needed only a free Mailgun account. No special role, tool or version is described in the report. What made the target interesting was the DNS configuration itself: the subdomain was a CNAME rather than an A record or a name with its own zone. That detail matters later, and it is the detail most checklists ignore.

Finding it

The researcher queried the subdomain directly. The response was a 404 served from Mailgun's own infrastructure. In the standard interpretation, that response is the signal that the name is dangling: the CNAME still points at the provider, but no customer has claimed the name on the provider's side, so the provider has nothing to serve for it.

That is the first box on the checklist, and it was ticked.

Exploitation

Step 1: Confirm the dangling CNAME

The subdomain email.newsletter.company.com resolved through a CNAME to eu.mailgun.org, and a direct query against it returned a 404 from Mailgun's infrastructure. This established that the record was dangling and the name unclaimed.

Why this step matters: before doing anything, you want proof that the pointer exists and that the destination has nothing set up for it. The CNAME is the pointer; the 404 is the empty destination. Together they say "this name is up for grabs."

Step 2: Claim the domain at the provider

The researcher created a free Mailgun account and went to add the domain. Mailgun accepted it without resistance. At this point every step of the classic takeover checklist had checked out clean: the CNAME existed, the target was unclaimed, and registration succeeded.

Why this step matters: this is the actual takeover. If the provider lets you register the name, the provider now believes you own it. In the classic version of this attack, that is the moment you win, because the provider will now send mail, or serve content, on your behalf under the company's name.

Step 3: The rejection

The program closed the report as Informative. The response gave a specific, verifiable technical reason rather than a generic close: Mailgun changed its domain verification process back in 2016, requiring DKIM DNS verification, in the form of a TXT record, before a claimed domain can actually be used to send mail.

In plain words: registering the name in the dashboard is not enough any more. Mailgun also wants you to prove you control the DNS for that name, by publishing a particular piece of text as a TXT record. Only then will it actually send mail from it.

The consequence is structural. email.newsletter.company.com is itself a CNAME record, and DNS does not allow a separate TXT record to be added at the same name as a CNAME. So although the domain was claimable inside Mailgun's dashboard, it was never usable for sending: the verification step that would unlock sending has no valid place to attach.

Why this step matters: this is where the checklist and reality part ways. The claim succeeded, but the thing that would make the claim dangerous, actually sending mail, was locked behind a check that could not be completed. The researcher could hold the name in the dashboard, but the name could not do anything.

Root cause

The gap is in the checklist rather than in the claim itself. The standard takeover test proves that registration succeeds. It does not prove that the attack the impact claim depends on, here sending mail, is still possible after registration. Mailgun changed its verification process in 2016, requiring DKIM TXT verification before a claimed domain can send mail, and that record cannot be added at a name that is a CNAME.

The reason the gap is easy to miss is that the takeover still succeeds up to the point of registration. Nothing fails visibly during the claim; the capability simply never becomes available afterwards. The checklist stops at the moment the researcher stops testing.

An everyday comparison: it is like finding a flat with the front door unlocked and reporting a burglary risk. You can walk in, but the flat is empty and the electricity is cut off. You have access, but nothing you can do with it causes harm.

Impact

On this target, the practical impact was none: the claimed domain could not be used to send mail, so the takeover was cosmetic. The report does not describe any other capability that the claim granted.

More generally, the impact of a claimable-but-unusable name depends on what the provider gates behind secondary verification. Where the gate can be satisfied, the classic impact applies; where it cannot, as here, the finding does not support the impact claim.

In beginner terms: impact is the answer to "what could an attacker actually do?" If the answer is "nothing useful," the report is not a vulnerability, even if the steps to get there were real.

Fix

No fix is described for the target; the change the researcher made was to their own testing method. The change the researcher made was to their own testing method. Before reporting a takeover on a CNAME target, check whether the service has a secondary verification step gating the actual impact, such as DKIM/TXT for mail-sending services or ownership-file verification for some hosting providers, and specifically whether the DNS record type of the subdomain would even allow that verification to be added. If the subdomain is a CNAME and the service needs a TXT record at that same name to unlock real functionality, the takeover may be cosmetic.

In other words, the fix was to the checklist, not to the company.

Variants to test

These are the situations where the same idea plays out differently. Each one is a question you can ask before reporting.

  1. Mail-sending services with DKIM/TXT verification. Claim the dangling name, then attempt to complete DKIM verification. If the name is a CNAME, expect the claim to succeed and the verification to be impossible.
  2. **
  3. ** A positive result is a completed verification and working functionality after the claim.
  4. **

Glossary

  • 404: the standard web response meaning "this page does not exist."
  • A record: a DNS entry that maps a name directly to an IP address.
  • CNAME record: a DNS entry that says one name is just another label for a different name, so lookups should follow the pointer.
  • DNS (Domain Name System): the internet's address book, translating names people type into the numbers computers use.
  • DKIM (DomainKeys Identified Mail): a method for proving an email really came from the domain it claims, using a signature checked against a DNS record.
  • Dangling: a DNS record that still points at an outside service, but where nobody has claimed the name at that service any more.
  • Domain: a name on the internet, such as company.com.
  • Impact: what an attacker could actually do if the issue were real; the harm, not just the access.
  • Informative: a report status meaning the company decided the finding was not a real vulnerability.
  • Mailgun: a mail-sending service that sends email on behalf of customer domains.
  • Provider: the outside company whose service a subdomain points at.
  • Root cause: the underlying reason a problem exists, as opposed to its visible symptom.
  • Subdomain: a name that sits in front of a domain, such as email.newsletter.company.com.
  • Subdomain takeover: claiming a dangling subdomain at the outside service it points to, so that traffic or mail for that name goes to the attacker.
  • TXT record: a DNS entry that holds a short piece of text, often used for verification.
  • Verification: a check a provider runs to confirm a customer really controls a domain before enabling a feature for it.

More by 0x_specter

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Subdomain takeover

The lesson behind this report.

A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.