Subdomain takeover is one of the most accessible attack vectors in existence — it requires no exploit, no malware, and no specialised skills, just a forgotten DNS record and a cloud account. When your organisation decommissions a cloud resource but leaves the DNS CNAME pointing at it, an attacker can claim that resource on the same provider and serve content under your trusted domain. Subdomain takeover has been documented at large numbers of well-known organisations, and the pattern is always the same: a DNS record left pointing at a service that was decommissioned. CISA has listed subdomain takeover as a leading misconfiguration risk in its Secure by Design guidance. The threat is not theoretical — attackers use taken-over subdomains for phishing, malware distribution, and OAuth token theft, all under a domain that browsers and security tools trust implicitly. This post explains how subdomain takeover works technically, which services are vulnerable, how to detect it, and how to remediate before attackers beat you to it.
The Forgotten Subdomain Problem
Your organisation has accumulated subdomains over years of development. Some were created for marketing campaigns that ended. Some pointed at cloud services that were later deprovisioned. Some were created by a contractor who left two years ago, using an email address that no longer works.
If the DNS record still exists but the underlying service does not, you may have a subdomain takeover vulnerability. The forgotten record hangs like a digital orphan: the hosting account is gone, nobody owns the subdomain, and yet it resolves to nowhere — but nowhere is claimable.
The scale of the problem is significant. A large organisation typically has well over a hundred subdomains discoverable through certificate transparency logs alone, and a small share of those carry a dangling DNS record pointing at a deprovisioned cloud service. For a mid-sized company, even a single vulnerable subdomain is a security incident waiting to happen.
How Subdomain Takeover Works
Subdomain takeover happens through a specific sequence:
- Your DNS has a CNAME record pointing staging.yourcompany.com to yourapp.somecloud.io.
- The account or service at yourapp.somecloud.io is deleted or expires — typically because the marketing campaign ended, the developer left, or the trial expired.
- The cloud provider does not reserve the namespace — many providers free up the custom hostname immediately when a service is deprovisioned.
- An attacker registers that exact name (yourapp.somecloud.io) on the same provider.
- Now staging.yourcompany.com resolves to content the attacker controls.
From a visitor's perspective, they are at a legitimate subdomain of your company. The browser shows the correct domain. SSL certificates issued through the provider may appear valid. Content the attacker serves — phishing pages, credential harvesters, malware downloads — runs under your trusted domain name and inherits the trust that your root domain has built.
The trust inheritance is what makes this dangerous. Content Security Policies (CSP) that restrict cross-origin requests may fail to protect the taken-over subdomain. Cookies scoped for yourcompany.com are accessible from staging.yourcompany.com, enabling session theft. Users who would never enter credentials on an unfamiliar domain may do so on a domain that looks like an internal company resource.
Which Services Are Commonly Exploited?
The attack works on any cloud service that allows custom hostnames and does not reserve previously used names after deprovisioning. The most commonly vulnerable services include:
Azure — Deleted Azure resources (Static Web Apps, Traffic Manager, Cloud App domains) that do not release the custom hostname immediately. Azure is one of the most frequently vulnerable services due to its broad use in corporate infrastructure.
AWS S3 — Deleted S3 buckets with the same name. AWS S3 bucket names are globally unique. A deleted bucket whose CNAME still points at bucketname.s3.amazonaws.com can be reclaimed by registering a new bucket with the same name — a straightforward operation.
GitHub Pages — Deleted GitHub repositories that had Pages enabled. If the repository was deleted but the DNS CNAME still points at username.github.io, anyone who creates a new repository with the same name can claim the subdomain.
Heroku — Deprovisioned Heroku apps release the app name immediately. The CNAME still resolves to Heroku infrastructure, and Heroku displays a default app-not-found page. An attacker who creates a new app with the identical name takes over the subdomain.
Shopify, Fastly, HubSpot, Zendesk, and others — Many SaaS and CDN services that allow custom hostnames are vulnerable. Researchers maintain databases of hundreds of vulnerable service signatures, each with distinctive error messages that signal a takeover is possible.
Real-World Impact
Subdomain takeovers have been found at Starbucks, Snapchat, Microsoft, Uber, and hundreds of other large organisations — typically discovered by bug bounty hunters before attackers exploited them. Bug bounty platform HackerOne has paid out over 200,000 dollars in bounties for subdomain takeover reports across hundreds of findings.
The difference between a bug bounty payout and a security incident is who finds it first. For smaller companies with no bug bounty programme, nobody is looking — and the exposed subdomains sit until an attacker stumbles upon them.
Real-world exploitation cases are documented in security incident reports. In 2024, a phishing campaign used a taken-over subdomain of a financial services company to host a credential harvesting page that mimicked the company's login portal. Victims reported no suspicion because the URL was a legitimate subdomain of a trusted brand, the SSL certificate was valid, and the browser showed no security warnings.
How to Find Your Vulnerable Subdomains
The detection process has two steps:
Step 1: Enumerate all your subdomains. Most organisations do not know how many subdomains they actually have. The enumeration uses multiple sources: certificate transparency logs (crt.sh, Censys, Google CT search), passive DNS databases, DNS brute-force against your domain with common wordlists, permutation engines that generate plausible candidate names, and any third-party sources that have catalogued your assets. ThreatPort performs this enumeration automatically and continuously, discovering subdomains you never knew existed.
Step 2: Check each subdomain for takeover signatures. For each subdomain with a CNAME, resolve the target and look for error pages that indicate the underlying service slot is unclaimed. Many platforms return distinctive error messages: "There is no app configured at this URL" (Heroku), "NoSuchBucket" (AWS S3), "Repository not found" (GitHub Pages), "404 Web Site not found" (Azure). Security researchers maintain fingerprint databases that map these error signatures to specific vulnerable services, with hundreds of entries.
Remediation
The fix is straightforward: delete the DNS record for any subdomain that no longer has a backing service. Do not wait to clean it up "later" — that record is a live vulnerability as long as it exists. For CNAME records pointing to cloud services, verify the target is still active before the record remains in DNS.
For subdomains that must remain, verify the backing service exists on a regular cadence, and implement ownership tracking: every public subdomain should have a named owner and a documented purpose. If no one can explain why a subdomain exists, remove it.
The Ongoing Challenge
Subdomains are added constantly — by developers, by marketing, by SaaS tools that create custom URLs. A one-time audit is not enough because new dangling records can appear the moment someone deprovisions a service without cleaning up DNS. A substantial share of cloud resources in the average organisation is provisioned without the security team knowing, and DNS records are among the most common artefacts left behind.
The answer is continuous monitoring. When a service is deprovisioned and the DNS record is accidentally left behind, you need to know within days, not months. ThreatPort continuously discovers and validates subdomains, alerting you when a takeover vulnerability appears so you can remediate before attackers notice.
Frequently Asked Questions
How common are subdomain takeover vulnerabilities?
More common than most organisations believe. A small but consistent share of enumerated subdomains in the average organisation carries a dangling DNS record that creates a takeover vulnerability. For an organisation with 200 subdomains (a typical mid-sized company), that means 6-10 vulnerable subdomains on average. Bug bounty platforms consistently rank subdomain takeover among the most frequently reported vulnerability classes.
Is subdomain takeover only a risk for large enterprises?
No. The attack requires no exploit, no specialised tools, and no advanced skills — just a forgotten DNS record and a valid cloud account on the same provider. Smaller organisations are often more vulnerable because they have fewer controls and no process for DNS record cleanup when a service is deprovisioned. Anyone with a basic vulnerability scanner and a list of vulnerable cloud service signatures can attempt takeovers at scale.
How fast can a subdomain takeover be detected and exploited?
Very fast. Once a DNS record starts pointing at a deprovisioned cloud service, attackers running continuous internet scans can identify the vulnerability within hours or days. Automated tools that monitor DNS changes and check for known takeover signatures are available, both commercially and in open source. The window between DNS deprovisioning and attacker detection is often measured in days, which means continuous monitoring on your side is essential — manual quarterly audits are too slow.
What is the difference between subdomain takeover and DNS hijacking?
Subdomain takeover exploits a forgotten CNAME record pointing at a deprovisioned cloud service. The attacker does not need to compromise your DNS provider — they simply claim the orphaned resource on the cloud platform. DNS hijacking modifies your DNS records directly, through registrar account compromise or BGP attacks. The technical difference is that takeover requires no compromise of your DNS infrastructure, just a dangling record. The defensive difference is that takeover prevention requires monitoring for dangling records, while hijacking prevention focuses on authenticating your DNS provider and registrar accounts.