Hibernate ORM vulnerable to SQL injection


Hibernate ORM is an ORM framework for Java.
Hibernate ORM can be configured (hibernate.use_sql_comments to true, which is false by default) to add comments to generated SQL statements, aimed at debugging purpose.
When hibernate.use_sql_comments is configured to true, malicious input may produce unexpected SQL statements (CWE-89).

TERASOLUNA Framework Development Team of NTT DATA reported this vulnerability to IPA.
JPCERT/CC coordinated with the developer under Information Security Early Warning Partnership.
CVSS Severity (What is CVSS?)

CVSS V3 Severity:
Base Metrics 7.4 (High) [IPA Score]
  • Attack Vector: Network
  • Attack Complexity: High
  • Privileges Required: None
  • User Interaction: None
  • Scope: Unchanged
  • Confidentiality Impact: High
  • Integrity Impact: High
  • Availability Impact: None
CVSS V2 Severity:
Base Metrics 4.0 (Medium) [IPA Score]
  • Access Vector: Network
  • Access Complexity: High
  • Authentication: None
  • Confidentiality Impact: Partial
  • Integrity Impact: Partial
  • Availability Impact: None
Affected Products

  • Hibernate ORM versions prior to 5.4.24
  • Hibernate ORM versions prior to 5.3.20


When hibernate.use_sql_comments is configured to true, malicious input may lead to SQL injection.

[Update the Software]
Update the Hibernate ORM to the latest version, according to the information from the developer.

set hibername.use_sql_comments to false.
Vendor Information

Hibernate Red Hat, Inc.
CWE (What is CWE?)

  1. SQL Injection(CWE-89) [IPA Evaluation]
CVE (What is CVE?)

  1. CVE-2020-25638

  1. JVN : JVN#90729322
Revision History

  • [2020/11/19]
      Web page was published