From Open Redirect to Internal Access: My SSRF Exploit Story
A thumbnail service blocked direct requests to internal hosts but followed redirects from external domains, so an open redirect on a third-party domain could be used to make the server request localhost. This allowed internal port scanning and potentially access to internal services.
infosecwriteups.com
Published on infosecwriteups.com
I am Pratik Dabhi, a Bug Bounty Hunter and a Penetration Tester. Many of you may already know me, but for those who aren’t, please visit my website to learn more about me.
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
The service blocked direct requests to internal hosts but trusted external domains and followed their redirects without validating the final destination.
Impact
An attacker could scan internal services and discover open ports, access internal endpoints like admin panels or databases, and potentially access cloud metadata services that could leak sensitive credentials.
What the attacker needed
A thumbnail service that fetches external URLs; an open redirect on a third-party domain
The fix
The service should validate the final resolved IP after following redirects and block internal ranges, and the third-party open redirect should be fixed.
How it was found
- Confirm the thumbnail service blocks direct requests to localhost.
- Find a third-party domain with an open redirect endpoint.
- Craft a thumbnail URL that points to the open redirect, which in turn redirects to localhost.
- Observe the connection refused error showing the server tried to connect to localhost.
- Change the port in the payload to scan other internal ports.
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 server-side request forgery (SSRF) bug lets an attacker make a server send requests to places the attacker cannot reach directly, such as internal machines. Here the server blocked direct requests to localhost, but it still followed redirects from other websites. By using a third-party site that redirects anywhere, the attacker made the server follow a redirect to localhost, bypassing the block.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.