What is subdomain takeover and how do you prevent it?
AdvancedConceptDNS
Answer
A DNS record (often a CNAME) still points to a cloud resource that was deleted, such as an S3 bucket, Elastic Beanstalk or Azure app name. An attacker claims that resource and now serves content on your subdomain, with your cookies in scope.
Prevent: remove DNS records when decommissioning, inventory records with automated scans (e.g., checking CNAME targets for NXDOMAIN or provider-specific error pages), and manage DNS as code so deletes are tied to resource lifecycle.
More on DNS
What does DNS do and what happens when you type a URL into a browser?BeginnerWhat are the common DNS record types?BeginnerWhat is the difference between a recursive resolver and an authoritative server?IntermediateExplain the DNS resolution chain step by step with dig.IntermediateWhat is TTL in DNS and how does it affect changes?BeginnerWhat is negative caching in DNS?Intermediate