Skip to content
XSS Disclosed report Intermediate

Stored XSS in the guide's GameplayVersion (www.dota2.com)

A stored cross-site scripting vulnerability existed in the GameplayVersion field of Dota 2 guides, allowing an attacker to inject a script that executes when a victim views the public guide page. An attacker could steal cookies to abuse the user's session.

mvc Follow

Originally disclosed on HackerOne

Bounty$750 Medium 6.4 View original
  • Triaged in 18 hours
  • Fixed in 46 hours
  • Paid in 46 hours
  • Disclosed after 6 months

Hi, team!

The beginning of this issue looks like my previous report #369043, but this one will be much more interesting :) So let's go!

Steps to reproduce:

  1. Open dota2 client and create new simple guide with XSS in the name.
Screenshot_1.png
Screenshot_1.png From the original on HackerOne
  1. Publish this guide on steam.
Screenshot_2.png
Screenshot_2.png From the original on HackerOne
  1. Now go to the Fiddler app and look at the request from dota2 client:
Screenshot_2.png
Screenshot_2.png From the original on HackerOne

The XSS script placed in the title, the title displays a safe HTML on the site, so, for now nothing terrible happens.

  1. Next I write some piece of code in the Fiddler app:
if (oSession.uriContains("/cloud/CB/")) {
    var strBody=oSession.GetRequestBodyAsString();       
    strBody=strBody.replace("mvc123<svg/onload=alert(document.domain)>","mvc123");
    strBody=strBody.replace("7.18","7.18<svg/onload=alert(document.domain)>");
    oSession.utilSetRequestBody(strBody);       
}

So I transfer the XSS script from "Title" to "GameplayVersion". I decided to go this way, since in this case the content length of build's file does not change and it successfully passes the hash sum comparison.

  1. Now we return to the dota2 client, click "Edit" and change anything in the our build and publish it again. And we see that the PUT request was successful and the XSS data in it is arranged the way we wanted:
Screenshot_3.png
Screenshot_3.png From the original on HackerOne
  1. Next i follow to the Dota2 Workshop Manager.
Screenshot_4.png
Screenshot_4.png From the original on HackerOne

And here we see our public file ID. This connection with the public guide files I was found in the preparation of the previous report, but I did not know how to apply it (before today).

  1. Put this FileID into a link below and we get the public infected page:

http://www.dota2.com/workshop/builds/view?fileid=949580646106367888

And the result in the latest versions of Firefox and Chrome:

Screenshot_7.png
Screenshot_7.png From the original on HackerOne
Screenshot_5.png
Screenshot_5.png
Screenshot_6.png
Screenshot_6.png

Sincerely, @mvc

Impact

As on any cross-site-scripting vulnerability. The top line would be that the attacker might steals cookies to abuse users session.

The original report as published on HackerOne, by mvc. 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 GameplayVersion field was not properly sanitised or escaped before being rendered on the public guide page, allowing HTML and script injection.

Impact

An attacker could steal cookies to abuse the user's session, as with any cross-site scripting vulnerability.

What the attacker needed

Dota 2 client; Steam account; Fiddler proxy tool; Victim visits public guide page

How it was found

  1. Create a new simple guide in the Dota 2 client with an XSS payload in the name.
  2. Publish the guide on Steam.
  3. Use Fiddler to inspect the request from the Dota 2 client.
  4. Modify the request body in Fiddler to move the XSS payload from the title to the GameplayVersion field.
  5. Edit the guide in the client, change anything, and publish again to send the modified request.
  6. Find the public file ID in the Dota 2 Workshop Manager and open the public guide page using that ID.

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.

Cross-site scripting (XSS) is when a website shows user-supplied text as if it were part of the page, so a malicious script runs in a visitor's browser. Here, a hidden field in a game guide could carry such a script, and anyone opening the public guide page would run it. The script could then read the visitor's cookies, which are small pieces of data that keep them logged in.

What is XSS?

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

More from Valve

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.