CVE-2022-41137: Apache Hive Deserialization Of Untrusted Data When Vulnerability

HIGH
Advisory Identifier: GHSA-6hqr-c69m-r76q
CVSS 8.3
CWE-502
Published
Advisory Summary

CVE-2022-41137 is a HIGH (CVSS 8.3) deserialization of untrusted data when vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Apache Hive libraries in the Maven ecosystem. The issue involves deserialization of untrusted data when fetching partitions from the metastore. Remediation is available by upgrading affected packages to version 4.0.0-alpha-2.

CVE-2022-41137 at a Glance

CVE Identifier CVE-2022-41137
GHSA Identifier GHSA-6hqr-c69m-r76q
Severity HIGH
CVSS v3.1 Base Score 8.3
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Apache Hive
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.3

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:L/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 Low (C:L)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-41137

To remediate this vulnerability, upgrade all affected Apache Hive 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.hive:hive-exec fixed: 4.0.0-alpha-2
<dependency>
    <groupId>org.apache.hive</groupId>
    <artifactId>hive-exec</artifactId>
    <version>4.0.0-alpha-2</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.hive

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.apache.hive 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 Hive, 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 Hive Metastore (HMS) uses SerializationUtilities#deserializeObjectWithTypeInformation method when filtering and fetching partitions that is unsafe and can lead to Remote Code Execution (RCE) since it allows the deserialization of arbitrary data. In real deployments, the vulnerability can be exploited only by authenticated users/clients that were able to successfully establish a connection to the Metastore. From an API perspective any code that calls the unsafe method may be vulnerable unless it performs additional prerechecks on the input arguments.

CVE-2022-41137 Affected Apache Hive Versions

1 component(s)
Fixed Versions:
4.0.0-alpha-2
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.hive:hive-exec
Maven
≥ 4.0.0-alpha-1
< 4.0.0-alpha-2
All 1 versions
4.0.0-alpha-1
4.0.0-alpha-2

References

Frequently Asked Questions

What is CVE-2022-41137?
CVE-2022-41137 is a security vulnerability in Apache Hive involving Deserialization of untrusted data when fetching partitions from the Metastore under CWE-502: Deserialization of Untrusted Data.
Which Apache Hive versions are affected?
Affected versions include releases prior to 4.0.0-alpha-2 across affected packages: org.apache.hive:hive-exec.
What version fixes CVE-2022-41137?
Upgrading to 4.0.0-alpha-2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hive-exec affected?
Yes, org.apache.hive:hive-exec is affected in releases prior to 4.0.0-alpha-2. Upgrade your dependency to 4.0.0-alpha-2 or later.
What is the CVSS score of CVE-2022-41137?
CVE-2022-41137 has a CVSS v3.1 base score of 8.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H.
What CWE is associated with CVE-2022-41137?
CVE-2022-41137 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-41137?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.hive'. 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-6hqr-c69m-r76q",
  "modified" : "2024-12-05T19:57:26Z",
  "published" : "2024-12-05T12:31:28Z",
  "aliases" : [ "CVE-2022-41137" ],
  "summary" : "Apache Hive: Deserialization of untrusted data when fetching partitions from the Metastore",
  "details" : "Apache Hive Metastore (HMS) uses SerializationUtilities#deserializeObjectWithTypeInformation method when filtering and fetching partitions that is unsafe and can lead to Remote Code Execution (RCE) since it allows the deserialization of arbitrary data.\n\nIn real deployments, the vulnerability can be exploited only by authenticated users/clients that were able to successfully establish a connection to the Metastore. From an API perspective any code that calls the unsafe method may be vulnerable unless it performs additional prerechecks on the input arguments.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.hive:hive-exec"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0-alpha-1"
      }, {
        "fixed" : "4.0.0-alpha-2"
      } ]
    } ],
    "versions" : [ "4.0.0-alpha-1" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41137"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/hive/commit/60027bb9c91a93affcfebd9068f064bc1f2a74c9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/hive"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/HIVE-26539"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/jwtr3d9yovf2wo0qlxvkhoxnwxxyzgts"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2024/12/04/2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-05T19:57:26Z",
    "nvd_published_at" : "2024-12-05T10:15:04Z"
  }
}