Apache Hive security advisories

Security information for Apache Hive

Reporting

Do you want disclose a potential security issue for Apache Hive? Send your report to the Apache Hive Security Team.

You can read more about the security policy on:

Advisories

This section is experimental: it provides advisories since 2023 and may lag behind the official CVE publications. It may also lack details found on the project security page linked above. If you have any feedback on how you would like this data to be provided, you are welcome to reach out on our public mailinglist or privately on security@apache.org

SSRF vulnerability in Hive Avro Serde due to Insufficient input validation on avro.schema.url

CVE-2026-55976 [CVE] [CVE json] [OSV json]

Last updated: 2026-08-26T19:43:08.797Z

Affected

  • Apache Hive from 2.1.0 through 4.2.0

Description

Server-Side Request Forgery (SSRF) in Avro SerDe schema resolution in Apache Hive before 4.2.1 allows an authenticated remote attacker with CREATE TABLE privilege to cause the Hive server to fetch an attacker-controlled URL when resolving the avro.schema.url table property on an Avro table that is subsequently queried. This can expose cloud instance metadata, internal network services, or local server files to the Hive process identity. Users are recommended to upgrade to version 4.2.1, which fixes this issue.

Attacker access requirements:

  • Network access to HiveServer2 / Metastore: required (remote attacker model).
  • Valid Hive authentication: required.
  • CREATE TABLE (or equivalent) privilege: required, so the attacker can set avro.schema.url in table properties.
  • SELECT privilege on the malicious table: not required for the creator, who can typically query their own table; any other user granted SELECT can also trigger the fetch.
  • Write access to the table LOCATION: not required; the attack uses the schema URL, not the data path.
  • Admin / superuser privileges: not required; an ordinary authenticated user with DDL rights is sufficient.
  • External tables enabled: typically required in practice, and enabled by default in most deployments.

Detection guidance:

  • Inspect metastore / Hive table metadata for Avro tables whose avro.schema.url uses unexpected schemes such as http, https, file, or ftp, or points at link-local / cloud metadata addresses (for example 169.254.169.254) or other internal hosts.
  • Review HiveServer2 and Metastore logs around CREATE/ALTER TABLE and queries against Avro tables for schema-resolution failures or outbound fetches of avro.schema.url.
  • Correlate CREATE TABLE / ALTER TABLE activity that sets avro.schema.url with subsequent SELECT activity on the same table, especially when the URL target is unusual for schema distribution.
  • On cloud deployments, check instance / VPC flow logs and metadata service access logs for unexpected requests from Hive host identities shortly after Avro DDL or query activity.

References

Credits

  • zhaokaifei (reporter)

Unauthenticated authentication bypass in HiveServer2 HTTP SAML bearer-token validation allows impersonation of any Hive user

CVE-2026-53561 [CVE] [CVE json] [OSV json]

Last updated: 2026-08-26T17:54:23.960Z

Affected

  • Apache Hive from 4.0.0 through 4.2.0

Description

An improper authentication vulnerability in HiveServer2 SAML bearer-token validation in Apache Hive 4.0.0 through 4.2.0 (and later unreleased branches) on deployments using HTTP transport with hive.server2.authentication=SAML allows an unauthenticated network attacker to authenticate as an arbitrary Hive user and obtain an authenticated HiveServer2 session via a forged Authorization: Bearer token sent to the /cliservice HTTP endpoint. Users are recommended to upgrade to 4.2.1 version that includes the fix for this issue.

Access / authorization required: No Hive credentials, SAML IdP login, or knowledge of the server signing secret is required. The attacker only needs network reachability to the HiveServer2 HTTP port (typically /cliservice), directly or through a reverse proxy such as Apache Knox that forwards unauthenticated requests to HS2. The instance must have SAML authentication enabled in HTTP mode. Deployments where Knox handles SSO and HiveServer2 uses LDAP/Kerberos (not native SAML mode) are not affected by this specific issue.

References

Credits

  • Andrew Rukin (Arenadata) (reporter)

SQL Injection vulnerability in HiveMetaStore partition-name direct-SQL paths

CVE-2026-49845 [CVE] [CVE json] [OSV json]

Last updated: 2026-08-26T17:50:57.634Z

Affected

  • Apache Hive from 4.0.0 through 4.2.0

Description

SQL injection in Hive Metastore direct SQL partition-name resolution in Apache Hive before 4.2.1 on all platforms allows authenticated users with access to Hive Metastore APIs to read, modify, or affect unintended partition metadata (including statistics updates, truncation targets, and file-metadata cache operations) via crafted partition names in metastore RPC requests when direct SQL is enabled (the default). Users are recommended to upgrade to version 4.2.1, which fixes this issue.

Details about the issue:
Several Hive Metastore RPCs resolve partitions by full partition name (PART_NAME) through direct-SQL helpers. In those paths, client-supplied partition names are embedded into SQL using string concatenation (DirectSqlUpdatePart.quoteString() → ‘…’) instead of bind parameters. A partition name containing a single quote (and crafted SQL) can alter the generated WHERE clause so that lookups intended for one partition match additional rows. That can affect reads, stats updates, truncate targets, metadata-cache targets, and related operations when metastore.try.direct.sql is enabled (default: true). An authenticated or network-trusted caller with the ability to invoke Hive Metastore partition-name APIs against a target table (directly or via Hive/other clients), when direct SQL is enabled can perform this attack. Also, the impact is mainly within table & partition targeting (read/update/truncate/drop/cache the wrong partitions in a table they can reference), not arbitrary cross-database access via this bug alone.

References

Credits

  • Leon Johnson (reporter)

SQL injection vulnerability when processing delete column statistics requests via the HMS Thrift APIs

CVE-2025-62728 [CVE] [CVE json] [OSV json]

Last updated: 2025-11-26T10:29:43.944Z

Affected

  • Apache Hive from 4.1.0 before 4.2.0

Description

SQL injection vulnerability in Hive Metastore Server (HMS) when processing delete column statistics requests via the Thrift APIs. The vulnerability is only exploitable by trusted/authorized users/applications that are allowed to call directly the Thrift APIs. In most real-world deployments, HMS is accessible to only a handful of applications (e.g., Hiveserver2) thus the vulnerability is not exploitable. Moreover, the vulnerable code cannot be reached when metastore.try.direct.sql property is set to false.

This issue affects Apache Hive: from 4.1.0 before 4.2.0.

Users are recommended to upgrade to version 4.2.0, which fixes the issue. Users who cannot upgrade directly are encouraged to set metastore.try.direct.sql property to false if the HMS Thrift APIs are exposed to general public.

References

Credits

  • WuKong (Tencent) (finder)

Credentials file created with non restrictive permissions

CVE-2024-29869 [CVE] [CVE json] [OSV json]

Last updated: 2025-01-28T19:57:18.085Z

Affected

  • Apache Hive from 1.1.0 before 4.0.1

Description

Hive creates a credentials file to a temporary directory in the file system with permissions 644 by default when the file permissions are not set explicitly. Any unauthorized user having access to the directory can read the sensitive information written into this file. Users are recommended to upgrade to version 4.0.1, which fixes this issue.

References

Credits

  • Andrea Cosentino (reporter)

Timing Attack Against Signature in LLAP util

CVE-2024-23953 [CVE] [CVE json] [OSV json]

Last updated: 2025-01-28T06:25:01.840Z

Affected

  • Apache Hive from 2.2.0 before 4.0.0

Description

Use of Arrays.equals() in LlapSignerImpl in Apache Hive to compare message signatures allows attacker to forge a valid signature for an arbitrary message byte by byte. The attacker should be an authorized user of the product to perform this attack. Users are recommended to upgrade to version 4.0.0, which fixes this issue.

The problem occurs when an application doesn’t use a constant-time algorithm for validating a signature. The method Arrays.equals() returns false right away when it sees that one of the input’s bytes are different. It means that the comparison time depends on the contents of the arrays. This little thing may allow an attacker to forge a valid signature for an arbitrary message byte by byte. So it might allow malicious users to submit splits/work with selected signatures to LLAP without running as a privileged user, potentially leading to DDoS attack.

More details in the reference section.

References

Credits

  • Andrea Cosentino (reporter)

CookieSigner exposes the correct signature when message verification fails

CVE-2024-23945 [CVE] [CVE json] [OSV json]

Last updated: 2024-12-23T15:26:52.096Z

Affected

  • Apache Hive from 1.2.0 before 4.0.0
  • Apache Spark from 2.0.0 before 3.0.0
  • Apache Spark from 3.0.0 before 3.3.4
  • Apache Spark from 3.4.0 before 3.4.2
  • Apache Spark at 3.5.0

Description

Signing cookies is an application security feature that adds a digital signature to cookie data to verify its authenticity and integrity. The signature helps prevent malicious actors from modifying the cookie value, which can lead to security vulnerabilities and exploitation. Apache Hive’s service component accidentally exposes the signed cookie to the end user when there is a mismatch in signature between the current and expected cookie. Exposing the correct cookie signature can lead to further exploitation.

The vulnerable CookieSigner logic was introduced in Apache Hive by HIVE-9710 (1.2.0) and in Apache Spark by SPARK-14987 (2.0.0). The affected components are the following:
* org.apache.hive:hive-service
* org.apache.spark:spark-hive-thriftserver_2.11
* org.apache.spark:spark-hive-thriftserver_2.12

References

Credits

  • Kostya Kortchinsky (reporter)
  • Hamza Tahmi (reporter)

Arbitrary command execution via JDBC driver

CVE-2023-35701 [CVE] [CVE json] [OSV json]

Last updated: 2024-05-03T08:11:05.595Z

Affected

  • Apache Hive from 4.0.0-alpha-1 before 4.0.0

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.

References

Credits

  • Kostya Kortchinsky (reporter)

Deserialization of untrusted data when fetching partitions from the Metastore

CVE-2022-41137 [CVE] [CVE json] [OSV json]

Last updated: 2024-12-05T10:01:39.567Z

Affected

  • Apache Hive from 4.0.0-alpha-1 before 4.0.0

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.

References

Credits

  • Junjie Liao (reporter)

Apache Hive Security vulnerability in Hive with UDFs

CVE-2021-34538 [CVE] [CVE json] [OSV json]

Last updated: 2022-07-16T07:05:22.225Z

Affected

  • Apache Hive from Apache Hive before 3.1.3

Description

Apache Hive before 3.1.3 “CREATE” and “DROP” function operations does not check for necessary authorization of involved entities in the query. It was found that an unauthorized user can manipulate an existing UDF without having the privileges to do so. This allowed unauthorized or underprivileged users to drop and recreate UDFs pointing them to new jars that could be potentially malicious.

References

Credits

  • This vulnerability was discovered and reported by Hideyuki Furue.

Timing attack in Cookie signature verification

CVE-2020-1926 [CVE] [CVE json] [OSV json]

Last updated: 2021-03-16T12:44:51.635Z

Affected

  • Apache Hive from Apache Hive before 2.3.8

Description

Apache Hive cookie signature verification used a non constant time comparison which is known to be vulnerable to timing attacks. This could allow recovery of another users cookie signature. The issue was addressed in Apache Hive 2.3.8

References

Credits

  • Apache Hive would like to thank S. Wasin for reporting this issue.