Skip to content
Subdomain takeover Write-up Intermediate

$6,000 for a Dangling DNS Record: Taking Over a Subdomain to Stea

A dangling CNAME record for a subdomain pointed at a deleted third-party hosting resource, allowing an attacker to claim the resource and serve content under the company's domain. Because the session cookie was scoped to the parent domain, the attacker could read live session cookies from any authenticated user who visited the subdomain.

T4nv1 Follow

Published on medium.com

This bug didn’t involve a single request to the target’s actual application. The entire vulnerability lived in a DNS record someone forgot to delete, pointing at a cloud resource that no longer existed — and the two hours I spent on it were almost entirely about infrastructure archaeology, not application testing.

T4nv1, 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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a deprovisioning process gap: the DNS record was not removed when the third-party resource was deleted, and the hosting platform allowed unclaimed names to be registered without ownership verification.

Impact

Any user who visits the takeover subdomain while holding an active session has their session cookie exposed to attacker-controlled JavaScript, enabling full session hijacking without compromising credentials or exploiting the main application.

What the attacker needed

Attacker can register on the hosting platform; victim visits the takeover subdomain; victim has an active session cookie

The fix

The dangling DNS record was removed within a day, and the cookie scope was narrowed about three weeks later; the report recommends auditing the DNS zone and scoping session cookies to the exact hostname where possible.

How it was found

  1. Enumerate subdomains using passive sources and active brute-force.
  2. Identify a subdomain with a CNAME pointing to a third-party hosting platform that returns an error indicating the resource does not exist.
  3. Create an account on the hosting platform and register the exact resource name from the CNAME.
  4. Upload a proof-of-concept page and confirm it is served under the company's subdomain.
  5. Check the main application's session cookie scope and find it set to the parent domain.
  6. Add a script to the proof-of-concept page that reads document.cookie and confirm the session cookie is accessible.

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 write-up has not been written yet. The Original tab links to the source.

A company had a subdomain that pointed to an old cloud service they no longer used, but they forgot to remove the DNS record. Anyone could sign up for that same service and claim the name, so the subdomain started showing the attacker's page. Because the company's login cookie was shared across all subdomains, the attacker's page could read it and hijack logged-in users.

What is Subdomain takeover?

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.

More by T4nv1

View all

113 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.