Secure development

Removing abandoned application domains and dangling service records

Secure implementation: code, settings, gate arranged to illustrate removing abandoned application domains and dangling service records.

Removing abandoned application domains and dangling service records connects a security requirement to the behaviour of a real feature. The relevant controls need to remain effective across custom code, integrations and the production configuration. Understanding abandoned application domains and dangling service records helps establish which security property the feature needs and where that property is actually enforced.

What does this involve?

Configuration can change an application's security boundary without changing its business code. Effective production values, inherited defaults, exposed services and operational interfaces need to be assessed together rather than as isolated files.

Subdomain takeover is a vulnerability that occurs when a DNS record (typically a CNAME) points to a cloud resource or third-party service that has been deprovisioned or no longer exists. An attacker can claim the orphaned resource and serve arbitrary content on the victim's subdomain.

This vulnerability is consistently among the most reported findings in bug bounty programs. Despite being well understood, it remains prevalent because it is fundamentally an operational problem: teams create DNS records when spinning up services but rarely have processes to clean them up during decommissioning.

Why it matters

Consider a realistic failure: an abandoned DNS record still points to a service whose ownership can change independently of the application.

A permissive setting can expose private information or administrative capabilities through a route the application owner did not expect. The consequence depends on how the service is actually deployed and which identities can reach it.

Implementation guidance should be applied to a real feature and its deployment. Framework defaults, custom handlers and integrated services all influence whether the intended protection remains effective.

How penetration testers check for it

Trace the relevant feature from its entry point to the data or operation it protects, including custom code and alternate paths.

  • Review effective production settings and inherited defaults.
  • Identify exposed management and diagnostic interfaces.
  • Trace secret and connection configuration to its use.
  • Compare configured policy with observed behaviour.

How to fix it

Use the appropriate maintained mechanisms and verify the result in the actual production configuration.

  • Steal session cookies scoped to the parent domain (e.g., cookies set on .example.com are sent to attacker-controlled.example.com).
  • Obtain valid TLS certificates for the subdomain from Certificate Authorities that use HTTP or email-based domain validation.
  • Receive email addressed to the subdomain if MX records are involved, enabling password resets or account verification on third-party services.
  • An organisation creates a DNS record: blog.example.com CNAME example-blog.herokuapp.com.
  • Protect secrets and remove unnecessary diagnostic exposure.
  • Check configuration drift during deployment and maintenance.

A setting should be interpreted in its environment. A deliberately public resource and an unintended private exposure can look similar until ownership, purpose and reachable operations are established.

Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.

Read about our methodology or contact pentested.com to discuss secure development and code review.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo