Root user disclosure in data.gov domain though x-amz-meta-s3cmd-attrs header
A response from the data.gov host exposed an S3 metadata header that revealed the files had been uploaded by a process running as the root user. An attacker could use this knowledge to understand the server's privilege level and plan further attacks, though the report does not demonstrate any direct exploitation.
- Triaged in 8 days
- Fixed in 8 months
- Paid in 9 days
- Disclosed after 13 months
I performed a GET request on Host www.data.gov in burp suite to a custom domain and the Response showed the x-amz-meta-s3cmd-attrs header with the user id as root and group id running as root.
x-amz-meta-s3cmd-attrs: uid:0/gname:root/uname:root/gid:0/mode:33184/
This represents information disclosure and also it is better not to run this as root user to avoid an attacker executing malicious commands on the server see my other report about DNS lookups
The main part of the response is here
HTTP/1.1 502 Bad Gateway Content-Type: text/html Connection: close Date: Sun, 01 Jul 2018 08:06:19 GMT x-amz-meta-s3cmd-attrs: uid:0/gname:root/uname:root/gid:0/mode:33184/mtime:1513269652/atime:1513269652/md5:2049644b6b833f5dbb826f60a4721f64/ctime:1513269652 x-amz-version-id: VarInXu6gOLh_Jvy2jw7jpDFlOWjsQSj Server: AmazonS3 Strict-Transport-Security: max-age=31536000; includeSubDomains; preload X-Cache-Control-Orig: Cache-Control: max-age=0, must-revalidate, private X-Expires-Orig: None ETag: "e708d6-426d43661773" X-Cache: Error from cloudfront Via: 1.1 a038e18809b2b8ea7c607f48d7981dc0.cloudfront.net (CloudFront) X-Amz-Cf-Id: F-Wiqf9TifhuRT0Uevj7mz6fFjuvGJxdTP_Ut4ApOSLclfFWnqA8MQ== Content-Length: 11527
Impact
Attacker can leverage the knowledge the server is running as root and use this knowledge to highlight the potential for compromise of the server.
x-amz-meta-s3cmd-attrs: uid:0/gname:root/uname:root/gid:0/mode:33184/ Use — no-preserve to prevent storing of this information
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 s3cmd upload tool was run as root without the no-preserve option, so it stored the local file's owner and permission details as object metadata that was then served publicly.
Impact
An attacker could learn that the server process runs as root, which may help them plan further attacks, but the report does not show any direct compromise.
What the attacker needed
None
How it was found
- Send a GET request to the data.gov host.
- Inspect the response headers.
- Observe the x-amz-meta-s3cmd-attrs header showing root ownership.
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.
When files are uploaded to cloud storage, extra labels called metadata can be attached to them. Here those labels accidentally recorded that the upload tool was running with the highest level of permission on the machine, called root. Seeing this tells an attacker the server is configured loosely, which makes it a more attractive target.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.