CVE-2022-41678: Apache activemq Apache ActiveMQ Deserialization Of Untrusted Vulnerability

HIGH
Advisory Identifier: GHSA-53v4-42fg-g287
CVSS 8.8
CWE-502 CWE-287
Published
Advisory Summary

CVE-2022-41678 is a HIGH (CVSS 8.8) apache activemq deserialization of untrusted vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Apache activemq libraries in the Maven ecosystem. The issue involves apache activemq deserialization of untrusted data vulnerability. Remediation is available by upgrading affected packages to version 5.16.6, 5.17.4.

CVE-2022-41678 at a Glance

CVE Identifier CVE-2022-41678
GHSA Identifier GHSA-53v4-42fg-g287
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Apache activemq
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-41678

To remediate this vulnerability, upgrade all affected Apache activemq dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.activemq:apache-activemq fixed: 5.16.6
<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>apache-activemq</artifactId>
    <version>5.16.6</version>
</dependency>
org.apache.activemq:apache-activemq fixed: 5.17.4
<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>apache-activemq</artifactId>
    <version>5.17.4</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.activemq

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2022-41678, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.activemq

Analyze the terminal output to locate any version of Apache activemq in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.16.6), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.activemq command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Apache activemq, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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 is able to invoke through refection. And then, RCE is able to be achieved via 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.

CVE-2022-41678 Affected Apache activemq Versions

2 component(s)
Fixed Versions:
5.16.65.17.4
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.activemq:apache-activemq
Maven
< 5.16.6
5.16.6
org.apache.activemq:apache-activemq
Maven
≥ 5.17.0
< 5.17.4
5.17.4

References

Frequently Asked Questions

What is CVE-2022-41678?
CVE-2022-41678 is a security vulnerability in Apache activemq involving Apache ActiveMQ Deserialization of Untrusted Data vulnerability under CWE-502: Deserialization of Untrusted Data.
Which Apache activemq versions are affected?
Affected versions include releases prior to 5.16.6, 5.17.4 across affected packages: org.apache.activemq:apache-activemq.
What version fixes CVE-2022-41678?
Upgrading to 5.16.6, 5.17.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is apache-activemq affected?
Yes, org.apache.activemq:apache-activemq is affected in releases prior to 5.16.6, 5.17.4. Upgrade your dependency to 5.16.6, 5.17.4 or later.
What is the CVSS score of CVE-2022-41678?
CVE-2022-41678 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-41678?
CVE-2022-41678 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Maven dependencies for CVE-2022-41678?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.activemq'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-53v4-42fg-g287",
  "modified" : "2025-11-04T16:47:34Z",
  "published" : "2023-11-28T18:30:23Z",
  "aliases" : [ "CVE-2022-41678" ],
  "summary" : "Apache ActiveMQ Deserialization of Untrusted Data vulnerability",
  "details" : "Once an user is authenticated on Jolokia, he can potentially trigger arbitrary code execution. \n\nIn details, in ActiveMQ configurations, jetty allows org.jolokia.http.AgentServlet to handler request to /api/jolokia\n\norg.jolokia.http.HttpRequestHandler#handlePostRequest is able to create JmxRequest through JSONObject. And calls to org.jolokia.http.HttpRequestHandler#executeRequest.\n\nInto deeper calling stacks, org.jolokia.handler.ExecHandler#doHandleRequest is able to invoke through refection.\n\nAnd then, RCE is able to be achieved via jdk.management.jfr.FlightRecorderMXBeanImpl which exists on Java version above 11.\n\n1 Call newRecording.\n\n2 Call setConfiguration. And a webshell data hides in it.\n\n3 Call startRecording.\n\n4 Call copyTo method. The webshell will be written to a .jsp file.\n\nThe mitigation is to restrict (by default) the actions authorized on Jolokia, or disable Jolokia.\nA 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.activemq:apache-activemq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.16.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.activemq:apache-activemq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.17.0"
      }, {
        "fixed" : "5.17.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41678"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/activemq/pull/958"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/activemq/commit/5c8d457d9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/activemq/commit/6120169e563b55323352431dfe9ac67a8b4de6c2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/activemq/commit/bf65929fd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/activemq/commit/d8ce1d9ff"
  }, {
    "type" : "WEB",
    "url" : "https://activemq.apache.org/security-advisories.data/CVE-2022-41678-announcement.txt"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/activemq"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/7g17kwbtjl011mm4tr8bn1vnoq9wh4sl"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2024/10/msg00027.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240216-0004"
  }, {
    "type" : "WEB",
    "url" : "https://www.openwall.com/lists/oss-security/2023/11/28/1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2023/11/28/1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287", "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-28T23:28:47Z",
    "nvd_published_at" : "2023-11-28T16:15:06Z"
  }
}