Vulnerability · Published Nov 28, 2023 · Assigned by apache

CVE-2022-41678Apache ActiveMQ: Insufficient API restrictions on Jolokia allow authenticated users to perform RCE

High 8.8

In plain English

A high-severity improper authentication in Apache ActiveMQ from Apache Software Foundation. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 85.7% (higher than 99.7% of all known vulnerabilities). Ready-made attack tooling exists: Nuclei, public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)8.8High
Exploit odds (30 days)85.7%top 0.3% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack tooling2Nuclei, Public PoC

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12activemq5.17.2+dfsg-2+deb12u1DEBIAN-CVE-2022-41678
Debian:12activemq5.17.2+dfsg-2+deb12u1DSA-5798-1
Debian:13activemq5.17.6+dfsg-1DEBIAN-CVE-2022-41678
Mavenorg.apache.activemq:apache-activemq5.17.4GHSA-53v4-42fg-g287
Mavenorg.apache.activemq:apache-activemq5.16.6GHSA-53v4-42fg-g287
Ubuntu:22.04:LTSactivemq5.16.1-1ubuntu0.1USN-7268-1
Ubuntu:22.04:LTSactivemq5.16.1-1ubuntu0.1UBUNTU-CVE-2022-41678

Affected products (as reported)

VendorProductVersions
Apache Software Foundation Apache ActiveMQ 0 – before 5.16.65.17.0 – before 5.17.4

Weakness: CWE-287

References