CVE-2026-49845: CWE-94 Improper Control of Generation of Code ('Code Injection') in Apache Software Foundation Apache Hive
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.
CVSS v3.1
Score 9.8critical
Affected software
Apache Software Foundation
Apache Hive
pkg:maven/Apache Software Foundation/org.apache.hive:hive-standalone-metastoreRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability involves SQL injection in the Hive Metastore component of Apache Hive before version 4.2.1. Several Hive Metastore RPCs resolve partitions by full partition name using direct SQL helpers that embed client-supplied partition names via string concatenation instead of using bind parameters. A crafted partition name containing a single quote can modify the WHERE clause of SQL queries, causing unintended partitions to be matched and affected. The attack requires authenticated or network-trusted users with the ability to invoke Hive Metastore partition-name APIs and occurs when the 'metastore.try.direct.sql' setting is enabled (default: true). The impact is limited to partition-level metadata operations within tables accessible to the attacker and does not allow arbitrary cross-database access by itself.
Potential Impact
An attacker with authenticated access to Hive Metastore APIs can exploit this vulnerability to read, modify, or affect unintended partition metadata, including statistics updates, truncation targets, and file-metadata cache operations. This can lead to unauthorized data manipulation or disruption of partition metadata integrity within tables the attacker can reference. The vulnerability has a CVSS score of 9.8, indicating critical severity with high confidentiality, integrity, and availability impacts. There is no indication of arbitrary cross-database access through this flaw alone.
Mitigation Recommendations
Users are strongly recommended to upgrade Apache Hive to version 4.2.1 or later, where this vulnerability is fixed. Since the issue is caused by direct SQL concatenation of partition names, upgrading to the fixed version eliminates the risk. No other official remediation or temporary workaround is provided in the available data. Patch status is not explicitly confirmed in the vendor advisory content provided, but the description clearly states that version 4.2.1 fixes the issue.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- apache
- Date Reserved
- 2026-06-01T21:24:47.973Z
- State
- PUBLISHED
Threat ID: 6a8d6cf1acd9273b4908dd41
Added to database: 08/25/2026, 10:22:41 UTC
Last enriched: 09/07/2026, 12:25:51 UTC
Last updated: 10/09/2026, 06:48:17 UTC
Views: 85
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.