Skip to content

Bug class · Beginner

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.

median public bounty
$500

Covers CWE 350.

How it works

Full lesson

The pattern behind every report in this class.

Subdomain takeover is what happens when a subdomain of a target still points, through DNS, at a third-party service that nobody at the target controls any more. The record survives but the resource behind it does not, so anyone who can register that resource name can serve their own content on the target's subdomain. The evidence covers dangling records to object storage buckets, CDN and cloud app endpoints, hosted blogging and helpdesk platforms, page builders, package hosting and name server zones, among others. Programs care because the hostname carries the target's brand and often its trust: a page served there looks legitimate to users, customers and automated systems.

What it usually leads to depends on where the subdomain sits. The most common outcome is content injection on a trusted host, which can be used for phishing or for serving files that others download. More serious cases arise when the subdomain is inside a trust boundary: cookies scoped to the parent domain can leak to it, OAuth redirect whitelists and CORS origins that include it can be abused, and a taken-over host can act as an open redirect. Some reports show escalation to reading authenticated data or to account takeover flows, and some show denial of service by breaking an expected flow.

It turns up most often where teams move quickly and leave things behind: media and CDN subdomains, cloud app and traffic manager endpoints, blog and documentation subdomains, helpdesk addresses, and names mentioned in public docs or repositories. It is also common on features that let users attach custom domains, such as portfolios, on-demand pages and storefronts, and on domains belonging to acquired companies or products where ownership of the DNS estate is less clear.

The database behind this lesson holds 224 reports, 108 with a summary and 59 paid, so a good share of submissions did not result in a reward. That is a useful signal for a beginner: finding a dangling record is only the start, and the reports that counted were the ones that showed real control and a concrete consequence.

Things to try

All 156

Each line worked in a disclosed report. Test only what a program's scope allows.

Cloud app and PaaS hostnames 27

  • Follow a subdomain's CNAME chain to an Azure cloudapp virtual machine name and check whether that name is available to register.
  • Search public documentation and repositories for Heroku app names referenced by a target, then check whether those app names are unclaimed and can be registered.
  • Check whether a subdomain or documentation link points to an expired Heroku app name that can be claimed.
  • Check whether a subdomain points to an Azure Traffic Manager endpoint that is no longer claimed.

Subdomain enumeration and recon 12

  • Attempt a DNS zone transfer against a target's name servers to enumerate records and spot takeover candidates.
  • Run systematic subdomain reconnaissance against a target and follow each result's CNAME chain to spot takeover candidates.
  • Enumerate a target's subdomains and check each for dangling records to third-party services.
  • Check a target's subdomains for CNAMEs to cloud services and test whether the service name is unclaimed.

CDN and edge distributions 9

  • Upload a file with a chosen content type to a claimed bucket and check whether the CDN in front of the site caches and serves it.
  • Check whether a subdomain's CNAME points at a CDN service that no longer has a distribution for that hostname, and see if the service lets anyone register the hostname without proving DNS ownership.
  • Check subdomains for CNAMEs to CloudFront and test whether the distribution can be claimed.
  • Check whether a CDN or external resource referenced by a site has expired and can be claimed.

Expired and purchasable domains 9

  • Check WHOIS for domains used by a target and look for expired registrations that still appear in its content or apps.
  • Check DNS records of subdomains for CNAMEs to external domains and test whether those domains are available to purchase.
  • Query the CNAME of a subdomain and check whether it points to a domain under a top-level domain that is not registered.
  • Check whether a CNAME points to an AWS ELB hostname whose parent domain is available for registration.

Object storage buckets 9

  • Resolve a subdomain and check whether its CNAME points at an object storage bucket name that no longer exists, then confirm the bucket name is claimable.
  • Resolve subdomains and look for CNAMEs to S3 website endpoints, then check whether the bucket name can be registered in the same region.
  • Request a subdomain and look for an S3 PermanentRedirect or NoSuchBucket error that reveals the bucket name, then check whether a bucket with that name can be registered.
  • After claiming a bucket referenced by a subdomain, enable static website hosting and upload a test page to confirm the subdomain serves your content.

Bypasses and variations

All 16
  • A claimed subdomain can bypass OAuth whitelists and CORS protections.
  • Serving files under expected names from a claimed bucket gets them downloaded by anyone running the build or install.
  • A previous fix for a subdomain takeover was bypassed by adding a domain parameter to the page-editing request body.
  • A later fix was bypassed by changing the endpoint path and adding a page URL parameter with the target subdomain.
  • When the specific subdomain could not be added, adding the wildcard domain for the parent succeeded and covered the subdomain.
  • Appending a trailing dot to the hostname changed how the request was routed.

Typical fixes

All 11
  • Remove DNS records when the service or resource they point at is decommissioned, deleted or deprovisioned.
  • Require proof of DNS ownership before a third-party service attaches a custom domain.
  • Remove or update links to expired domains in documentation and handbooks.
  • Scope session cookies to the specific host rather than the parent domain.
  • Validate the domain parameter server-side against domains the account actually owns.
  • Share the domain-claimed check between all features that allow custom domain claims.

Tips for beginners

All 13
  • Start with reconnaissance at scale rather than a single host. Enumerate the target's subdomains with passive and active sources, then follow each result's CNAME chain and check the A records. The reports that found takeovers mostly came from systematic enumeration and then testing each candidate, not from guessing one name.
  • Learn the error pages. A request to a subdomain that returns a provider's Not Found or unknown domain message, a bucket redirect or a no such bucket error is telling you the name is unclaimed. Those responses are the clearest first signal and appear repeatedly in the evidence.
  • Confirm claimability before you report. Resolve the record, identify the exact resource name, and check whether you can actually register it. For buckets, check the name is free in the relevant region. For platform custom domains, check the platform will attach it to a new account. A dangling record alone is not a finding.
  • Prove control visibly and safely. Serve a harmless test page, or add a TXT record where you have claimed a zone, and record the evidence. Do not use the position to collect real user data or to attack users. The reports that were paid showed control and a concrete consequence, not just a claim.
  • Think about what the subdomain is trusted for. Check whether it is inside an OAuth redirect whitelist, a CORS origin list, a cookie scope, or a distribution path for installers and package files. A takeover on a plain marketing host is weaker than one that sits in a trust boundary, and the difference is what makes the report worth submitting.
  • Check the parent domain cookie scope early. If session cookies are set for the parent domain, a taken-over subdomain receives them. Demonstrating that the cookie is sent to your host, and what it can be replayed against, turns a content injection into a session issue.

Start here: a reading path

Open the path

Clear reports in order, easiest first.

Guides and techniques

View all

The best explainers, cheat sheets and technique posts on Subdomain takeover, from around the web.

Newest reports

All 491

Most recently disclosed.

New Subdomain takeover reports by email

Follow Subdomain takeover and get each week's new disclosures in one short email.

Free. New reports for what you follow, weekly by default. One-click unsubscribe. Privacy