Rocket.Chat Cross-Site Scripting leading to Remote Code Execution CVE-2020-15926
A crafted chat message was rendered unsafely when a victim used the Reply in Thread feature, letting the sender run JavaScript in the victim's browser or desktop client. On the Electron desktop client this cross-site scripting could be escalated to running arbitrary code on the victim's machine.
Published on blog.redteam.pl
Rocket.Chat [https://rocket.chat] is an open source multiplatform messaging application similar to Slack. It is available as a self-hosted solution or in a SaaS model.
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 thread reply view rendered message content without proper sanitisation, and the desktop client's link handling could be tricked into opening local file paths.
Impact
An attacker could steal a user's session token in web and desktop clients, and on the Electron desktop client could run arbitrary code on the victim's machine; mobile clients were not affected.
What the attacker needed
Ability to send a message to the victim; victim opens Reply in Thread; desktop client for the RCE part
The fix
The issue was fixed in Rocket.Chat 3.5.0 and 3.4.3.
How it was found
- Send a crafted message to a channel or as a direct message.
- Have the victim open the Reply in Thread view for that message.
- The injected script runs in the victim's client.
- On the desktop client, the script abuses link handling to launch a local application.
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.
Rocket.Chat is a chat app. A sender could put code into a message that the app displayed as if it were part of the page, so the code ran inside the victim's app when they opened the thread reply view. In the desktop app this let the attacker run programs on the victim's computer, not just in the chat window.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.