How Subdomain Takeover Works in Practice
After a marketing campaign ends, a team deletes their GitHub Pages repo or AWS S3 bucket but forgets to delete the DNS CNAME record promo.example.com -> example-promo.github.io. An attacker enumerates subdomains, spots the "There isn't a GitHub Pages site here" fingerprint, claims the external project name, and now controls promo.example.com—inheriting cookie scope, CORS trust, and brand credibility.
Defensive Mitigation & Hardening Checklist
Remove DNS records BEFORE deprovisioning external cloud resources, audit DNS zones continuously for dangling CNAMEs, and use __Host- prefixes on session cookies so subdomains cannot read or set parent cookies.