/

CVE-2021-48022

Severity:

HIGH RISK

(7.5)

Authorization Bypass (CWE-639) in Rocket.Chat Livechat

CVE-2021-48022

Awaiting Analysis

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-639

Impact:

Unauthorized disclosure of room messages

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Rocket.Chat's livechat history method does not adequately check whether a requester is authorized to view a room's messages. An unauthenticated attacker who can obtain a guest token may use the method to access message history for rooms they do not belong to.

Affected context

The issue affects Rocket.Chat's livechat history functionality, specifically the livechat:loadHistory Meteor method. It applies to the version ranges described for Rocket.Chat 0.61.0 before 3.11.4, 3.12.x before 3.12.4, and 3.13.x before 3.13.2. The risk arises when the method accepts a target room identifier without enforcing membership or equivalent authorization checks.

Exploit preconditions

  • Attack surface: The livechat history method exposed through the application API
  • Required access: No authenticated account is required; an attacker must be able to obtain a guest token
  • Trigger point: A request to load message history for a specified room
  • Why exploitation is possible: The target room identifier is not adequately bound to an authorization check, allowing requests for rooms the guest does not belong to

Why this happens

The underlying bug is a failure to authorize access to a resource identified by a user-supplied room ID. This maps to CWE-639: Authorization Bypass Through User-Controlled Key. The insecure pattern is retrieving sensitive room data using a supplied identifier without confirming that the requester has permission to access that specific room.

Potential impact

  • An attacker may read message history from rooms they are not authorized to access.
  • Private or sensitive conversations could be exposed.
  • Disclosed messages could be used for further social engineering or operational targeting.

General mitigation guidance

Mitigations generally focus on enforcing authorization at the point where each resource is accessed.

Common defensive patterns include:

  • Checking room membership or an equivalent explicit permission before returning messages.
  • Deriving accessible room identifiers from the authenticated or guest session rather than trusting caller-supplied identifiers.
  • Applying consistent access-control checks across API and Meteor method entry points.
  • Limiting guest capabilities and applying least privilege to guest sessions.
  • Returning only the minimum data necessary for the authorized request.

How teams detect issues like this

High-level detection approaches include:

  • Reviewing message-history handlers for resource lookups based on caller-supplied room IDs without corresponding authorization checks.
  • Using static analysis or code review rules to flag access to sensitive records where ownership or membership checks are absent.
  • Testing access-control policies to confirm that guest sessions cannot retrieve history for unrelated rooms.
  • Monitoring API and method-call logs for guest requests targeting rooms outside the session's permitted scope.
  • Enforcing centralized authorization policies for all message-history access paths.

Sources

SourceLink
github.comgithub.com/RocketChat/Rocket.Chat/commit/9e63222893
github.comgithub.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/rocketchat/unauth-message-read.yaml
securifyinc.comsecurifyinc.com/disclosures/rocketchat-unauthenticated-access-to-messages
vulncheck.comvulncheck.com/advisories/rocket-chat-3.13.2-unauthenticated-idor-via-livechat-loadhistory
vulncheck.comvulncheck.com/advisories/rocket-chat-before-3.13.2-unauthenticated-idor-via-livechat-loadhistory

Frequently asked

questions

Yes. The vulnerability allows unauthenticated access when an attacker can obtain a guest token and the history method fails to verify access to the target room.

No authenticated account is required. The relevant access condition is the ability to obtain a guest token and reach the exposed method.

Enforce authorization for the specific room before returning its messages, and avoid relying on a caller-provided room identifier as proof of access.

Apply centralized, consistent access-control checks to resource lookups, restrict guest privileges, and test that users and guests cannot access resources outside their permitted scope.

Find out what's already
exploitable in your codebase.