CVE-2026-49845
Apache Hive: SQL Injection vulnerability in HiveMetaStore partition-name direct-SQL paths
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.
INFO
Published Date :
Aug. 25, 2026, 11:16 a.m.
Last Modified :
Sept. 28, 2026, 11:10 p.m.
Remotely Exploit :
Yes !
Source :
[email protected]
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 3.1 | CRITICAL | 134c704f-9b21-4f2e-91b3-4a467353bcc0 |
Solution
- Upgrade Apache Hive to version 4.2.1 or later.
- Verify direct SQL feature is disabled if upgrading is not possible.
- Sanitize user input for partition names.
- Use prepared statements for SQL queries.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-49845.
| URL | Resource |
|---|---|
| https://github.com/apache/hive | Product |
| https://github.com/apache/hive/commit/ca64f08a8e43db9845b47d5fa2e96f7fdea7288e | Patch |
| https://issues.apache.org/jira/browse/HIVE-29622 | Vendor Advisory |
| https://lists.apache.org/thread/6d56mk501fp4f8cb5wvrpj2jwd9knt05 | Mailing List Vendor Advisory |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-49845 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-49845
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-49845 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-49845 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Translated by [email protected]
Sep. 28, 2026
Action Type Old Value New Value Added Translation Title: Apache Hive de Apache Software Foundation, Description: La inyección SQL en la resolución de nombres de partición SQL directa de Hive Metastore en Apache Hive anterior a 4.2.1 en todas las plataformas permite a usuarios autenticados con acceso a las API de Hive Metastore leer, modificar o afectar metadatos de partición no deseados (incluyendo actualizaciones de estadísticas, objetivos de truncamiento y operaciones de caché de metadatos de archivos) a través de nombres de partición manipulados en solicitudes RPC de metastore cuando el SQL directo está habilitado (el valor predeterminado). Se recomienda a los usuarios actualizar a la versión 4.2.1, que corrige este problema. Detalles sobre el problema: Varias RPC de Hive Metastore resuelven particiones por nombre de partición completo (PART_NAME) a través de ayudantes de SQL directo. En esas rutas, los nombres de partición proporcionados por el cliente se incrustan en SQL usando concatenación de cadenas (DirectSqlUpdatePart.quoteString() ? '...') en lugar de parámetros de enlace. Un nombre de partición que contiene una comilla simple (y SQL manipulado) puede alterar la cláusula WHERE generada de modo que las búsquedas destinadas a una partición coincidan con filas adicionales. Eso puede afectar lecturas, actualizaciones de estadísticas, objetivos de truncamiento, objetivos de caché de metadatos y operaciones relacionadas cuando metastore.try.direct.sql está habilitado (predeterminado: true). Un llamador autenticado o de confianza de red con la capacidad de invocar las API de nombres de partición de Hive Metastore contra una tabla objetivo (directamente o a través de Hive/otros clientes), cuando el SQL directo está habilitado puede realizar este ataque. Además, el impacto es principalmente dentro de la orientación de tabla y partición (leer/actualizar/truncar/eliminar/almacenar en caché las particiones incorrectas en una tabla a la que pueden hacer referencia), no acceso arbitrario entre bases de datos a través de este error solamente. -
Initial Analysis by [email protected]
Aug. 27, 2026
Action Type Old Value New Value Added CPE Configuration OR *cpe:2.3:a:apache:hive:4.2.0:*:*:*:*:*:*:* Added Reference Type Apache Software Foundation: https://github.com/apache/hive Types: Product Added Reference Type Apache Software Foundation: https://github.com/apache/hive/commit/ca64f08a8e43db9845b47d5fa2e96f7fdea7288e Types: Patch Added Reference Type Apache Software Foundation: https://issues.apache.org/jira/browse/HIVE-29622 Types: Vendor Advisory Added Reference Type Apache Software Foundation: https://lists.apache.org/thread/6d56mk501fp4f8cb5wvrpj2jwd9knt05 Types: Mailing List, Vendor Advisory -
CVE Modified by [email protected]
Aug. 26, 2026
Action Type Old Value New Value Added Reference https://github.com/apache/hive Added Reference https://github.com/apache/hive/commit/ca64f08a8e43db9845b47d5fa2e96f7fdea7288e Added Reference https://issues.apache.org/jira/browse/HIVE-29622 Added Reference https://lists.apache.org/thread/6d56mk501fp4f8cb5wvrpj2jwd9knt05 Removed Reference https://github.com/apache/hive Removed Reference https://github.com/apache/hive/commit/ca64f08a8e43db9845b47d5fa2e96f7fdea7288e Removed Reference https://issues.apache.org/jira/browse/HIVE-29622 Removed Reference https://lists.apache.org/thread/6d56mk501fp4f8cb5wvrpj2jwd9knt05 -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Aug. 26, 2026
Action Type Old Value New Value Changed SSVC {'id': 'CVE-2026-49845', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'yes'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-08-25T19:40:26.728274Z'} {'id': 'CVE-2026-49845', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-08-25T00:00:00+00:00'} -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Aug. 25, 2026
Action Type Old Value New Value Added CVSS V3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Added SSVC {'id': 'CVE-2026-49845', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'yes'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-08-25T19:40:26.728274Z'} -
New CVE Received by [email protected]
Aug. 25, 2026
Action Type Old Value New Value Added Affected [{'vendor': 'Apache Software Foundation', 'product': 'Apache Hive', 'versions': [{'status': 'affected', 'version': '4.0.0', 'versionType': 'semver', 'lessThanOrEqual': '4.2.0'}], 'packageName': 'org.apache.hive:hive-standalone-metastore', 'collectionURL': 'https://repo.maven.apache.org/maven2', 'defaultStatus': 'unaffected'}] 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. Added CWE CWE-94 Added Reference https://github.com/apache/hive Added Reference https://github.com/apache/hive/commit/ca64f08a8e43db9845b47d5fa2e96f7fdea7288e Added Reference https://issues.apache.org/jira/browse/HIVE-29622 Added Reference https://lists.apache.org/thread/6d56mk501fp4f8cb5wvrpj2jwd9knt05