Skip to content
SSRF Write-up Advanced

We Hacked Ourselves With DNS Rebinding

The screenshot workers followed HTTP redirects and could access the EC2 metadata service, allowing an attacker to obtain AWS credentials. Even after switching to IMDSv2, DNS rebinding via the ZAP AJAX spider bypassed the token requirement and extracted credentials.

Daniel Thatcher Follow

Published on intruder.io

While the impact of this vulnerability ended up being low due to defence-in-depth measures we employ, the technique to get there is interesting in itself as it is simple enough to demonstrate that DNS rebinding exploits can be realistic, even in time-boxed scenarios such as pentests.

Daniel Thatcher (@_danielthatcher), on intruder.io

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 screenshot worker followed redirects to internal addresses and the metadata service was reachable, and later the DNS rebinding bypassed IMDSv2 because the browser could still make requests to the metadata IP after the domain's DNS record changed.

Impact

The impact was low because the credentials had minimal permissions and other defences limited further access, but an attacker could obtain low-privileged AWS credentials and potentially cause service disruption.

What the attacker needed

Attacker controls a domain and its DNS; victim visits attacker's page; browser stays open long enough for DNS cache to expire; target service uses HTTP and does not validate Host header

How it was found

  1. Set up a public web server that redirects to the EC2 metadata service URL.
  2. Add that web server as a target in the platform so the screenshot worker visits it.
  3. The worker follows the redirect and takes a screenshot of the metadata response.
  4. Modify the redirect to point to the credentials endpoint for a role.
  5. The worker takes another screenshot showing the credentials.

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 screenshot worker is a program that visits a website and takes a picture of it. The worker could be tricked into visiting a special internal address that holds secret cloud keys, and later a technique called DNS rebinding let a malicious website make the worker fetch those keys even after a protection was added.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More by Daniel Thatcher

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.