CVE-2021-26919
📋 TL;DR
CVE-2021-26919 is a remote code execution vulnerability in Apache Druid's JDBC integration with MySQL. Attackers can exploit certain MySQL JDBC driver properties to execute arbitrary code on Druid servers by connecting to a malicious MySQL server. This affects Druid deployments where users have JDBC lookup or ingestion task permissions.
💻 Affected Systems
- Apache Druid
📦 What is this software?
Druid by Apache
⚠️ Risk & Real-World Impact
Worst Case
Full compromise of Druid server with attacker gaining complete control over server processes, allowing data theft, system takeover, and lateral movement.
Likely Case
Remote code execution leading to data exfiltration, service disruption, and potential ransomware deployment.
If Mitigated
Limited impact with proper network segmentation and access controls preventing connections to untrusted MySQL servers.
🎯 Exploit Status
Exploitation requires authenticated access to Druid with JDBC permissions and ability to connect to attacker-controlled MySQL server. The vulnerability is in the MySQL JDBC driver property handling.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Apache Druid 0.20.2
Vendor Advisory: https://lists.apache.org/thread.html/r443e2916c612fbd119839c0fc0729327d6031913a75081adac5b43ad%40%3Cdev.druid.apache.org%3E
Restart Required: Yes
Instructions:
1. Backup Druid configuration and data. 2. Download Apache Druid 0.20.2 or later from official site. 3. Stop Druid services. 4. Replace existing installation with patched version. 5. Restart Druid services. 6. Verify functionality.
🔧 Temporary Workarounds
Disable JDBC functionality
allRemove or restrict JDBC lookup and ingestion capabilities if not required
Configure Druid to disable JDBC extensions or remove JDBC permissions from users
Network segmentation
allRestrict Druid server network access to trusted MySQL servers only
Configure firewall rules to allow Druid->MySQL connections only to approved IPs
🧯 If You Can't Patch
- Implement strict network controls allowing Druid to connect only to trusted, internal MySQL servers
- Remove JDBC permissions from all Druid users and disable JDBC extensions in configuration
🔍 How to Verify
Check if Vulnerable:
Check Druid version and verify if JDBC functionality is enabled in configuration files
Check Version:
Check Druid logs or run: java -jar druid.jar --version (or check version in web UI)
Verify Fix Applied:
Confirm Druid version is 0.20.2 or later and test JDBC connections to ensure they work properly
📡 Detection & Monitoring
Log Indicators:
- Unusual JDBC connection attempts to external MySQL servers
- Errors in Druid logs related to MySQL JDBC driver properties
Network Indicators:
- Druid servers initiating connections to unknown MySQL servers on port 3306
- Unusual outbound traffic from Druid to external IPs
SIEM Query:
source="druid.logs" AND ("JDBC" OR "MySQL") AND ("connection" OR "property")
🔗 References
- https://lists.apache.org/thread.html/r443e2916c612fbd119839c0fc0729327d6031913a75081adac5b43ad%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/r470f8c92eb5df45f41b3ae609b6315b6c5ff51b3ceb2f09f00ca620f%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/r6bc68264170046448f823d12c17fd1fd875251d97d60869f58709872%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/r7a531ec123570cb7875ff991cf115f99e9ef99a48b3cf3fa4f9d9864%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/ra85fa7d31f9bec1148ffd2e4030934927caa8bff89bca9f61f75e697%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/rd87451fce34df54796e66321c40d743a68fb4553d72e7f6f0bc62ebd%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/re0910cf4c784897774427fecd95912fb565a6bd06d924a55e70bbbfc%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/re4c5deb0aae4bace69844d15c9fd1699e907ebfee93bc3926474d110%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/rf3ea2a4018e87e6c45d36cf8479af7727dcc276edabd2f7cf59e0c5f%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/r443e2916c612fbd119839c0fc0729327d6031913a75081adac5b43ad%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/r470f8c92eb5df45f41b3ae609b6315b6c5ff51b3ceb2f09f00ca620f%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/r6bc68264170046448f823d12c17fd1fd875251d97d60869f58709872%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/r7a531ec123570cb7875ff991cf115f99e9ef99a48b3cf3fa4f9d9864%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/ra85fa7d31f9bec1148ffd2e4030934927caa8bff89bca9f61f75e697%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/rd87451fce34df54796e66321c40d743a68fb4553d72e7f6f0bc62ebd%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/re0910cf4c784897774427fecd95912fb565a6bd06d924a55e70bbbfc%40%3Ccommits.druid.apache.org%3E
- https://lists.apache.org/thread.html/re4c5deb0aae4bace69844d15c9fd1699e907ebfee93bc3926474d110%40%3Cdev.druid.apache.org%3E
- https://lists.apache.org/thread.html/rf3ea2a4018e87e6c45d36cf8479af7727dcc276edabd2f7cf59e0c5f%40%3Cdev.druid.apache.org%3E