CWEweakness
CWE-564 Use of Hibernate with HQL/SQL Query String Containing External Input
- Alternate terms
- HQL Injection
- Abstraction
- Variant
- Structure
- Simple
- Status
- Incomplete
- Languages
- SQL
- CWE version
- 5.0
Description
The product uses Hibernate to execute a dynamic HQL or SQL statement, but the statement is built with user-controlled input.
Common consequences
• Confidentiality, Integrity: Read Application Data, Modify Application Data — If an attacker can insert input directly into the
SQL query string, even when the string contains
parameter bindings, an attacker can modify the
statement's structure and meaning, possibly execute
arbitrary SQL commands (i.e., SQL injection).
Potential mitigations
• [Requirements] A non-SQL style database that is not subject to this flaw may be chosen.
• [Architecture and Design] Follow the principle of least privilege when creating user accounts to a SQL database. Users should only have the minimum privileges necessary to use their account. If the requirements of the system indicate that a user can read and modify their own data, then limit their privileges so they cannot read/write others' data.
• [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
• [Implementation] Implement SQL strings using prepared statements that bind variables. Prepared statements that do not bind variables can be vulnerable to attack.
• [Implementation] Use vigorous allowlist style checking on any user input that may be used in a SQL command. Rather than escape meta-characters, it is safest to disallow them entirely. Reason: Later use of data that have been entered in the database may neglect to escape meta-characters before use. Narrowly define the set of safe characters based on the expected value of the parameter in the request.
Detection methods
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Observed examples
• CVE-2025-52472: wiki platform REST API allows HQL injection via select and order clauses.
• CVE-2023-26093: middleware allows HQL injection via sort columns.
• CVE-2016-1595: file download functionality in service desk software allows HQL injection via user-controlled parameters
Related
Attack pattern · CAPEC (1)
- CAPEC-109 Object Relational Mapping Injection attack pattern
Observed example · CVE (3)
- CVE-2025-52472 XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. vulnerability
- CVE-2023-26093 Liima before 1.17.28 allows Hibernate query language (HQL) injection, related to colToSort in the deployment filter. vulnerability
- CVE-2016-1595 LiveTime/WebObjects/LiveTime.woa/wa/DownloadAction/downloadFile in Micro Focus Novell Service Desk before 7.2 allows remote authenticated… vulnerability
Child of · CWE (1)
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command weakness
Referenced by CAPEC · weakness (1)
- CAPEC-109 Object Relational Mapping Injection attack pattern
Referenced by CVE · weakness (15)
- CVE-2026-111390 Erupt through 2.3.0 contains an HQL injection vulnerability that allows authenticated users to bypass tree-scoped data filters by injecting… vulnerability
- CVE-2026-73796 A security vulnerability in HPE NonStop TSQLEXE may cause application crash via a crafted SQL query. vulnerability
- CVE-2026-76450 A vulnerability in Cisco Identity Services Engine (ISE) and Cisco ISE Passive Identity Connector (ISE-PIC) could allow an authenticated,… vulnerability
- CVE-2026-76451 A vulnerability in Cisco Identity Services Engine (ISE) and Cisco ISE Passive Identity Connector (ISE-PIC) could allow an authenticated,… vulnerability
- CVE-2026-13337 CWE-564: SQL Injection: Hibernate vulnerability exists that could allow the injection of a malicious HQL query in the NetBotz database when… vulnerability
- CVE-2024-58352 Landray OA contains an unauthenticated HQL injection vulnerability that allows unauthenticated attackers to query arbitrary Hibernate… vulnerability
- CVE-2026-40871 mailcow: dockerized is an open source groupware/email suite based on docker. vulnerability
- CVE-2026-4593 A flaw has been found in erupts erupt bis 1.13.3. vulnerability
- CVE-2026-4594 A vulnerability has been found in erupts erupt up to 1.13.3. vulnerability
- CVE-2026-23959 CoreShop is a Pimcore enhanced eCommerce solution. vulnerability
- CVE-2025-67280 In TIM BPM Suite/ TIM FLOW through 9.1.2 multiple Hibernate Query Language injection vulnerabilities exist which allow a low privileged… vulnerability
- CVE-2026-22242 CoreShop is a Pimcore enhanced eCommerce solution. vulnerability
- CVE-2025-8052 SQL Injection vulnerability in opentext Flipper allows SQL Injection. vulnerability
- CVE-2024-48988 SQL Injection vulnerability in Apache StreamPark. vulnerability
- CVE-2025-0959 The Eventer - WordPress Event & Booking Manager Plugin plugin for WordPress is vulnerable to SQL Injection via the reg_id parameter in all… vulnerability