# CVE-2022-41137: Apache Hive: Deserialization of untrusted data when fetching partitions from the Metastore

> Authenticated attackers can achieve remote code execution in Apache Hive Metastore via unsafe deserialization when fetching partitions.

- **Severity:** High 8.3 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Dec 2024
- **Updated:** 5 Dec 2024
- **Also known as:** GHSA-6hqr-c69m-r76q

## What is CVE-2022-41137?

CVE-2022-41137 is a high-severity unsafe deserialization vulnerability in Apache Hive, published on 5 Dec 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

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.

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2022-41137?

2 open source packages ship an affected version, including org.apache.hive:hive-exec. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.hive:hive-exec` | Maven | From 4.0.0-alpha-1 | 4.0.0-alpha-2 |
| `org.apache.hive:hive-exec` | Maven | From 4.0.0-alpha-1 | 4.0.0-alpha-2 |

Products: Apache Hive.

## How do I fix CVE-2022-41137?

Upgrade org.apache.hive:hive-exec to 4.0.0-alpha-2 or later.

## Is CVE-2022-41137 being exploited?

There is no known exploitation of CVE-2022-41137 in the wild and no public exploit code.

## Other vulnerabilities in Apache Hive

- [CVE-2026-49845](https://insights.sbomify.com/CVE-2026-49845/): Apache Hive: SQL Injection vulnerability in HiveMetaStore partition-name direct-SQL paths (critical 9.8)
- [CVE-2018-21234](https://insights.sbomify.com/CVE-2018-21234/): Deserialization of Untrusted Data in Jodd (critical 9.8)
- [CVE-2026-55976](https://insights.sbomify.com/CVE-2026-55976/): Apache Hive: SSRF vulnerability in Hive Avro Serde due to Insufficient input validation on avro.schema.url (critical 9.1)
- [CVE-2018-1282](https://insights.sbomify.com/CVE-2018-1282/): SQL Injection in hive-jdbc (critical 9.1)
- [CVE-2015-7521](https://insights.sbomify.com/CVE-2015-7521/): High severity vulnerability that affects org.apache.hive:hive, org.apache.hive:hive-exec, and org.apache.hive:hive-service (high 8.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-41137 and fix it if it is affected.

What it is: CVE-2022-41137 is a high-severity unsafe deserialization vulnerability in Apache Hive, published on 5 Dec 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-41137 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.hive:hive-exec (Maven): affected from 4.0.0-alpha-1; fixed in 4.0.0-alpha-2
- org.apache.hive:hive-exec (Maven): affected from 4.0.0-alpha-1; fixed in 4.0.0-alpha-2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-41137/ (Markdown: https://insights.sbomify.com/CVE-2022-41137/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-41137
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-41137
- OSV: https://osv.dev/vulnerability/CVE-2022-41137

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-41137/
Summaries are generated and may contain mistakes; the official description above is the record.
