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.

