CVE-2022-41678: Apache ActiveMQ < 5.16.5/5.17.3 - Remote Code Execution
- Template: CVE-2022-41678
- Name: Apache ActiveMQ < 5.16.5/5.17.3 - Remote Code Execution
- 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.
- Impact: Authenticated attackers can execute arbitrary code on the server, potentially leading to full system compromise.
- Remediation: Restrict or disable Jolokia, and upgrade to ActiveMQ version 5.16.6, 5.17.4, 5.18.0, or 6.0.0 with updated Jolokia configuration.
- Severity: high
- Authors: maciejklimek
- Tags: cve, cve2022, activemq, rce, jolokia, authenticated
- References: https://nvd.nist.gov/vuln/detail/CVE-2022-41678, https://activemq.apache.org/security-advisories.data/CVE-2022-41678-announcement.txt, https://l3yx.github.io/2023/11/29/Apache-ActiveMQ-Jolokia-%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C%E6%BC%8F%E6%B4%9E-CVE-2022-41678-%E5%88%86%E6%9E%90/
- Cves: CVE-2022-41678
- Verified: yes
- Max requests: 1
- Directory: http/cves
- Path: http/cves/2022/CVE-2022-41678.yaml
- Digest: 490a00463044022073be15e51533587b30e52fa8c33a36fbc103fcb122ead7903afd836217feff2f02200534d2c7b06dd6c72a511ae15c46f8ba5c818b0a29566d44fe4d228f6f39b835
- Created at: 2026-04-01T04:22:18Z
- Updated at: 2026-11-18T02:04:03Z
- Age in days: 237
- Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2022/CVE-2022-41678.yaml
- Checked, none or zero: products
Classification
- Cwe: CWE-502
- Cvss score: 8.8
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Epss score: 0.86575
- Epss percentile: 0.99743
- Not known: cpe
Metadata
- Fofa-query: title="ActiveMQ"
- Max-request: 1
- Shodan-query: http.title:"ActiveMQ"
- Verified: yes
Labels
- Name: ActiveMQ - Remote Code Execution
- Impact: Authenticated attackers can execute arbitrary code on the server, potentially leading to full system compromise.
- Remediation: Restrict or disable Jolokia, and upgrade to ActiveMQ version 5.16.6, 5.17.4, 5.18.0, or 6.0.0 with updated Jolokia configuration.
- Vulnerability type: insecure_deserialization
- Vulnerability impact: remote_code_execution
- Requirement type: logged_in
- Requirements: Attacker must be authenticated on Jolokia
- Labels source: projectdiscovery
- From cve: CVE-2022-41678
```yaml
id: CVE-2022-41678
info:
name: Apache ActiveMQ < 5.16.5/5.17.3 - Remote Code Execution
author: maciejklimek
severity: high
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.
impact: |
Authenticated attackers can execute arbitrary code on the server, potentially leading to full system compromise.
remediation: Restrict or disable Jolokia, and upgrade to ActiveMQ version 5.16.6, 5.17.4, 5.18.0, or 6.0.0 with updated Jolokia configuration.
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2022-41678
- https://activemq.apache.org/security-advisories.data/CVE-2022-41678-announcement.txt
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cvss-score: 8.8
cve-id: CVE-2022-41678
epss-score: 0.86575
epss-percentile: 0.99743
cwe-id: CWE-502
metadata:
verified: true
max-request: 1
shodan-query: http.title:"ActiveMQ"
fofa-query: title="ActiveMQ"
tags: cve,cve2022,activemq,rce,jolokia,authenticated
http:
- raw:
- |
GET /api/jolokia/list/org.apache.logging.log4j2 HTTP/1.1
Host: {{Hostname}}
Authorization: Basic YWRtaW46YWRtaW4=
Origin: {{RootURL}}
matchers-condition: and
matchers:
- type: word
part: body
words:
- "setConfigText"
- "getConfigText"
condition: and
- type: word
part: body
words:
- "org.apache.logging.log4j2"
- type: status
status:
- 200
digest: 490a00463044022073be15e51533587b30e52fa8c33a36fbc103fcb122ead7903afd836217feff2f02200534d2c7b06dd6c72a511ae15c46f8ba5c818b0a29566d44fe4d228f6f39b835:922c64590222798bb761d5b6d8e72950
```