CVE-2022-41678
JSON

8.8high

Apache ActiveMQ: Insufficient API restrictions on Jolokia allow authenticated users to perform RCE

Severity
8.8high CVSS:3.1 by NVD
Exploit likelihood
85.8% (higher than 99% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
apache
Also known as
GHSA-53v4-42fg-g287BIT-ACTIVEMQ-2022-41678

Description

Once an user is authenticated on Jolokia, he can potentially trigger arbitrary code execution.  In details, in ActiveMQ configurations, jetty allows org.jolokia.http.AgentServlet to handler request to /api/jolokia org.jolokia.http.HttpRequestHandler#handlePostRequest is able to create JmxRequest through JSONObject. And calls to org.jolokia.http.HttpRequestHandler#executeRequest. Into deeper calling stacks, org.jolokia.handler.ExecHandler#doHandleRequest can be invoked through refection. This could lead to RCE through via various mbeans. One example is unrestricted deserialization in jdk.management.jfr.FlightRecorderMXBeanImpl which exists on Java version above 11. 1 Call newRecording. 2 Call setConfiguration. And a webshell data hides in it. 3 Call startRecording. 4 Call copyTo method. The webshell will be written to a .jsp file. The mitigation is to restrict (by default) the actions authorized on Jolokia, or disable Jolokia. A more restrictive Jolokia configuration has been defined in default ActiveMQ distribution. We encourage users to upgrade to ActiveMQ distributions version including updated Jolokia configuration: 5.16.6, 5.17.4, 5.18.0, 6.0.0.

Affected

Product or packageVersionsReported by
org.apache.activemq:apache-activemqbefore 5.16.6, from 5.17.0 before 5.17.4
Not affected: 5.18.0, 6.0.0
CVE List
org.apache.activemq:apache-activemq (Maven)before 5.16.6, from 5.17.0 before 5.17.4GitHub Advisory Database
apache activemqbefore 5.16.6, from 5.17.0 before 5.17.4NVD
activemq (Bitnami)before 5.16.6, from 5.17.0 before 5.17.4Bitnami Vulnerability Database

All scores

GitHub8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Bitnami Vulnerability Databasehigh rating

Classification

What each source says

CVE List

Once an user is authenticated on Jolokia, he can potentially trigger arbitrary code execution.  In details, in ActiveMQ configurations, jetty allows org.jolokia.http.AgentServlet to handler request to /api/jolokia org.jolokia.http.HttpRequestHandler#handlePostRequest is able to create JmxRequest through JSONObject. And calls to org.jolokia.http.HttpRequestHandler#executeRequest. Into deeper calling stacks, org.jolokia.handler.ExecHandler#doHandleRequest can be invoked through refection. This could lead to RCE through via various mbeans. One example is unrestricted deserialization in jdk.management.jfr.FlightRecorderMXBeanImpl which exists on Java version above 11. 1 Call newRecording. 2 Call setConfiguration. And a webshell data hides in it. 3 Call startRecording. 4 Call copyTo method. The webshell will be written to a .jsp file. The mitigation is to restrict (by default) the actions authorized on Jolokia, or disable Jolokia. A more restrictive Jolokia configuration has been defined in default ActiveMQ distribution. We encourage users to upgrade to ActiveMQ distributions version including updated Jolokia configuration: 5.16.6, 5.17.4, 5.18.0, 6.0.0.

GitHub Advisory Database

Once an user is authenticated on Jolokia, he can potentially trigger arbitrary code execution. 

In details, in ActiveMQ configurations, jetty allows org.jolokia.http.AgentServlet to handler request to /api/jolokia

org.jolokia.http.HttpRequestHandler#handlePostRequest is able to create JmxRequest through JSONObject. And calls to org.jolokia.http.HttpRequestHandler#executeRequest.

Into deeper calling stacks, org.jolokia.handler.ExecHandler#doHandleRequest is able to invoke through refection.

And then, RCE is able to be achieved via jdk.management.jfr.FlightRecorderMXBeanImpl which exists on Java version above 11.

1 Call newRecording.

2 Call setConfiguration. And a webshell data hides in it.

3 Call startRecording.

4 Call copyTo method. The webshell will be written to a .jsp file.

The mitigation is to restrict (by default) the actions authorized on Jolokia, or disable Jolokia. A more restrictive Jolokia configuration has been defined in default ActiveMQ distribution. We encourage users to upgrade to ActiveMQ distributions version including updated Jolokia configuration: 5.16.6, 5.17.4, 5.18.0, 6.0.0.

NVD (es)

Una vez que un usuario se autentica en Jolokia, potencialmente puede desencadenar la ejecución de código arbitrario. En detalles, en las configuraciones de ActiveMQ, jetty permite que org.jolokia.http.AgentServlet maneje la solicitud a /api/jolokia org.jolokia.http.HttpRequestHandler#handlePostRequest puede crear JmxRequest a través de JSONObject. Y llamadas a org.jolokia.http.HttpRequestHandler#executeRequest. En pilas de llamadas más profundas, org.jolokia.handler.ExecHandler#doHandleRequest puede invocar mediante reflexión. Y luego, RCE se puede lograr a través de jdk.management.jfr.FlightRecorderMXBeanImpl que existe en la versión de Java superior a 11. 1 Call newRecording. 2 Call setConfiguration. Y en él se esconden datos de un webshell. 3 Call startRecording. 4 Call copyTo method. El webshell se escribirá en un archivo .jsp. La mitigación es restringir (de forma predeterminada) las acciones autorizadas en Jolokia o desactivar Jolokia. Se ha definido una configuración de Jolokia más restrictiva en la distribución predeterminada de ActiveMQ. Alentamos a los usuarios a actualizar a la versión de distribuciones ActiveMQ, incluida la configuración actualizada de Jolokia: 5.16.6, 5.17.4, 5.18.0, 6.0.0.

References

https://activemq.apache.org/security-advisories.data/CVE-2022-41678-announcement.txtadvisory, vendor-advisory, web
https://lists.apache.org/thread/7g17kwbtjl011mm4tr8bn1vnoq9wh4sladvisory, mailing-list, vendor-advisory, web
https://www.openwall.com/lists/oss-security/2023/11/28/1web
https://security.netapp.com/advisory/ntap-20240216-0004/web
https://lists.debian.org/debian-lts-announce/2024/10/msg00027.htmlweb
https://nvd.nist.gov/vuln/detail/CVE-2022-41678advisory, web
https://github.com/apache/activemq/pull/958web
https://github.com/apache/activemq/commit/5c8d457d9web
https://github.com/apache/activemq/commit/6120169e563b55323352431dfe9ac67a8b4de6c2web
https://github.com/apache/activemq/commit/bf65929fdweb
https://github.com/apache/activemq/commit/d8ce1d9ffweb
https://github.com/apache/activemqpackage

Sources

SourceRecordLicence
CVE ListCVE-2022-41678 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-53v4-42fg-g287 changed 2025-11-04CC-BY-4.0
NVDCVE-2022-41678 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-ACTIVEMQ-2022-41678 changed 2026-09-08Apache-2.0