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
- Attacker sends a forged password reset request to a target user via the Rocket.Chat API.
- Attacker uses a blind NoSQL injection payload targeting the
getPasswordPolicymethod with the$regexoperator to brute-force the password reset token character-by-character. - Attacker uses the discovered token to reset the target user's password.
- Attacker repeats the process to compromise an administrator account.
- Attacker authenticates as the administrator.
- Attacker creates a new webhook integration and injects a JavaScript payload that utilizes
child_process.exec()to spawn a reverse shell. - 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
- Upgrade Rocket.Chat instances immediately to version 3.12.7 or later.
- Identify and audit existing webhook integrations for unauthorized or suspicious JavaScript content.
- Deploy web application firewall (WAF) rules to detect and block NoSQL injection patterns, specifically targeting requests to the
getPasswordPolicymethod containing$regexor other database operator syntax. - 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
Threat Hunt
Audit Rocket.Chat for recently created or modified webhooks
Data: Rocket.Chat application audit logs, Webhook configuration database records
Mitigations
Upgrade Rocket.Chat to 3.12.7 or later
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
criticalDetects potential exploitation of CVE-2021-22911 by monitoring web server logs for malicious JSON payloads containing NoSQL operators targeting the getPasswordPolicy method.
Detection queries are available on the platform. Get full rules →