Line feed injection in get request leads AWS S3 Bucket information disclosure
A line feed character in the URL path caused the server to proxy requests to an S3 bucket, allowing an attacker to list bucket contents and read PHP files. The attacker could also retrieve the bucket's AWS region, but could not modify the bucket.
- Triaged in 6 hours
- Fixed in 33 days
- Disclosed after 33 days
Summary: By added line feed control character to the end of url https://ratelimited.me/migration/ it is possible to list elements of bucket name "████████" , also it is possible to view source code of any php file in the bucket such as the php file with key "██████████" which is the "URIDefinition.php" from the open source HTMLPurifier , so no sensitive source code disclosure here unless this bucket directory contain sensitive .php files other than the HTMLPurifier library .
Description: There seems to be an ACL misconfiguration with a bucket name "█████" that can be listed by issuing a GET request to https://ratelimited.me/migration/%0A/ , the response will return XML document that list the content of this bucket , i tried to see if i can acces some of the files listed in the bucket but it seems the request append .php to any name after the "%0A/" soo the only files i can access are php files such as the one from this link https://ratelimited.me/migration/%0a/00f776 , it is also possible to issue some limited S3 REST requests such as https://ratelimited.me/migration/%0A/?location which will show the AWS region of the bucket [according to aws documentation this should be only allowed to bucket owner https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html ], also "PUT" and "POST" are not allowed so attacker can not change the content of the bucket
Also note that the bucket list that return from the GET request is limited to 1000 but we can view all the files using the last elements as a marker to view the next 1000 elements https://ratelimited.me/migration/%0A/?marker=02ff70.png
Steps To Reproduce:
open the provided links in any browser
https://ratelimited.me/migration/%0A/ https://ratelimited.me/migration/%0a/00f776 https://ratelimited.me/migration/%0A/?location https://ratelimited.me/migration/%0A/?marker=02ff70.png
Impact
Attacker can list the content of AWS S3 bucket list "███" and read the content of any .php file inside
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server's URL routing or proxy configuration did not properly sanitise line feed characters, causing the request to be forwarded to the S3 bucket as a bucket listing request.
Impact
An attacker could list the contents of an S3 bucket and read any PHP files stored in it, but could not modify the bucket because PUT and POST requests were not allowed.
What the attacker needed
None
How it was found
- Open the URL with a line feed character appended to the path.
- Observe the XML response listing the bucket contents.
- Access a PHP file by appending its key after the line feed.
- Request the bucket location using the '?location' query parameter.
- Use the '?marker=' parameter to paginate through more than 1000 objects.
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 report has not been written yet. The Original tab links to the source.
A web server was set up to forward requests to an Amazon S3 storage bucket. By adding a special invisible character (a line feed) to the web address, the server mistakenly let the visitor see the list of files in that bucket and read some of them. This is like finding a back door that shows the contents of a storage room.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.