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.
Published: 2026-08-25
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability arises from direct string concatenation of client‑supplied partition names into Hive Metastore SQL when processing partition‑name APIs, exposing a code‑alteration flaw (CWE‑94). By injecting a partition name that contains a single quote and crafted SQL, an authenticated attacker can modify the WHERE clause, enabling the unauthorized reading, updating, or deleting of metadata for unintended partitions—including statistics updates, truncations, and cache operations. The attack scope is confined to partitions of tables that the attacker can reference, but the resulting data integrity and availability impact can be significant.

Affected Systems

All versions of Apache Hive before 4.2.1 on any platform are vulnerable. The affected product is Apache Hive by the Apache Software Foundation, and the issue is resolved in Hive 4.2.1; no specific sub‑versions are listed.

Risk and Exploitability

The CVSS score is not reported, and the EPSS score is unavailable; the vulnerability is not listed in the CISA KEV catalog. Attackers must be authenticated users with Hive Metastore API access, and the configuration flag that enables direct SQL (metastore.try.direct.sql) must be set to true, which is the default. Although the exploitation is limited to the scope of affected tables, manipulation of partition metadata can lead to data loss or incorrect query results, signifying a high risk that warrants immediate remediation.

Generated by OpenCVE AI on August 25, 2026 at 11:20 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Apache Hive to version 4.2.1 or newer to apply the official fix.
  • If an upgrade cannot be performed immediately, disable the vulnerable code path by setting metastore.try.direct.sql=false in the Hive configuration, which prevents direct SQL usage.
  • Audit and restrict access to Hive Metastore APIs so that only trusted users can invoke partition‑name operations, thereby limiting potential exposure.

Generated by OpenCVE AI on August 25, 2026 at 11:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 25 Aug 2026 11:45:00 +0000

Type Values Removed Values Added
First Time appeared Apache
Apache hive
Vendors & Products Apache
Apache hive

Tue, 25 Aug 2026 10:30:00 +0000

Type Values Removed Values Added
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.
Title Apache Hive: SQL Injection vulnerability in HiveMetaStore partition-name direct-SQL paths
Weaknesses CWE-94
References

cve-icon MITRE

Status: PUBLISHED

Assigner: apache

Published:

Updated: 2026-08-25T10:13:49.998Z

Reserved: 2026-06-01T21:24:47.973Z

Link: CVE-2026-49845

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-25T11:16:53.410

Modified: 2026-08-25T11:16:53.410

Link: CVE-2026-49845

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-25T11:30:06Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')