CVE-2023-51388

9.8 CRITICAL

📋 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

Products:
  • Hertzbeat
Versions: All versions before 1.4.1
Operating Systems: All platforms running Hertzbeat
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments using the vulnerable CalculateAlarm.java component are affected regardless of configuration.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH - Directly exploitable if exposed to internet without authentication requirements.
🏢 Internal Only: HIGH - Even internal systems are vulnerable to authenticated or network-accessible attacks.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

linux

Restrict 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

all

Temporarily 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

📤 Share & Export