Vulnerabilities in pkg:maven/org.apache.karaf.management/org.apache.karaf.management.server

PACKAGE
Advisory Identifier: GHSA-jh5g-9m4v-9vv9
Advisory Summary

CVE-2021-41766 is a HIGH (CVSS 8.1) insecure java deserialization vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Org.apache.karaf.management.server libraries in the Maven ecosystem. The issue involves insecure java deserialization in apache karaf. Remediation is available by upgrading affected packages to version 4.3.6.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.apache.karaf.management/org.apache.karaf.management.server

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.apache.karaf.management/org.apache.karaf.management.server. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-jh5g-9m4v-9vv9 CVE-2021-41766 HIGH Insecure Java Deserialization in Apache Karaf
GHSA-9jg9-6wm2-x7p5 CVE-2020-11980 MODERATE Server-Side Request Forgery in Karaf

CVE-2021-41766 at a Glance

CVE Identifier CVE-2021-41766
GHSA Identifier GHSA-jh5g-9m4v-9vv9
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Org.apache.karaf.management.server
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
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-2021-41766

To remediate this vulnerability, upgrade all affected Org.apache.karaf.management.server 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.karaf.management:org.apache.karaf.management.server fixed: 4.3.6
<dependency>
    <groupId>org.apache.karaf.management</groupId>
    <artifactId>org.apache.karaf.management.server</artifactId>
    <version>4.3.6</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.karaf.management

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.apache.karaf.management

Analyze the terminal output to locate any version of Org.apache.karaf.management.server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.3.6), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.karaf.management 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 Org.apache.karaf.management.server, 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

Apache Karaf allows monitoring of applications and the Java runtime by using the Java Management Extensions (JMX). JMX is a Java RMI based technology that relies on Java serialized objects for client server communication. Whereas the default JMX implementation is hardened against unauthenticated deserialization attacks, the implementation used by Apache Karaf is not protected against this kind of attack. The impact of Java deserialization vulnerabilities strongly depends on the classes that are available within the targets class path. Generally speaking, deserialization of untrusted data does always represent a high security risk and should be prevented. The risk is low as, by default, Karaf uses a limited set of classes in the JMX server class path. It depends of system scoped classes (e.g. jar in the lib folder).

CVE-2021-41766 Affected Org.apache.karaf.management.server Versions

1 component(s)
Fixed Versions:
4.3.6
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.karaf.management:org.apache.karaf.management.server
Maven
< 4.3.6
4.3.6

References

Frequently Asked Questions

What is CVE-2021-41766?
CVE-2021-41766 is a security vulnerability in Org.apache.karaf.management.server involving Insecure Java Deserialization in Apache Karaf under CWE-502: Deserialization of Untrusted Data.
Which Org.apache.karaf.management.server versions are affected?
Affected versions include releases prior to 4.3.6 across affected packages: org.apache.karaf.management:org.apache.karaf.management.server.
What version fixes CVE-2021-41766?
Upgrading to 4.3.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is org.apache.karaf.management.server affected?
Yes, org.apache.karaf.management:org.apache.karaf.management.server is affected in releases prior to 4.3.6. Upgrade your dependency to 4.3.6 or later.
What is the CVSS score of CVE-2021-41766?
CVE-2021-41766 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-41766?
CVE-2021-41766 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-2021-41766?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.karaf.management'. 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-jh5g-9m4v-9vv9",
  "modified" : "2023-09-11T22:18:57Z",
  "published" : "2022-01-28T22:24:48Z",
  "aliases" : [ "CVE-2021-41766" ],
  "summary" : "Insecure Java Deserialization in Apache Karaf",
  "details" : "Apache Karaf allows monitoring of applications and the Java runtime by using the Java Management Extensions (JMX). JMX is a Java RMI based technology that relies on Java serialized objects for client server communication. Whereas the default JMX implementation is hardened against unauthenticated deserialization attacks, the implementation used by Apache Karaf is not protected against this kind of attack. The impact of Java deserialization vulnerabilities strongly depends on the classes that are available within the targets class path. Generally speaking, deserialization of untrusted data does always represent a high security risk and should be prevented. The risk is low as, by default, Karaf uses a limited set of classes in the JMX server class path. It depends of system scoped classes (e.g. jar in the lib folder).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.karaf.management:org.apache.karaf.management.server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41766"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/karaf/pull/1475"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/karaf/commit/b42c82ca3b9a22bd92d249a1060a1953f4188bc2"
  }, {
    "type" : "WEB",
    "url" : "https://gitbox.apache.org/repos/asf?p=karaf.git;h=93a019c"
  }, {
    "type" : "WEB",
    "url" : "https://gitbox.apache.org/repos/asf?p=karaf.git;h=b42c82c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/karaf"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/KARAF-7312"
  }, {
    "type" : "WEB",
    "url" : "https://karaf.apache.org/security/cve-2021-41766.txt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-27T23:08:06Z",
    "nvd_published_at" : "2022-01-26T11:15:00Z"
  }
}