SSRF to Server Takeover PoC (Bug Bounty Writeup)
The web app's radio streaming feature accepted a user-supplied URL and fetched it server-side without restriction. An attacker could point it at the cloud metadata endpoint to retrieve SSH credentials and take over the server.
Hi, there! In this post, I’ll explain how I discovered a critical vulnerability that allowed me to take over a server with root access, without any restrictions!
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 server-side request feature did not validate or restrict the destination URL, allowing requests to internal metadata services.
Impact
An attacker could obtain plain-text SSH credentials and gain full control over the server, including the ability to change settings and reach internal applications.
What the attacker needed
Access to the radio streaming feature; ability to intercept and modify requests
The fix
The server should restrict outbound requests to a whitelist of allowed URLs, validate user input, and block access to internal metadata endpoints.
How it was found
- Open the radio streaming feature and press play while watching the Network tab.
- Notice the request parameter named source_file that holds the MP3 URL.
- Change that parameter to the cloud metadata endpoint address.
- Observe the server returning metadata, including a user_data file with SSH 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.
The app had a feature that let you give it a web address to play music from. The server would then visit that address for you. Because it did not check which addresses were allowed, you could make it visit a special internal address that only the cloud provider uses, which handed back the server's login details.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.