SSRF to Pwned (ACRTP)
A status page accepted a user-supplied hostname and fetched it server-side without validation, allowing an attacker to reach the AWS instance metadata service. The attacker retrieved temporary IAM credentials and used them to read sensitive files from a private S3 bucket.
medium.com
Published on medium.com
Scrolling through the HTML, there’s a reference to a file called status.php. Let’s visit that URL and check what it does.
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 passed user-controlled input directly to a server-side HTTP request function without validating or restricting the destination.
Impact
The attacker could obtain temporary AWS credentials and read sensitive files, including a flag and fake credit card data, from a private S3 bucket; the bucket was not publicly accessible, so the SSRF was necessary.
What the attacker needed
Access to the lab VPN; no authentication required
The fix
The application should validate and restrict user-supplied URLs, block access to the metadata service, and use IMDSv2 with least-privilege IAM roles.
How it was found
- Find the status.php page and note the name GET parameter.
- Change the name parameter to an external site to confirm the server fetches it.
- Point the name parameter at the AWS metadata service to read the instance profile name.
- Request the security credentials path for that profile to obtain temporary keys.
- Configure the AWS CLI with the access key, secret key and session token.
- List the S3 bucket found in the page source and copy the sensitive files.
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 website had a feature that fetched a web page for you based on a name you typed in. Because it did not check where it was fetching from, an attacker could make it fetch a special internal address that only cloud servers can see. That address handed back temporary cloud login keys, which the attacker then used to open a private storage bucket.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.