Insecure use of shell.openExternal() leads to RCE in Rocket.Chat-Desktop
Rocket.Chat-Desktop passed a URL parameter from its internal API to the operating system's external URL opener without validation. An attacker who could run script in the client could use this to launch a local program and execute code.
- Triaged in 14 days
- Fixed in 14 days
- Disclosed after 16 days
Summary by the program
Rocket.Chat-Desktop passes the parameter url of openInternalVideoChatWindow to shell.openExternal(), which may lead to remote code execution (internalVideoChatWindow.ts#L17). To exploit the vulnerability, the internal video chat window must be disabled or a Mac App Store build must be used (internalVideoChatWindow.ts#L14). The vulnerability may be exploited by an XSS attack because the function openInternalVideoChatWindow is exposed in the Rocket.Chat-Desktop-API.
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 app passed an untrusted URL straight to the operating system's external URL handler without restricting the scheme or target.
Impact
An attacker could achieve remote code execution, but only when the internal video chat window is disabled or a Mac App Store build is used, and it requires an XSS first.
What the attacker needed
Internal video chat window disabled or Mac App Store build; ability to run script in the client (XSS)
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.
Desktop apps can ask the operating system to open a link in the default browser. If the app does not check what kind of link it is, a malicious link can start a program on the computer instead. Here, a script running inside the chat client could abuse that to run code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.