Skip to content
Threat Feed
critical advisory

Rocket.Chat: Unauthenticated NoSQL Injection and Remote Code Execution (CVE-2021-22911)

A critical unauthenticated NoSQL injection vulnerability in Rocket.Chat versions prior to 3.12.7 allows attackers to reset administrator credentials and achieve remote code execution via malicious webhook integration scripts.

CVE search metadata

CVE search record: CVE-2021-22911. Severity: critical. CVSS: 9.8. EPSS: 95.24%. KEV: no. Product: Rocket.Chat (< 3.12.7). Brief: Rocket.Chat: Unauthenticated NoSQL Injection and Remote Code Execution (CVE-2021-22911). Brief link: https://feed.craftedsignal.io/briefs/2026-10-rocketchat-cve-2021-22911/

Triage facts

Revision 1
Applicability
Rocket.Chat (< 3.12.7)
Evidence
Unknown
Severity
Critical
Action
Immediate escalation
Sources
3 public sources
Freshness
Revision 1Oct 28, 21:28 UTC
Detection
1 rule
Vulnerabilities
1 CVE
Source quality
B2Very likely

CVE-2021-22911 is a critical vulnerability affecting Rocket.Chat versions prior to 3.12.7. The vulnerability resides in the NoSQL database queries used for password resets. An unauthenticated attacker can exploit this via blind NoSQL injection to extract password reset tokens for any user, including administrators. Successful exploitation leads to administrative account takeover and subsequent remote code execution (RCE) by leveraging the application's webhook feature to run arbitrary JavaScript payloads within the Node.js runtime environment. Public exploit code is now available, significantly increasing exploitation risk.

Attack Chain

  1. Attacker sends a forged password reset request to a target user via the Rocket.Chat API.
  2. Attacker uses a blind NoSQL injection payload targeting the getPasswordPolicy method with the $regex operator to brute-force the password reset token character-by-character.
  3. Attacker uses the discovered token to reset the target user's password.
  4. Attacker repeats the process to compromise an administrator account.
  5. Attacker authenticates as the administrator.
  6. Attacker creates a new webhook integration and injects a JavaScript payload that utilizes child_process.exec() to spawn a reverse shell.
  7. Attacker triggers the webhook, resulting in the execution of the reverse shell and full system compromise.

Impact

Successful exploitation results in full application compromise, including unauthorized access to sensitive user data, administrative control, and the ability to execute arbitrary system commands on the server hosting the Rocket.Chat instance.

Recommendation

  1. Upgrade Rocket.Chat instances immediately to version 3.12.7 or later.
  2. Identify and audit existing webhook integrations for unauthorized or suspicious JavaScript content.
  3. Deploy web application firewall (WAF) rules to detect and block NoSQL injection patterns, specifically targeting requests to the getPasswordPolicy method containing $regex or other database operator syntax.
  4. Hunt for evidence of unauthorized account password resets and newly created webhook integrations in application logs.

Immediate actions

Upgrade Rocket.Chat to 3.12.7 or later

IT Operations 24h

Threat Hunt

Audit Rocket.Chat for recently created or modified webhooks

T1505.002 high high confidence hunt now

Data: Rocket.Chat application audit logs, Webhook configuration database records

Mitigations

Upgrade Rocket.Chat to 3.12.7 or later

immediate IT Operations

CVE-2021-22911

Gaps

  • Lack of visibility into deep payload content if request bodies are not logged

Detection coverage 1

Detect CVE-2021-22911 Exploitation - NoSQL Injection via getPasswordPolicy

critical

Detects potential exploitation of CVE-2021-22911 by monitoring web server logs for malicious JSON payloads containing NoSQL operators targeting the getPasswordPolicy method.

sigma tactics: initial_access techniques: T1190 sources: webserver

Detection queries are available on the platform. Get full rules →