Obtain the username & the uid of the one doing the S3 sync on Hackerone
The S3 buckets behind HackerOne's static content domains returned object metadata that included the operating-system username and user ID of the person who uploaded the files. An attacker could read that metadata to learn the uploader's local account name and numeric ID.
- Triaged in 2 hours
- Fixed in 46 hours
- Disclosed after 3 days
Obtain the username & uid of hackerone.com S3
using GET, it's possible to obtain the username & uid of the one doing the S3 sync on Hackerone.
Doing a GET on :
http://hackerone.com
Give the following header :
content-security-policy = default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src www.youtube-nocookie.com a4l.hackerone-ext-content.com a5s.hackerone-ext-content.com b5s.hackerone-ext-content.com; connect-src 'self'; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com a4l.hackerone-ext-content.com a5s.hackerone-ext-content.com b5s.hackerone-ext-content.com; img-src 'self' data: www.google-analytics.com article-photos.hackerone-user-content.com cover-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self'; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://hackerone.report-uri.io/r/default/csp/enforce
Doing a GET on :
a4l.hackerone-ext-content.com
a5s.hackerone-ext-content.com
Give the following header :
x-amz-meta-s3cmd-attrs = uid:501/gname:staff/uname:martijn/gid:20/mode:33188/mtime:1473665474/atime:1473665475/md5:3ca417860c0cdf7f11a2ff30589631bf/ctime:1473665474
uname:martjin
Doing a GET on : http://b5s.hackerone-ext-content.com
Give the following header :
x-amz-meta-s3cmd-attrs = md5:358568d44a80bb9668c940414f4d8a01
Note :
x-amz-meta-s3cmd-attrs header stores information related to the computer and the user while syncing the information. Adding the parameter "--no-preserve" avoids the storage of the username.
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 sync was run without the --no-preserve option, so it stored local user attributes as object metadata that the bucket then served publicly.
Impact
The username and user ID of the person performing the S3 sync could be disclosed, which is limited information exposure rather than direct access to the buckets.
What the attacker needed
None
How it was found
- Send a GET request to the main site and note the content-security-policy header listing the static content hosts.
- Send a GET request to the static content hosts and read the x-amz-meta-s3cmd-attrs response header.
- Observe the uname and uid values exposed in that header.
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 Amazon S3 storage, the upload tool can attach extra labels (metadata) to each file. Here the s3cmd tool saved the uploader's computer username and user ID into that metadata, and the server handed it back to anyone who asked. That leaks a small piece of internal information about the person who ran the upload.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.