CVE-2021-22910
📋 TL;DR
A NoSQL injection vulnerability in Rocket.Chat server allows attackers to execute arbitrary database queries through a specific endpoint. This can lead to remote code execution (RCE) by manipulating query parameters. Affects Rocket.Chat servers running vulnerable versions without proper input sanitization.
💻 Affected Systems
- Rocket.Chat
📦 What is this software?
Rocket.chat by Rocket.chat
Rocket.chat by Rocket.chat
Rocket.chat by Rocket.chat
⚠️ Risk & Real-World Impact
Worst Case
Full server compromise with remote code execution, data exfiltration, and lateral movement within the network.
Likely Case
Unauthorized data access, privilege escalation, and potential RCE depending on server configuration.
If Mitigated
Limited impact with proper input validation and network segmentation, potentially only data exposure.
🎯 Exploit Status
Exploitation requires some technical knowledge but detailed public analysis exists. Authentication is typically required to reach the vulnerable endpoint.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.13.2, 3.12.4, or 3.11.4
Vendor Advisory: https://github.com/RocketChat/Rocket.Chat/releases
Restart Required: Yes
Instructions:
1. Backup your Rocket.Chat instance. 2. Update to version 3.13.2, 3.12.4, or 3.11.4 using your package manager or deployment method. 3. Restart the Rocket.Chat service. 4. Verify the update was successful.
🔧 Temporary Workarounds
Input Validation Enhancement
allImplement additional input validation for the vulnerable endpoint to sanitize query parameters.
Network Access Restriction
allRestrict access to the vulnerable endpoint using network firewalls or web application firewalls.
🧯 If You Can't Patch
- Implement strict input validation and sanitization for all user inputs
- Deploy a web application firewall (WAF) with NoSQL injection protection rules
🔍 How to Verify
Check if Vulnerable:
Check Rocket.Chat version via admin panel or by running: node -e "console.log(require('./package.json').version)" in Rocket.Chat directory
Check Version:
node -e "console.log(require('./package.json').version)"
Verify Fix Applied:
Confirm version is 3.13.2, 3.12.4, or 3.11.4 or higher using the same command
📡 Detection & Monitoring
Log Indicators:
- Unusual database queries in logs
- Multiple failed authentication attempts followed by successful exploitation
- Abnormal patterns in API endpoint access
Network Indicators:
- Suspicious payloads in HTTP requests to Rocket.Chat endpoints
- Unusual outbound connections from Rocket.Chat server
SIEM Query:
source="rocketchat" AND (http_uri="*vulnerable-endpoint*" AND http_query="*$regex*" OR http_query="*$where*")