From Low to Whoa: Elevating a P5 SSRF to a P3
The application had a server-side request forgery (SSRF) vulnerability in its file upload feature, initially limited by a whitelist that blocked localhost addresses. The attacker bypassed the whitelist using DNS rebinding to access an internal Squid proxy, but the proxy prevented further escalation.
Published on medium.com
Welcome back! It hasn’t been long since my last write-up, but today I have something particularly intriguing to share.
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 application allowed user-supplied URLs to be fetched without properly validating the resolved IP address, relying only on a hostname whitelist that could be bypassed via DNS rebinding.
Impact
The attacker could access an internal Squid proxy, but the proxy acted as a barrier that prevented further exploitation, limiting the impact.
What the attacker needed
Access to the file upload feature; ability to supply a URL; attacker-controlled DNS server
How it was found
- Test the file upload feature for SSRF by trying to access localhost addresses, which were blocked by a whitelist.
- Use a local IP address such as 192.168.1.x to perform port scanning via time delays.
- Set up a DNS rebinding service with localhost as the first IP and an external IP as the second.
- Use the rebinding domain in the vulnerable parameter to bypass the whitelist and access the internal Squid proxy.
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.
Server-side request forgery (SSRF) is when an attacker makes a server send requests to places it shouldn't, like internal systems. Here, the upload feature could be tricked into contacting internal addresses, but a whitelist blocked obvious ones. The attacker used a technique called DNS rebinding to get around that whitelist and reach an internal proxy server.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.