# CVE-2023-35701: Apache Hive: Arbitrary command execution via JDBC driver

> Attacker with JDBC URL edit permissions can execute arbitrary code on the client machine via a malicious HTTP server response.

- **Severity:** Medium 6.6 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 May 2024
- **Updated:** 13 Feb 2025
- **Also known as:** GHSA-vpw3-3prf-3974

## What is CVE-2023-35701?

CVE-2023-35701 is a medium-severity code injection vulnerability in Apache Hive, published on 3 May 2024. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

Improper Control of Generation of Code ('Code Injection') vulnerability in Apache Hive.

The vulnerability affects the Hive JDBC driver component and it can potentially lead to arbitrary code execution on the machine/endpoint that the JDBC driver (client) is running. The malicious user must have sufficient permissions to specify/edit JDBC URL(s) in an endpoint relying on the Hive JDBC driver and the JDBC client process must run under a privileged user to fully exploit the vulnerability. 

The attacker can setup a malicious HTTP server and specify a JDBC URL pointing towards this server. When a JDBC connection is attempted, the malicious HTTP server can provide a special response with customized payload that can trigger the execution of certain commands in the JDBC client.This issue affects Apache Hive: from 4.0.0-alpha-1 before 4.0.0.

Users are recommended to upgrade to version 4.0.0, which fixes the issue.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2023-35701?

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


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

Products: Apache Hive.

## How do I fix CVE-2023-35701?

Upgrade org.apache.hive:hive-jdbc to 4.0.0 or later.

## Is CVE-2023-35701 being exploited?

There is no known exploitation of CVE-2023-35701 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-2022-41137](https://insights.sbomify.com/CVE-2022-41137/): Apache Hive: Deserialization of untrusted data when fetching partitions from the Metastore (high 8.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-35701 and fix it if it is affected.

What it is: CVE-2023-35701 is a medium-severity code injection vulnerability in Apache Hive, published on 3 May 2024. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-35701 in the wild and no public exploit code.

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

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-2023-35701/ (Markdown: https://insights.sbomify.com/CVE-2023-35701/index.md)
```

## Sources

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

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