CVE-2023-51388
📋 TL;DR
This vulnerability allows remote code execution in Hertzbeat monitoring systems through AviatorScript injection. Attackers can execute arbitrary static methods by exploiting the unsecured expression evaluation in CalculateAlarm.java. All users running vulnerable versions are affected.
💻 Affected Systems
- Hertzbeat
📦 What is this software?
Hertzbeat by Apache
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise allowing attackers to execute arbitrary code, access sensitive data, and potentially pivot to other systems.
Likely Case
Remote code execution leading to data theft, system manipulation, or deployment of malware/ransomware.
If Mitigated
Limited impact with proper network segmentation and access controls, but still significant risk if exploited.
🎯 Exploit Status
The vulnerability is straightforward to exploit as it involves script injection without authentication requirements.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.4.1
Vendor Advisory: https://github.com/dromara/hertzbeat/security/advisories/GHSA-mcqg-gqxr-hqgj
Restart Required: Yes
Instructions:
1. Backup your configuration and data. 2. Stop Hertzbeat service. 3. Update to version 1.4.1 or later. 4. Restart the service. 5. Verify the update was successful.
🔧 Temporary Workarounds
Network Isolation
linuxRestrict network access to Hertzbeat instances to only trusted sources
iptables -A INPUT -p tcp --dport [hertzbeat_port] -s [trusted_ip] -j ACCEPT
iptables -A INPUT -p tcp --dport [hertzbeat_port] -j DROP
Disable Vulnerable Component
allTemporarily disable alarm calculation features if not critical
🧯 If You Can't Patch
- Implement strict network access controls and firewall rules to limit exposure
- Monitor for suspicious activity and implement application-level WAF rules to block script injection attempts
🔍 How to Verify
Check if Vulnerable:
Check if running Hertzbeat version earlier than 1.4.1 by examining version files or application logs
Check Version:
grep -r 'version' /path/to/hertzbeat/ | grep -i '1\.'
Verify Fix Applied:
Confirm version is 1.4.1 or later and test alarm calculation functionality works without security issues
📡 Detection & Monitoring
Log Indicators:
- Unusual AviatorScript execution patterns
- Suspicious method invocations in alarm calculations
- Error logs related to expression evaluation
Network Indicators:
- Unexpected outbound connections from Hertzbeat instances
- Unusual payloads in HTTP requests to Hertzbeat API endpoints
SIEM Query:
source="hertzbeat" AND ("CalculateAlarm" OR "AviatorEvaluator") AND (status="error" OR method="*java.lang.Runtime*" OR method="*System.*")
🔗 References
- https://github.com/dromara/hertzbeat/commit/8dcf050e27ca95d15460a7ba98a3df8a9cd1d3d2
- https://github.com/dromara/hertzbeat/security/advisories/GHSA-mcqg-gqxr-hqgj
- https://github.com/dromara/hertzbeat/commit/8dcf050e27ca95d15460a7ba98a3df8a9cd1d3d2
- https://github.com/dromara/hertzbeat/security/advisories/GHSA-mcqg-gqxr-hqgj