---
title: "CWE-564: Use of Hibernate with HQL/SQL Query String Containing External Input"
url: https://radicalnotion.ai/cwe/cwe-564
type: cwe
description: "The product uses Hibernate to execute a dynamic HQL or SQL statement, but the statement is built with user-controlled input."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-564: Use of Hibernate with HQL/SQL Query String Containing External Input

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 14
- **Of those, in CISA KEV:** 0
- **New in 2026:** 11
- **CWE catalog version:** 4.21

## Description

The product uses Hibernate to execute a dynamic HQL or SQL statement, but the statement is built with user-controlled input.

## Alternate terms

- **HQL Injection:** a common attack-oriented phrase for injection into Hibernate Query Language (HQL) statements

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | - |

## Applicable platforms

**Languages:** SQL (Often)

**Technologies:** Database Server (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| 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.)

Effectiveness: High

## Demonstrative examples

### Example 1

The following code excerpt uses Hibernate's HQL syntax to build a dynamic query that is vulnerable to SQL injection.

Bad code:

```java
String street = getStreetFromUser();
Query query = session.createQuery("from Address a where a.street='" + street + "'");
```

## Observed examples

| CVE | Description |
| --- | --- |
| 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 |

## Real CVEs with this weakness (sample of 12 of 14)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2025-0959 | Eventer - WordPress Event & Booking Manager Plugin \<= 3.9.9.2 - Authenticated (Subscriber+) SQL Injection via reg\_id | high | 8.8 | - | No | 2025-03-07 |
| CVE-2024-58352 | Landray OA Unauthenticated HQL Injection via wechatLoginHelper.do | high | 8.7 | - | No | 2026-07-02 |
| CVE-2024-48988 | Apache StreamPark: SQL injection vulnerability | high | 7.6 | - | No | 2025-08-22 |
| CVE-2026-4594 | erupts erupt EruptJpaUtils.java geneEruptHqlOrderBy sql injection | medium | 6.9 | - | No | 2026-03-23 |
| CVE-2026-23959 | CoreShop Vulnerable to SQL Injection via Admin customer-company-modifier | medium | 6.9 | - | No | 2026-01-22 |
| CVE-2026-111390 | Erupt through 2.3.0 HQL Injection via linkTreeVal in Data Table API | medium | 6.0 | - | No | 2026-10-16 |
| CVE-2025-67280 | - | medium | 5.4 | - | No | 2026-01-09 |
| CVE-2026-4593 | erupts erupt MCP Tool EruptDataQuery.java EruptDataQuery sql injection | medium | 5.3 | - | No | 2026-03-23 |
| CVE-2026-13337 | SQL Injection: Hibernate in Schneider Electric NetBotz 5 750/755 | medium | 5.1 | - | No | 2026-09-01 |
| CVE-2026-76451 | Cisco Identity Services Engine Certificate Management SQL Injection Vulnerability | medium | 4.9 | - | No | 2026-09-16 |
| CVE-2026-76450 | Cisco Identity Services Engine SQL Injection Vulnerability | medium | 4.9 | - | No | 2026-09-16 |
| CVE-2026-22242 | CoreShop Vulnerable to SQL Injection via Admin Reports | medium | 4.9 | - | No | 2026-01-08 |

## Related attack patterns (CAPEC)

- [CAPEC-109](https://radicalnotion.ai/capec/capec-109): Object Relational Mapping Injection

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-89](https://radicalnotion.ai/cwe/cwe-89) | Improper Neutralization of Special Elements used in an SQL Command |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Tainted input to command | SFP24 | - |

## Frequently asked questions

### What is CWE-564?

The product uses Hibernate to execute a dynamic HQL or SQL statement, but the statement is built with user-controlled input.

### What CVEs are caused by CWE-564?

14 recorded CVEs are attributed to CWE-564, including CVE-2025-0959, CVE-2024-58352 and CVE-2024-48988.

### How do you prevent CWE-564?

A non-SQL style database that is not subject to this flaw may be chosen.

### How is CWE-564 detected?

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.)

### What are the consequences of CWE-564?

Exploiting CWE-564 can lead to: Read Application Data, Modify Application Data.

### Is CWE-564 actively exploited?

14 recorded CVEs are caused by CWE-564; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/564.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-564). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
