Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate/reach Metastore RPC endpoint
-
DeliveryCraft partition name with single-quote SQL
-
ExploitInvoke partition-name API on target table
-
ExecutionInjected clause matches extra partitions
-
ImpactCorrupt or truncate unintended partition metadata
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires (1) the ability to invoke Hive Metastore partition-name RPCs (e.g., getPartitionsByNames, partition column-statistics updates, truncate/drop, file-metadata cache operations) against a target table the caller can reference - the vendor states this needs an authenticated or network-trusted caller, so it is not truly unauthenticated despite the PR:N in the supplied CVSS vector; (2) metastore.try.direct.sql enabled, which is the default (metastore.try.direct.sql=true); and (3) a crafted PART_NAME containing a single quote and injected SQL passed through the direct-SQL helpers (DirectSqlUpdatePart.quoteString / MetaStoreDirectSql.getPartitionsByNames). Limiting factors: impact is scoped to partitions within tables the caller can already reference (no arbitrary cross-database access via this bug alone), exploitation is blocked if direct SQL is disabled, and it requires reachability of the Metastore API plus whatever authentication/network trust the deployment enforces. |
| Impact | The signals conflict and must be reconciled before prioritization. The supplied CVSS 3.1 vector is AV:N/AC:L/PR:N/UI:N with C:H/I:H/A:H (9.8), implying unauthenticated network exploitation with total impact - but the vendor description explicitly requires an 'authenticated or network-trusted caller' with access to Hive Metastore partition APIs, which contradicts PR:N. Treating the auth requirement as authenticated/trusted-network access (PR:L) materially lowers real-world risk versus the 9.8 headline. Impact is also narrower than C:H/I:H/A:H suggests: the vendor states the effect is confined to targeting the wrong partitions within tables the caller can already reference, not arbitrary cross-database reads or code execution. No EPSS score was provided, the flaw is not in CISA KEV, and no POC is referenced, so there is no evidence of active or automated exploitation. Realistically this is a genuine data-integrity/availability issue for multi-tenant Metastore deployments (wrong-partition truncate/drop/stats corruption) but a lower operational priority than a true unauthenticated RCE; exposing a Metastore endpoint to untrusted callers with the default direct SQL enabled is the main aggravating factor. |
| Exploit ScenarioDerived | An authenticated analyst or service account that can call Hive Metastore partition APIs against a table it references submits a partition name containing a single quote plus crafted SQL, altering the WHERE clause of a direct-SQL partition lookup. The malformed lookup matches additional partitions, so an intended single-partition stats update, truncate, or drop instead affects or destroys metadata for unintended partitions in that table. No public POC is referenced, and exploitation requires reaching the Metastore RPC interface with direct SQL enabled (default). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Aug 25, 2026
SQL injection in the Apache Hive Metastore (versions 4.0.0 through 4.2.0) lets a caller who can invoke partition-name Metastore RPCs manipulate the generated WHERE clause so operations intended for one partition match additional rows in the same table. Because client-supplied partition names are concatenated into direct-SQL statements instead of bound as parameters, a crafted name containing a single quote can redirect reads, statistics updates, truncate/drop targets, and file-metadata cache operations to unintended partitions. No public exploit is identified at time of analysis and the flaw is not in CISA KEV; the input assigns CVSS 9.8, but the vendor description constrains impact to partition targeting within referenceable tables rather than arbitrary cross-database access.
Earlier versions of this analysis (1)
SQL injection in the Hive Metastore direct-SQL partition-name resolution paths lets authenticated callers with access to Hive Metastore RPC APIs manipulate partition-targeting logic in Apache Hive before 4.2.1. By supplying a partition name containing a single quote and crafted SQL, an attacker can widen the generated WHERE clause so operations intended for one partition match additional rows, corrupting reads, statistics updates, truncation, drop, and file-metadata-cache targets within tables they can reference. The flaw is exposed by default because it triggers whenever metastore.try.direct.sql is enabled (default true); no public exploit is identified at time of analysis and it is not listed in CISA KEV.
RemediationAI
Vendor-released patch: 4.2.1 - upgrade the Hive Metastore server to 4.2.1, which replaces the vulnerable string-concatenated partition-name queries with bound parameters (fix commit https://github.com/apache/hive/commit/ca64f08a8e43db9845b47d5fa2e96f7fdea7288e; advisory https://lists.apache.org/thread/6d56mk501fp4f8cb5wvrpj2jwd9knt05). If immediate patching is not possible, restrict Metastore Thrift API access to trusted hosts/services via network ACLs or firewall the metastore port (default 9083) so untrusted clients cannot invoke partition RPCs, and enable Metastore authentication/authorization (Kerberos/SASL plus storage-based or Apache Ranger authorization) to limit which principals can reach partition-name APIs. Setting metastore.try.direct.sql=false forces the ORM path and avoids the vulnerable helpers, but carries a significant performance penalty for partition-heavy workloads and should be treated as a last-resort stopgap. Do not rely on input validation of partition names alone; the durable fix is the 4.2.1 upgrade.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The Hive Metastore is the metadata catalog for Apache Hive (and frequently shared by Spark, Trino/Presto, and Impala), storing table, partition, and statistics records in a backing RDBMS. When metastore.try.direct.sql is enabled (the default), several RPCs resolve partitions by full partition name (PART_NAME) through direct-SQL helper paths rather than the DataNucleus ORM. The fix commit (ca64f08) shows the root cause: DirectSqlUpdatePart.quoteString() wrapped raw input as "'" + input + "'" and joined those values into an IN clause, and MetaStoreDirectSql.getPartitionsByNames() did the same. The patch replaces the concatenation with JDBC PreparedStatement bind parameters (makeParams()/setString), the correct defense for this class. Although the tags cite CWE-94 (code injection) and 'RCE', the mechanism and diff are textbook SQL injection (better modeled as CWE-89) in metastore direct-SQL query construction, not remote code execution.
Know when Apache Hive gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Vendor requires an authenticated/trusted Metastore caller so PR:L not PR:N; low-complexity injection; confidentiality limited to partition metadata (C:L) while wrong-partition truncate/drop drives I:H/A:H.
Primary rating from Vendor (apache).
CVSS VectorVendor: apache
Lifecycle Timeline
2DescriptionCVE.org
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.
Articles & Coverage 2
Executive ViewAI
Apache Hive Metastore versions 4.0.0 through 4.2.0 contain a SQL injection vulnerability allowing Metastore-connected services to manipulate partition-level data access and operations, creating immediate risk to data integrity and confidentiality in analytics environments. Organizations using affected versions face potential unauthorized reads, modifications, and deletions of data across accessible partitions-a significant exposure in data lakes that support critical business intelligence and decision-making.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
More in Apache Hive
View allServer-side request forgery in Apache Hive versions 2.1.0 through 4.2.0 lets an authenticated user with CREATE TABLE rig
Authentication bypass in Apache HiveServer2 4.0.0-4.2.0 allows unauthenticated network attackers to impersonate any Hive
EUVD-2026-65396
GHSA-5555-2x3r-gmgx
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB