Skip to content
XSS Disclosed report Intermediate

code injection, steam chat client

The Steam chat client rendered whitelisted oEmbed content from CodePen inside its privileged browsing context, so JavaScript in a shared pen ran with access to Steam-specific APIs and protocol handlers. An attacker could send a crafted link that, when opened, executed actions such as launching local programs and Steam protocol URIs without confirmation.

zemnmez Follow

Originally disclosed on HackerOne

Bounty$750 Medium View original
  • Triaged in 13 days
  • Fixed in 17 days
  • Paid in 17 days
  • Disclosed after 4 months

The steam chat client allows oEmbed, apparently based on a whitelist. One of the whitelisted oEmbedis codepen. When a codepen is created, it can be sent as a link to another steam user, and the code inside the codepen will execute within the privileged Steam Chat context.

You can send these codepen links to someone and they'll perform some action when you open them

https://codepen.io/zemnmez/pen/mGQvvq this one pops calc.exe https://codepen.io/zemnmez/pen/eLLYLr this opens a ton of windows https://codepen.io/zemnmez/pen/pOQBYa this one opens team fortress 2

Impact

While poking around inside this context I noticed a few things:

  1. steam:// links are executed in a privileged mode not normally accessible in the steamwebhelper. steam://uris are executed immediately, and in most contexts without confirmation. This codepen, if sent to a user will immediately run Team Fortress 2 when clicked, if installed: https://codepen.io/zemnmez/pen/zJMeYe (you can use the same technique with runsafe to nuke a user's settings).

Since there is no confirmation here, I strongly believe with some extra research a game could be opened with command line parameters and no confirmation that results in remote code execution as in this paper. Anything that otherwise happens with no confirmation, such as play / pausing music and accepting guest passes is controllable by this method.

  1. All custom-protocol urls are executed, including windows internal protocol urls. the jarfile:[FILEPATH] [PARAMS] form can be used to run any java program on their PC, same with wscript.exe and .js or .vbs files via the JSEFile: protocol. In windows, every file format has its own custom protocol which is used internally to execute files of that format.

  2. A SteamClient API is exposed via the JS VM to the browsing context. Ordinarily this API is very slim (perhaps for security purposes), but by using open('chrome-devtools://devtools/bundled/inspector.html') to open a url that doesn't open in the browser we can spawn a new window with fewer restrictions. From here we can read the user's cursor position, move the window around, make it bigger smaller, paste (though I couldn't get the API to work for this) and generally be a nuisance. I feel very sure there are APIs I can abuse here, but I've had a hard time finding them.

The original report as published on HackerOne, by zemnmez. 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 oEmbed whitelist trusted third-party embed content and rendered it in a privileged context that exposed Steam protocol handlers and the SteamClient API without isolation.

Impact

Code in the pen could trigger steam:// URIs and other custom protocol handlers without confirmation, potentially launching games or local programs, and could open a less restricted window to interact with the SteamClient API; the author notes further research may be needed for full remote code execution.

What the attacker needed

Victim opens a shared CodePen link; CodePen is on the oEmbed whitelist; Steam chat client

How it was found

  1. Create a CodePen containing the desired code.
  2. Send the CodePen link to another Steam user in chat.
  3. The recipient opens the link, and the pen's code runs in the privileged Steam Chat context.

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.

Steam chat can show previews of links from certain sites, including CodePen, a site for sharing small web programs. The chat showed the CodePen's code in a special window that had extra powers, so the code could do things a normal web page cannot, like starting games or opening files on the computer.

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 zemnmez

View all

3 more disclosed reports, best first.

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.