Hunting SSRF in a Single Page Application (SPA) — A Bug Bounty Breakdown
The application accepted a user-supplied URL in an API parameter and fetched it server-side, allowing SSRF to internal services. The same parameter was also vulnerable to server-side template injection, which an attacker could use to run commands and read files.
Published on medium.com
I recently dove into a lab challenge that looked pretty quiet on the surface — but with some methodical digging, a little Burp Suite, and a lot of trial and error, I uncovered an SSRF vulnerability that led straight to the flag.
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 backend passed user-controlled input into a URL fetcher and a template engine without validation or sandboxing.
Impact
An attacker could use the server to reach internal services and execute commands, potentially reading sensitive files such as the flag.
What the attacker needed
Access to the web application; ability to send crafted POST requests
How it was found
- Visit the homepage and observe that the SPA makes no obvious requests in the browser.
- Use Burp Suite to capture a background POST request to the backend API.
- Send the request to Repeater and note that the response contains URL-encoded data about truck IDs.
- Change the truck ID value and confirm the response changes.
- Replace the API parameter with a localhost URL to test for SSRF and observe an error response.
- Use ffuf to enumerate localhost ports and find port 3306 open.
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 the server send requests to places the attacker cannot reach directly, such as internal services. Here the server also evaluated template code supplied by the user, which let the attacker run system commands and read a file.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.