Skip to content

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

HighCVSS 8.8 EPSS 86.6% Scanner template
Published
Updated
Exploit status
No public exploit known
Technology
UbuntuDebian

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.

Upgrade path

8 packages: 8 fixed.

PackageAffectedFixed inStatus
apache activemq < 5.16.6; >= 5.17.0, < 5.17.4 5.16.6, 5.17.4 Fixed
debian/activemq(Debian 12) < 5.17.2+dfsg-2+deb12u1; = 5.17.2+dfsg-2 5.17.2+dfsg-2+deb12u1 Fixed
debian/activemq(Debian 13) < 5.17.6+dfsg-1 5.17.6+dfsg-1 Fixed
org.apache.activemq/apache-activemq(Maven) < 5.16.6; = 4.1.1; = 4.1.2; = 5.0.0 +68 more 5.16.6, 5.17.4 Fixed
ubuntu/activemq(Ubuntu 22.04) < 5.16.1-1ubuntu0.1; = 5.16.1-1 5.16.1-1ubuntu0.1 Fixed
ubuntu/activemq(Ubuntu Pro 16.04) < 5.13.2+dfsg-2ubuntu0.1~esm1; = 5.6.0+dfsg1-4+deb8u1ubuntu1; = 5.6.0+dfsg1-5; = 5.13.2+dfsg-2 5.13.2+dfsg-2ubuntu0.1~esm1 Fixed
ubuntu/activemq(Ubuntu Pro 18.04) < 5.15.8-2~18.04.1~esm1; = 5.14.5-3; = 5.15.2-2; = 5.15.3-2 +1 more 5.15.8-2~18.04.1~esm1 Fixed
ubuntu/activemq(Ubuntu Pro 20.04) < 5.15.11-1ubuntu0.1~esm1; = 5.15.10-1; = 5.15.11-1 5.15.11-1ubuntu0.1~esm1 Fixed

Affected products

ProductAffected versionsFixed in
org.apache.activemq/apache-activemq(Maven) < 5.16.6 5.16.6
org.apache.activemq/apache-activemq(Maven) = 4.1.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 4.1.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.0.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.1.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.10.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.10.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.10.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.11.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.11.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.11.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.11.3 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.11.4 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.12.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.12.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.12.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.12.3 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.13.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.13.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.13.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.13.3 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.13.4 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.13.5 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.14.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.14.1 No fix listed
Show 66 more
ProductAffected versionsFixed in
org.apache.activemq/apache-activemq(Maven) = 5.14.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.14.3 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.14.4 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.14.5 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.10 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.11 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.12 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.13 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.14 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.15 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.16 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.3 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.4 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.5 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.6 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.7 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.8 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.15.9 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.16.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.16.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.16.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.16.3 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.16.4 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.16.5 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.2.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.3.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.3.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.3.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.4.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.4.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.4.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.4.3 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.5.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.5.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.6.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.7.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.8.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.9.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.9.1 No fix listed
org.apache.activemq/apache-activemq(Maven) >= 5.17.0, < 5.17.4 5.17.4
org.apache.activemq/apache-activemq(Maven) = 5.17.0 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.17.1 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.17.2 No fix listed
org.apache.activemq/apache-activemq(Maven) = 5.17.3 No fix listed
ubuntu/activemq(Ubuntu:22.04) < 5.16.1-1ubuntu0.1 5.16.1-1ubuntu0.1
apache activemq < 5.16.6 5.16.6
apache activemq >= 5.17.0, < 5.17.4 5.17.4
debian/activemq(Debian:12) < 5.17.2+dfsg-2+deb12u1 5.17.2+dfsg-2+deb12u1
debian/activemq(Debian:13) < 5.17.6+dfsg-1 5.17.6+dfsg-1
ubuntu/activemq(Ubuntu:Pro:16.04) < 5.13.2+dfsg-2ubuntu0.1~esm1 5.13.2+dfsg-2ubuntu0.1~esm1
ubuntu/activemq(Ubuntu:Pro:16.04) = 5.6.0+dfsg1-4+deb8u1ubuntu1 No fix listed
ubuntu/activemq(Ubuntu:Pro:16.04) = 5.6.0+dfsg1-5 No fix listed
ubuntu/activemq(Ubuntu:Pro:16.04) = 5.13.2+dfsg-2 No fix listed
ubuntu/activemq(Ubuntu:Pro:18.04) < 5.15.8-2~18.04.1~esm1 5.15.8-2~18.04.1~esm1
ubuntu/activemq(Ubuntu:Pro:18.04) = 5.14.5-3 No fix listed
ubuntu/activemq(Ubuntu:Pro:18.04) = 5.15.2-2 No fix listed
ubuntu/activemq(Ubuntu:Pro:18.04) = 5.15.3-2 No fix listed
ubuntu/activemq(Ubuntu:Pro:18.04) = 5.15.8-2~18.04 No fix listed
ubuntu/activemq(Ubuntu:Pro:20.04) < 5.15.11-1ubuntu0.1~esm1 5.15.11-1ubuntu0.1~esm1
ubuntu/activemq(Ubuntu:Pro:20.04) = 5.15.10-1 No fix listed
ubuntu/activemq(Ubuntu:Pro:20.04) = 5.15.11-1 No fix listed
ubuntu/activemq(Ubuntu:22.04) = 5.16.1-1 No fix listed
debian/activemq(Debian:12) = 5.17.2+dfsg-2 No fix listed

References