Skip to content
XSS Disclosed report Intermediate

Impersonation in Sequential Messages

Sequential messages from the same user are rendered without repeating author info, and an attacker can use a custom CSS class to hide their first message so that a second message appears to be written by the previous author. This allows impersonation of another user in the chat timeline.

gronke Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • Triaged in 46 days
  • Fixed in 7 months
  • Disclosed after 2.8 years

Summary

Sequential messages can be used to impersonate another user by hiding the leading message.

Description

Sequential messages posted by the same user on the same date are rendered without repeating the author information and timestamp.

An adversary can use customClass or className message attributes to hide the initial message of a new author from the timeline, so that the second message appears to be written by a differnet author.

JavaScript
const rid = "<Room ID>";
const msg = "This message was written by somebody else";
Meteor.call("sendMessage", {
  msg: "will be hidden",
  rid: rid,
  customClass: "rc-popover"
}, () =>  Meteor.call("sendMessage", { msg, rid }));

Releases Affected:

  • 3.18.2
  • 4.0.3

Steps To Reproduce (from initial installation to vulnerability):

  1. Login to Rocket.Chat
  2. Identify target Room
  3. Send hidden message (customClass: "rc-popover")
  4. Send target message
  5. UI will render the target message as written by the previous messages author

Supporting Material/References

RC-sequential-message-impersonation.png
RC-sequential-message-impersonation.png From the original on HackerOne

Suggested mitigation

  • Mitigate CSS Injection in messages
  • Indiate a messages author in the channel UI

Impact

Adversaries can send messages that appear to be written by a different user.

The original report as published on HackerOne, by gronke. 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 message rendering logic groups sequential messages by author without verifying that the first message is actually visible, and it allows user-controlled CSS classes that can hide messages.

Impact

Adversaries can send messages that appear to be written by a different user, potentially deceiving others in the chat.

What the attacker needed

A Rocket.Chat account; access to the target room

The fix

The report suggests mitigating CSS injection in messages and indicating a message's author in the channel UI.

How it was found

  1. Log in to Rocket.Chat.
  2. Identify the target room.
  3. Send a hidden message using a custom CSS class.
  4. Send the target message.
  5. The UI renders the target message as written by the previous message's author.

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.

In chat apps, when the same person sends several messages in a row, the app often shows their name only once to save space. This report shows that an attacker can send a first message that is invisible because of a styling trick, then send a second message. The app then thinks both messages are from the same person and shows the second message under the previous person's name, making it look like that person said it.

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 gronke

View all

27 more disclosed reports, best first.

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.