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.
- 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:
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 withrunsafeto 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.
-
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 theJSEFile:protocol. In windows, every file format has its own custom protocol which is used internally to execute files of that format. -
A
SteamClientAPI is exposed via the JS VM to the browsing context. Ordinarily this API is very slim (perhaps for security purposes), but by usingopen('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.
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
- Create a CodePen containing the desired code.
- Send the CodePen link to another Steam user in chat.
- 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.