/

CVE-2026-48616

Severity:

CRITICAL RISK

(9.3)

Access Control Flaw (CWE-284) in Rocket.Chat Livechat

CVE-2026-48616

Analyzed

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-284

Impact:

Unauthorized File Access and Data Exposure

Severity:

CRITICAL RISK

(9.3)

CVSS version:

3.0

Catch this CVE while code is being written

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

Summary

A broken access control issue in Rocket.Chat Livechat allows unauthorized access to uploaded files via the /file-upload/:fileId/:name endpoint. Because room identifiers are not properly checked and file IDs are predictable, attackers can enumerate and download files without authentication.

This becomes particularly risky in deployments where Livechat is used to exchange sensitive documents, as any unauthenticated party can systematically discover and retrieve stored uploads.

Affected context

The vulnerability occurs in Rocket.Chat instances exposing the Livechat feature and its file upload functionality.

Specifically, the /file-upload/:fileId/:name route authorizes access using rc_room_type=l with rc_rid and rc_token, but does not confirm that the rc_rid associated with the token matches the room that owns the requested file.

Additionally, the :fileId path parameter is based on sequential MongoDB identifiers, and the :name segment is not validated against the stored filename.

In environments where Livechat is used for customer support or external interactions, this weak linkage between authorization and resource ownership can expose uploaded files to the internet.

Exploit preconditions

  • Attack surface: Publicly accessible Rocket.Chat servers with Livechat enabled and /file-upload/:fileId/:name reachable from untrusted networks.
  • Required access: No authenticated user session is strictly required if the endpoint accepts rc_room_type=l, rc_rid, and rc_token without robust cross-checking; an attacker only needs network access to the service.
  • Trigger point: Direct HTTP requests to the file download endpoint using guessed or iterated :fileId values and arbitrary :name values.
  • Why exploitation is possible: The authorization path checks presence of Livechat-related parameters but does not ensure that the supplied rc_rid corresponds to the file's actual room ID. Combined with predictable, sequential MongoDB-based file IDs and a non-validated :name, this allows enumeration and access to files that should be bound to specific Livechat sessions.

Why this happens

This issue stems from incomplete enforcement of object-level access control on file resources, mapping to CWE-284: Improper Access Control.

The application authorizes file downloads based on generic Livechat parameters but fails to bind the authorization decision to the specific resource being accessed: there is no strict check that the rc_rid and rc_token belong to the room that owns the requested fileId.

At the same time, the design exposes a predictable identifier (:fileId as a sequential MongoDB ID) and treats the :name path parameter as cosmetic, which further weakens security by enabling enumeration.

Conceptually, this reflects a pattern where resource identifiers are guessable and the authorization layer validates session or room presence but not resource ownership, leaving files effectively unprotected against systematic probing.

Potential impact

  • Unauthorized download of all Livechat-uploaded files, including potentially sensitive documents.
  • Exposure of customer support transcripts, attachments, IDs, or confidential business materials.
  • Privacy violations affecting users who shared personal or regulated data via Livechat.
  • Facilitation of social engineering or further attacks using leaked internal information.
  • Reputational damage and potential regulatory impact due to uncontrolled data disclosure.

General mitigation guidance

Effective mitigation focuses on strengthening object-level access control and reducing the exposure of predictable identifiers.

Recommended defensive patterns include:

  • Ensuring that file download handlers always validate that the requesting principal (user, room, or token) is authorized for the specific file resource, not just for any Livechat context.
  • Binding file metadata to a specific room or session and enforcing that the rc_rid and rc_token match the owning room before returning content.
  • Avoiding sequential or easily guessable identifiers for externally exposed file IDs; using opaque, high-entropy tokens or UUIDs instead.
  • Treating URL components like :name as untrusted, validating them against stored metadata, or making them non-authoritative for resource selection.
  • Applying least-privilege principles so that publicly accessible endpoints are restricted to the minimal data required for their function and are not reused as generic file gateways.

How teams detect issues like this

Detection efforts can focus on both code-level and runtime signals:

  • Static analysis and review: Look for file download routes that:
  • Accept resource identifiers via URL path parameters without coupling them to strong authorization checks.
  • Use predictable identifiers (e.g., raw database IDs) in public URLs.
  • Rely on generic checks (such as presence of a room token) rather than validating that the identifier belongs to the caller's context.
  • Code review heuristics: Flag endpoints under patterns like /file-upload/:fileId/:name where:
  • Authorization logic is implemented separately from resource lookups.
  • There is no explicit comparison between a room/session ID and the file's stored room/session ID.
  • Runtime monitoring: Analyze access logs for:
  • Sequential or wide-range iteration of fileId values from a single IP or user agent.
  • High volumes of 404 or 403 responses followed by successful file downloads, indicating probing.
  • Automated tooling: Use API security scanners or custom scripts to test file endpoints for ID enumeration and missing object-level authorization, integrating results into CI/CD security gates where possible.

Sources

SourceLink
github.comgithub.com/RocketChat/Rocket.Chat/pull/40889
hackerone.comhackerone.com/reports/3687142

Frequently asked

questions

Yes, if the Rocket.Chat Livechat endpoint and its file download route are exposed to the internet, remote attackers with only network access can attempt to enumerate and retrieve uploaded files.

Not necessarily. Because the authorization logic does not properly tie room identifiers to the requested file and the file IDs are predictable, an attacker may be able to access files without a valid user account, depending on how Livechat tokens are handled in the specific deployment.

The robust fix is to implement strict object-level authorization: every file download must verify that the caller (via user identity, room ID, or token) is explicitly associated with the file's owning room or session, and to replace predictable file IDs with opaque, non-guessable identifiers in public URLs.

Design APIs so that resource identifiers used in public endpoints are non-enumerable, and enforce authorization at the resource level, not just at the feature or session level. Incorporate security reviews for all file and attachment endpoints, use automated checks to detect IDOR-like patterns, and standardize access control libraries that couple resource retrieval with permission checks by default.

Find out what's already
exploitable in your codebase.