Cloudflare DNS records (CNAME, MX, NS, SRV) that point to hostnames are assessed for dangling record vulnerabilities by checking if the target domain resolves to a valid address, preventing subdomain takeover, mail interception, and service hijacking attacks.
Risk
Dangling DNS records pointing to non-existent targets create multiple vulnerabilities. Dangling CNAME/NS allows subdomain takeover; dangling MX allows mail interception. Attackers can impersonate your organization, hijack services, or redirect legitimate traffic to attacker-controlled infrastructure.
prowler cloudflare --checks dns_record_cname_target_valid
Recommendation
Remove or update dangling DNS records to prevent takeover and interception attacks.
- Regularly audit DNS records when decommissioning services
- Remove CNAME, MX, NS, and SRV records pointing to deprovisioned resources
- Monitor for unauthorized changes to DNS records
- Consider using DNS monitoring tools to detect dangling records
Remediation
- Log in to the Cloudflare dashboard and select your account and domain
- Go to DNS > Records
- Identify CNAME, MX, NS, or SRV records with dangling targets
- Either update the record to point to a valid target or delete the record
- If the target service was decommissioned, remove the DNS record
Source Code
Resource Type
DNSRecord