Skip to content
XSS Disclosed report Intermediate CVE-2020-8292

Session Hijack via Self-XSS

The drag-and-drop functionality in the chat text box allowed an attacker to trick a user into dropping a malicious image, which executed a Self-XSS payload and sent the user's Meteor.loginToken to the attacker's server. The attacker could then use that token to hijack the user's session and read chats, change some information, and lock the account by enabling two-factor authentication.

jcardona Follow

Originally disclosed on HackerOne

Medium 5.4 View original
  • Triaged in 13 hours
  • Fixed in 4 months
  • Disclosed after 5 months

Summary: It's possible to hijack a session by tricking the user to perform a Self-XSS on the drag and drop functionality in the chat.

Description: Self-XSS is an underrated vulnerability that can have a harmful impact on the users of the application like here, after we get access to the user's session we can read chats, change (some) info and lock the account by activating the 2FA.

Releases Affected:

  • Tested on 3.5.2 and 3.5.3 (current version)

Steps To Reproduce:

  1. Serve the image (payload) using Python's HTTP server.
  2. Trick the user to drag and drop the image inside a chat.
  3. Get the Meteor.loginToken from the server logs.
  4. Open that instance of Rocket Chat in a browser.
  5. Add the Meteor.loginToken as an item in the local storage.
  6. The site automatically redirects to the session.
  7. Profit!

Supporting Material/References:

  • GIF file explaining the PoC.
  • HTML file with the payload.

Suggested mitigation

  • Sanitize the drag and drop functionality of chat text box striping the tags.

Impact

The attacker can gain access to the user session and read chats, change (some) info and lock the account by activating the Two-Factor Authentication, even alter the server configuration depending on the account privileges.

The original report as published on HackerOne, by jcardona. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 drag-and-drop handler did not sanitise the dropped content, allowing script execution.

Impact

The attacker can gain access to the user session and read chats, change (some) info and lock the account by activating the Two-Factor Authentication, even alter the server configuration depending on the account privileges.

What the attacker needed

Victim drags and drops a malicious image; attacker can serve a file; attacker can read server logs

How it was found

  1. Serve the image (payload) using Python's HTTP server.
  2. Trick the user to drag and drop the image inside a chat.
  3. Get the Meteor.loginToken from the server logs.
  4. Open that instance of Rocket Chat in a browser.
  5. Add the Meteor.loginToken as an item in the local storage.
  6. The site automatically redirects to the session.

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.

Self-XSS is when a user is tricked into running malicious code in their own browser, often by pasting or dragging something into a web page. Here, dragging a specially crafted image into the chat box caused the user's login token to be sent to the attacker, who could then use it to take over the account.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Rocket.Chat

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.