CVE-2023-51653
📋 TL;DR
This vulnerability in Hertzbeat allows remote code execution via JNDI injection in the JMX connector implementation. Attackers can exploit the /api/monitor/detect interface by providing a malicious JMX URL, leading to complete system compromise. All Hertzbeat deployments with the vulnerable version are affected.
💻 Affected Systems
- Hertzbeat
📦 What is this software?
Hertzbeat by Apache
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise with attacker gaining complete control over the server, allowing data theft, lateral movement, and persistent backdoor installation.
Likely Case
Remote code execution leading to service disruption, data exfiltration, and potential ransomware deployment.
If Mitigated
Limited impact if network segmentation prevents external access and proper input validation is implemented.
🎯 Exploit Status
Exploitation requires crafting a malicious JMX URL but is straightforward for attackers familiar with JNDI injection techniques.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.4.1
Vendor Advisory: https://github.com/dromara/hertzbeat/security/advisories/GHSA-gcmp-vf6v-59gg
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 fix is applied.
🔧 Temporary Workarounds
Disable JMX monitoring endpoint
allRemove or restrict access to the vulnerable /api/monitor/detect endpoint
Configure web server/application firewall to block /api/monitor/detect
Network segmentation
linuxRestrict network access to Hertzbeat instance
iptables -A INPUT -p tcp --dport [hertzbeat-port] -s [trusted-networks] -j ACCEPT
iptables -A INPUT -p tcp --dport [hertzbeat-port] -j DROP
🧯 If You Can't Patch
- Implement strict network access controls to limit who can reach the Hertzbeat instance
- Deploy a WAF with rules to detect and block JNDI injection attempts
🔍 How to Verify
Check if Vulnerable:
Check if Hertzbeat version is below 1.4.1 and the /api/monitor/detect endpoint is accessible
Check Version:
Check application logs or run: java -jar hertzbeat.jar --version
Verify Fix Applied:
Confirm version is 1.4.1 or higher and test that JNDI injection attempts are rejected
📡 Detection & Monitoring
Log Indicators:
- JNDI lookup attempts in logs
- JMX connection attempts with suspicious URLs
- Unexpected process execution
Network Indicators:
- HTTP POST requests to /api/monitor/detect with JMX URLs
- Outbound LDAP/RMI connections from Hertzbeat
SIEM Query:
source="hertzbeat" AND (uri="/api/monitor/detect" AND (url="*jndi*" OR url="*rmi://*" OR url="*ldap://*"))
🔗 References
- https://github.com/dromara/hertzbeat/commit/f794b0d82be49c596c04a042976446559eb315ef
- https://github.com/dromara/hertzbeat/security/advisories/GHSA-gcmp-vf6v-59gg
- https://github.com/dromara/hertzbeat/commit/f794b0d82be49c596c04a042976446559eb315ef
- https://github.com/dromara/hertzbeat/security/advisories/GHSA-gcmp-vf6v-59gg