CVE-2022-41678
Published: 28 November 2023
Summary
CVE-2022-41678 is a high-severity Improper Authentication (CWE-287) vulnerability in Apache Activemq. Its CVSS base score is 8.8 (High).
Operationally, ranked in the top 0.2% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.
Deeper analysis
CVE-2022-41678 affects the Jolokia HTTP endpoint exposed by Apache ActiveMQ when Jetty routes requests to org.jolokia.http.AgentServlet. An authenticated user can supply a crafted JSON payload to HttpRequestHandler.handlePostRequest and executeRequest, which reaches ExecHandler.doHandleRequest via reflection and permits invocation of arbitrary MBean operations, including unrestricted deserialization through jdk.management.jfr.FlightRecorderMXBeanImpl on Java 11 and later.
An authenticated attacker can therefore chain calls such as newRecording, setConfiguration (embedding a webshell payload), startRecording, and copyTo to write an executable .jsp file to disk, resulting in remote code execution with the privileges of the ActiveMQ process.
Advisories from the Apache ActiveMQ project state that the default distribution now ships with a more restrictive Jolokia access policy; users are advised to upgrade to ActiveMQ 5.16.6, 5.17.4, 5.18.0 or 6.0.0, or to disable Jolokia or further restrict its allowed actions. The vulnerability carries a CVSS 3.1 score of 8.8 and an EPSS score that has remained near 0.93 since disclosure.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2023-2884
Vulnerability details
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…
more
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.
- CWE(s)
Related Threats
No named actor attribution yet. ATT&CK technique mapping in progress for this CVE.
Affected Assets
Mitigating Controls
Likely Mitigating Controls AI
Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.
Detects unauthorized successful logons resulting from improper authentication implementations.
Documented procedures ensure personnel are trained on authentication mechanisms, tangibly lowering the risk of improper authentication being exploited.
Security awareness training instructs users on secure authentication practices and avoiding credential compromise.
Training on authentication mechanisms and best practices decreases the occurrence of improper authentication.
Non-repudiation requires strong authentication mechanisms to irrefutably attribute performed actions to specific individuals or processes.
Session content review can reveal authentication bypasses or failures in session establishment.
Review of authentication-related audit records can detect improper authentication mechanisms or bypasses.
Assessments check authentication mechanisms for correct implementation and effectiveness, reducing successful authentication bypass attempts.