How I got SSRF With DNS Rebinding?
The application's image-from-URL feature was vulnerable to SSRF, but a WAF blocked requests to internal IPs by resolving the domain first. The author used a DNS rebinding service to alternate between an allowed external IP and an internal IP, eventually bypassing the WAF and retrieving images from the internal server.
medium.com
Published on medium.com
Hey guys, I hope you are doing great. I would like to share my experience to find a SSRF vulnerability with DNS Rebinding attacks.
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 WAF and the application performed separate DNS resolutions, allowing a rebinding domain to return different IPs at each lookup.
Impact
The attacker could retrieve images from the internal server, but only images were accessible, limiting the impact.
What the attacker needed
A feature that fetches images from a user-supplied URL; A WAF that blocks internal IPs by DNS resolution; Ability to use a DNS rebinding service
How it was found
- Found the add profile picture feature that accepts a URL.
- Tested with a Burp Collaborator address and confirmed the server made the request.
- Tried an internal IP and received a 'The URL is blocked' error, indicating a WAF.
- Created a rebinding domain that alternates between an allowed external IP and an internal IP.
- Used the rebinding domain in the URL field and observed alternating blocked and 404 responses.
- Automated repeated requests with Intruder until the WAF resolved to the external IP and the server resolved to the internal IP, retrieving internal images.
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.
The app lets you give a web address to fetch a picture from. A security filter checked the address and blocked internal ones, but the attacker used a special domain that changes its IP address very quickly, so the filter saw a safe address while the server later saw an internal one. This let the attacker make the server fetch pictures from itself.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.