Skip to content
XSS Write-up Advanced

XSS to RCE in Atlassian Hipchat

The HipChat desktop and mobile clients incorrectly parsed URLs, turning text with a javascript: protocol into clickable links, leading to cross-site scripting. An attacker could exploit this to read local files or, on OS X, achieve remote code execution by combining the XSS with a file:// or ftp:// protocol handler.

Matt Austin Follow

Published on maustin.net

Two issues exist in Atlassian’s HipChat desktop client that allow an attacker to retrieve files or execute remote code when a user clicks on a cleverly crafted URL. This vulnerability works against OS X version 3.0.6 (132), iOS 2.3.3 (20307) and potentially others.

Matt Austin (@mattaustin), on maustin.net

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

The client's URL parser incorrectly converted text matching a protocol-like pattern into clickable links without proper sanitisation, and the OS protocol handler allowed execution of local files.

Impact

An attacker could execute remote code on OS X or steal local files on both OS X and iOS when a user clicks a crafted link.

What the attacker needed

Victim uses HipChat desktop or mobile; victim clicks a crafted link

The fix

The bug was fixed in a later desktop version, but the report notes the app still does not handle protocols correctly.

How it was found

  1. Craft a message containing a javascript: URL that starts with a comment and newline to bypass the required slash.
  2. Send the message to a victim; the client turns it into a clickable link.
  3. When the victim clicks the link, the JavaScript executes in the embedded Webkit engine.
  4. Use the JavaScript to redirect to a file:// URL or an ftp:// URL that mounts a remote volume.
  5. For RCE, host a malicious .terminal file on an FTP server and use the XSS to open it, causing Terminal.app to execute a startup command.

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.

HipChat is a chat app that shows messages. It mistakenly turned text like 'javascript:...' into clickable links. When a user clicked such a link, harmful code ran inside the app, letting an attacker read files or run programs on the user's 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 Matt Austin

View all

5 more disclosed reports, best first.

More from Atlassian

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.