BTTV Chrome extension stored XSS
The BetterTTV Chrome extension generated hidden HTML for image links in Twitch chat without properly validating the URL, allowing an attacker to inject JavaScript via a crafted chat message. This script ran in the context of Twitch.tv, enabling the attacker to steal stream keys, modify settings, or read private messages without victim interaction.
BetterTTV (BTTV) is a web browser add-on popular among Twitch.tv users. It offers many features to enhance the video streaming and viewing experience such as emoticons and improved chat history.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the extension failed to properly sanitise or encode the URL before inserting it into HTML, allowing HTML injection.
Impact
An attacker could execute code in BTTV users' browsers to steal stream keys, modify settings or profile contents, or read and send Twitch private messages; the bug was only tested on Chrome but other browsers may have been vulnerable.
What the attacker needed
A Twitch account (anonymous registration allowed); victim uses BTTV extension; victim views chat with malicious message
How it was found
- Send a chat message containing a specially crafted image link that includes HTML and script code.
- The extension detects the link and generates hidden HTML for the preview without proper validation.
- When a BTTV user views the chat, the injected script executes in the context of Twitch.tv.
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 write-up has not been written yet. The Original tab links to the source.
A browser extension called BetterTTV adds features to Twitch chat, including showing previews of image links. It built the preview HTML by inserting the link directly without cleaning it, so a link containing HTML code could run harmful JavaScript in the viewer's browser. This let an attacker who sent a chat message take actions as the viewer on Twitch.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.