CVE-2022-41678
Apache ActiveMQ: Insufficient API restrictions on Jolokia allow authenticated users to perform RCE
Check your servers for CVE-2022-41678
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-41678 affects a package, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Exploitation
EPSS 85.8%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 99.7% of all scored CVEs. Scores of 1 Dec 2026.
Weakness
- CWE-287 Improper Authentication
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
|
Apache ActiveMQ
package
org.apache.activemq:apache-activemq |
affected before 5.16.6 affected from 5.17.0, before 5.17.4 unaffected 5.18.0 unaffected 6.0.0
Other versions: unaffected
|
Is my server affected?
Find the installed version of the package (replace PACKAGE with its name) and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i PACKAGE
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2022-41678 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2022-41678RHEL, Rocky, Alma, Fedora
rpm -q PACKAGE
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2022-41678Alpine
apk list --installed | grep -i PACKAGEWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2022-41678
trivy image --scanners vuln IMAGE | grep CVE-2022-41678
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- https://activemq.apache.org/security-advisories.data/CVE-2022-41678-announcement.txt activemq.apache.org · vendor advisory
- https://lists.apache.org/thread/7g17kwbtjl011mm4tr8bn1vnoq9wh4sl lists.apache.org · vendor advisory
Other references
- https://www.openwall.com/lists/oss-security/2023/11/28/1 openwall.com
- https://security.netapp.com/advisory/ntap-20240216-0004/ security.netapp.com
- https://lists.debian.org/debian-lts-announce/2024/10/msg00027.html lists.debian.org
Source: the record CVE-2022-41678 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse