How I Chained a Stale CNAME Record with OAuth 2.0 Wildcards for a $6,000 Account Takeover (ATO)
A forgotten CNAME record for a marketing subdomain pointed to a deleted S3 bucket, allowing an attacker to claim the bucket and serve content on the victim's domain. Because the OAuth server accepted any subdomain of the target as a redirect URI, the attacker could capture authorization codes and take over accounts.
In modern microservice architectures, enterprise web applications often rely on centralized single sign-on (SSO) providers to manage authentication across dozens of subdomains. To accommodate growing internal tooling, developers sometimes configure OAuth 2.0 client applications with permissive redirecturi validation…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the combination of a dangling DNS record pointing to a deleted cloud bucket and an OAuth client configured with wildcard redirect URI matching for all subdomains.
Impact
An attacker could achieve zero-interaction account takeover across the primary enterprise tenant by stealing OAuth authorization codes.
What the attacker needed
Victim clicks a link or has an active session; attacker can register the dangling cloud resource; OAuth client allows wildcard subdomain redirects
How it was found
- Test redirect_uri variations and observe that a subdomain under target.com is accepted.
- Enumerate DNS records and find a CNAME pointing to an S3 bucket that returns NoSuchBucket.
- Register the S3 bucket and host a script that captures the code parameter.
- Craft an authorization link with the hijacked subdomain as redirect_uri and send it to a victim.
- The victim's browser is redirected to the attacker's page with the authorization code, which is exfiltrated.
- Exchange the stolen code for a session token.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A subdomain takeover happens when a company's DNS record points to an external service (like a cloud bucket) that no longer exists, so anyone can claim that service and control the subdomain. Here, the login system trusted any subdomain of the company, so the attacker used the hijacked subdomain to steal login codes and access victim accounts.
What is Subdomain takeover?
A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.