CVE-2023-38646
📋 TL;DR
CVE-2023-38646 is a critical remote code execution vulnerability in Metabase that allows unauthenticated attackers to execute arbitrary commands on the server with the server's privilege level. This affects all Metabase open source versions before 0.46.6.1 and Metabase Enterprise versions before 1.46.6.1, as well as several other vulnerable versions listed in the advisory.
💻 Affected Systems
- Metabase Open Source
- Metabase Enterprise
📦 What is this software?
Metabase by Metabase
Metabase by Metabase
Metabase by Metabase
Metabase by Metabase
Metabase by Metabase
Metabase by Metabase
Metabase by Metabase
Metabase by Metabase
⚠️ Risk & Real-World Impact
Worst Case
Complete server compromise leading to data theft, lateral movement, ransomware deployment, or persistent backdoor installation.
Likely Case
Attackers gain shell access to the server, exfiltrate database credentials and sensitive data, and potentially pivot to other systems.
If Mitigated
Limited impact due to network segmentation, minimal privileges, and immediate detection/response.
🎯 Exploit Status
Multiple public exploit scripts exist, making this trivial to exploit. The vulnerability has been actively exploited in the wild.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Open Source: 0.46.6.1 or higher; Enterprise: 1.46.6.1 or higher; Also fixed in: 0.45.4.1, 1.45.4.1, 0.44.7.1, 1.44.7.1, 0.43.7.2, 1.43.7.2
Vendor Advisory: https://github.com/metabase/metabase/releases/tag/v0.46.6.1
Restart Required: Yes
Instructions:
1. Backup your Metabase database and configuration. 2. Stop the Metabase service. 3. Update to a patched version using your package manager or by downloading from GitHub releases. 4. Restart the Metabase service. 5. Verify the update was successful.
🔧 Temporary Workarounds
Network Access Restriction
linuxRestrict network access to Metabase instances using firewall rules to only allow trusted IP addresses.
# Example iptables rule for Linux
sudo iptables -A INPUT -p tcp --dport 3000 -s TRUSTED_IP -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3000 -j DROP
Reverse Proxy with Authentication
allPlace Metabase behind a reverse proxy (nginx, Apache) that requires authentication before reaching the application.
# Example nginx basic auth configuration
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://localhost:3000;
}
🧯 If You Can't Patch
- Immediately take Metabase instances offline until patching is possible
- Implement strict network segmentation and firewall rules to isolate Metabase from other systems
🔍 How to Verify
Check if Vulnerable:
Check your Metabase version via the web interface (Settings → About) or by examining the running process. If version is below the patched versions listed, you are vulnerable.
Check Version:
curl -s http://localhost:3000/api/health | grep -o '"version":"[^"]*"'
Verify Fix Applied:
After updating, verify the version shows a patched version (0.46.6.1+, 1.46.6.1+, or other fixed versions). Test that the application functions normally.
📡 Detection & Monitoring
Log Indicators:
- Unusual POST requests to Metabase endpoints
- Suspicious Java process execution
- Error logs containing command execution attempts
Network Indicators:
- Unusual outbound connections from Metabase server
- Traffic to suspicious IPs or domains from Metabase
SIEM Query:
source="metabase.logs" AND ("POST /api/*" OR "java.lang.Runtime.exec" OR "ProcessBuilder")
🔗 References
- http://packetstormsecurity.com/files/174091/Metabase-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/177138/Metabase-0.46.6-Remote-Code-Execution.html
- https://github.com/metabase/metabase/issues/32552
- https://github.com/metabase/metabase/releases/tag/v0.46.6.1
- https://news.ycombinator.com/item?id=36812256
- https://www.metabase.com/blog/security-advisory
- http://packetstormsecurity.com/files/174091/Metabase-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/177138/Metabase-0.46.6-Remote-Code-Execution.html
- https://github.com/metabase/metabase/issues/32552
- https://github.com/metabase/metabase/releases/tag/v0.46.6.1
- https://news.ycombinator.com/item?id=36812256
- https://www.metabase.com/blog/security-advisory