Skip to content
Access control Write-up Intermediate

RocketChat - Monitor User Messages

An unauthenticated user could call the canAccessRoom method with a guessed room ID and a user ID to read the last message of any room, including private direct messages. This allowed monitoring of messages sent to channels without authentication.

Rojan Rijal Follow

Published on securifyinc.com

Written by Rojan Rijal

Rojan Rijal (@uraniumhacker), on securifyinc.com

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 canAccessRoom method accepted a userID parameter from the request instead of deriving it from the authenticated session, and did not verify that the caller had permission to query messages for that user.

Impact

An unauthenticated attacker could read the last message of any room, including private direct messages, and could use a script to monitor messages sent to channels.

What the attacker needed

No authentication required; knowledge of a room ID (rid); knowledge of a user ID

The fix

The vulnerability was fixed in version 4.1.1.

How it was found

  1. Identify the canAccessRoom method as lacking authentication checks.
  2. Call canAccessRoom with a room ID (rid) and a user ID.
  3. Observe that the last message of the room is returned without authentication.

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 where rooms (channels or direct messages) have IDs. Some room IDs are easy to guess, like 'GENERAL' for the general channel. The app had a function that checked if a user could access a room, but it trusted a user ID supplied by the caller instead of checking who was logged in. So anyone could ask for the last message of any room by providing a room ID and a user ID, without logging in.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Rojan Rijal

View all

20 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.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.