Hacking a NFT Platform
An image-fetching endpoint accepted a user-supplied URL and requested it server-side, so an attacker could reach the cloud metadata service and obtain temporary AWS credentials. Those credentials then allowed listing of the platform's S3 bucket.
Published on medium.com
I will be doing a series of posts regarding my finding in Blockchain related platforms. These series of posts are inspired by the talk presented by https://twitter.com/samwcyo at Nahamcon.
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 image-fetching endpoint passed the user-supplied source URL straight to a server-side HTTP client without restricting which hosts or address ranges it could reach.
Impact
The attacker could obtain cloud credentials and list the platform's storage bucket, and the author claims this could be escalated to remote code execution, though no escalation is shown.
What the attacker needed
No account needed to call the endpoint
The fix
The endpoint should have restricted which destinations it would fetch, for example by allowlisting image hosts and blocking internal and metadata addresses; the text says the issue was fixed within an hour.
How it was found
- Notice the image endpoint takes a source URL parameter
- Point it at a Burp Collaborator host and confirm the server makes the request
- Point it at the cloud metadata address and read the response
- Request the metadata path for the instance role's credentials
- Use the retrieved credentials to list the S3 bucket
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 site had a feature that downloaded pictures from a web address you gave it. The server did the downloading, so it could be tricked into fetching private addresses that only the server can reach, including a special cloud address that hands out login keys. With those keys the attacker could read the company's cloud storage.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.