A subdomain takeover occurs when a DNS record still points to a deleted Azure resource and an attacker claims the resource's former fully qualified domain name. The attacker can then redirect traffic intended for your subdomain to malicious content, including phishing or credential-harvesting sites. section 4.5.3
Prevent the dangling-DNS condition by following the resource lifecycle:
- Remove DNS records that point to Azure resources when those resources are deleted or deprovisioned. section 4.10
- Treat retained records as active advertisements: they may continue routing a subdomain even though the original Azure resource no longer exists. section 4.5.3
- Review resource deletion procedures for Azure App Service workloads and other frequently created or deleted Azure resources. section 4.5.3
Dangling DNS in action
An application uses app-bestwebapp-dev-001.azurewebsites.net and the subdomain bestwebapp.mycompany.com. After the Azure resource is deleted, the DNS record remains. An attacker can provision an Azure resource with the same fully qualified domain name under another subscription, causing traffic for bestwebapp.mycompany.com to reach the attacker's resource. section 4.5.3
