DEV Community

Cover image for CVE-2026-0603 – Hibernate security issue: Should you be worried?
Leon Pennings
Leon Pennings

Posted on • Edited on • Originally published at blog.leonpennings.com

CVE-2026-0603 – Hibernate security issue: Should you be worried?

CVE-2026-0603: Second-Order SQL Injection in Hibernate ORM – Risk Assessment

Abstract CVE-2026-0603, disclosed on January 19, 2026, describes a high-severity (CVSS 8.3) second-order SQL injection vulnerability in Hibernate ORM’s InlineIdsOrClauseBuilder. The issue arises when unsanitized string values are incorporated into dynamic IN or OR clauses during query construction. This article examines the vulnerability’s mechanics, affected versions, and conditions under which applications remain unaffected, with particular emphasis on systems that employ sequence-generated numeric primary keys.

Introduction SQL injection vulnerabilities remain a persistent threat in object-relational mapping (ORM) frameworks. CVE-2026-0603 affects Hibernate ORM when string-based identifiers are processed in a manner that permits injection of malicious SQL fragments. The vulnerability is classified as second-order: malicious input must first be stored in the database and later retrieved for use in a dynamic query.

Vulnerability Description The flaw resides in the construction of SQL clauses that combine multiple identifier values. When identifiers are strings, Hibernate may concatenate values without sufficient sanitization, enabling an authenticated attacker with low privileges to store SQL metacharacters (e.g., quotes, comments, semicolons) in a field that later serves as an identifier. Subsequent query execution can result in arbitrary SQL statements, leading to data exposure (high confidentiality impact), unauthorized modification (high integrity impact), or limited denial-of-service (low availability impact).

Affected Versions The vulnerability impacts Hibernate ORM versions 5.2.8 through 5.6.15. Red Hat products incorporating vulnerable Hibernate builds (e.g., JBoss EAP, Fuse, OpenShift Application Runtimes) are also exposed.

Conditions for Non-Exposure Applications are not vulnerable when primary keys are exclusively numeric (Long/BIGINT) and generated by database sequences. In such cases:

  • Identifier values are controlled by the database and never originate from user input.

  • Hibernate processes numeric identifiers as bind parameters or literal numbers, bypassing string concatenation logic.

  • The vulnerable InlineIdsOrClauseBuilder path is not executed.

This configuration effectively prevents exploitation, even on unpatched versions.

Discussion The use of user-supplied values as primary keys or identifiers introduces unnecessary risk. Numeric, sequence-generated keys provide a robust defense-in-depth layer against injection and enumeration attacks. When user-controlled values (e.g., usernames, slugs, codes) are required, they should be stored in separate indexed columns with strict validation, normalization, and sanitization. Direct use of such values as identifiers violates separation of concerns and increases attack surface.

Conclusion For applications that rely solely on sequence-generated numeric primary keys, CVE-2026-0603 presents no practical risk. Patching remains advisable for general hygiene, but urgency is low in these environments. Systems employing string-based identifiers, particularly those influenced by user input, require prompt remediation.

References

Correction (Feb 2026): Affected versions are Hibernate ORM 5.2.8 through 5.6.15 (per Red Hat advisory). Earlier reports listed 6.x in error — 6.x is not impacted. Core advice unchanged.

Top comments (2)

Collapse
 
jeffrey_adamson_0706a48ec profile image
Jeffrey Adamson

Why does the 'affected versions' info differ so drastically from the list on the cve?

The vulnerability impacts Hibernate ORM versions 6.0.0 through at least 6.6.41.Final. Earlier 5.x series remain unaffected, as the problematic code path was introduced in the 6.x branch.

vs

Default Status: unaffected
Affected Hibernate ORM versions are 5.2.8 through 5.6.15 (inclusive)

These 2 ranges are not just different but are seem to be mutually exclusive.

Collapse
 
leonpennings profile image
Leon Pennings • Edited

Hi Jeffrey,

you are right, I will adjust. When the article came out it was a few hours after the CVE got published. The owasp scanner found it in my project. I couldn't find a lot online, but from what I could find I made this article. There were no versions mentioned at Red Hat from what I could find so quick, I think it got updated later. I found the versions on a non-official post, but can't find it anymore. I never double checked the versions later. So thanks for the correction.

rg,

Leon.