SSRF in Action: Metadata Exploitation in Cloud via a Vulnerable
The article shows a PHP endpoint that fetches any user-supplied URL without validation, allowing an attacker to make the server request internal cloud metadata. This could leak IAM credentials from the AWS metadata service.
ByZoningxtr
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 passes user-controlled input directly to a URL-fetching function without validating or restricting the destination.
Impact
An attacker could retrieve IAM credentials from the metadata service, potentially leading to full or partial compromise of the cloud environment.
What the attacker needed
A URL parameter that fetches remote content; Server has access to cloud metadata service
The fix
The application should validate and restrict URLs to an allowlist of permitted destinations, and block access to internal metadata addresses.
How it was found
- Intercept the target request in Burp.
- Replace the URL parameter with the metadata service address.
- Check if the response contains metadata such as ami-id or instance-id.
- Try accessing the IAM security credentials path.
- Then access the specific role name path to retrieve 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 server takes a web address from the user and fetches it without checking where it points. An attacker can give it an internal address that only the server can reach, such as a cloud metadata service, and read sensitive information like access keys.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.