# CVE-2020-25638: SQL injection in hibernate-core

> SQL injection in Hibernate JPA Criteria API allows attackers to access unauthorized data or modify information via unsanitized literals in SQL comments.

- **Severity:** High 7.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Dec 2020
- **Updated:** 23 Apr 2025
- **Also known as:** CLSA-2026-1768435720, CLSA-2026-1779842927, DEBIAN-CVE-2020-25638, DLA-2512-1, DSA-4908-1, GHSA-j8jw-g6fq-mp7h, RHSA-2020:5175, SUSE-SU-2022:0225-1, SUSE-SU-2022:0593-1, UBUNTU-CVE-2020-25638, USN-6845-1

## What is CVE-2020-25638?

CVE-2020-25638 is a high-severity SQL injection vulnerability in Debian Debian Linux, published on 2 Dec 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A flaw was found in hibernate-core in versions prior to and including 5.4.23.Final. A SQL injection in the implementation of the JPA Criteria API can permit unsanitized literals when a literal is used in the SQL comments of the query. This flaw could allow an attacker to access unauthorized information or possibly conduct further attacks. The highest threat from this vulnerability is to data confidentiality and integrity.

Weakness: CWE-89 (Improper Neutralization of Special Elements used in an SQL Command)

## Which versions are affected by CVE-2020-25638?

4 open source packages ship an affected version, including org.hibernate:hibernate-core. It affects 5 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.hibernate:hibernate-core` | Maven | All versions | 5.3.20.Final |
| `org.hibernate:hibernate-core` | Maven | All versions | 5.3.20.Final |
| `org.hibernate:hibernate-core` | Maven | From 5.4.0.Final | 5.4.24.Final |
| `org.hibernate:hibernate-core` | Maven | From 5.4.0.Final | 5.4.24.Final |
| `eap7-hibernate` | Red Hat:jboss_enterprise_application_platform:7.3::el6 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el6eap |
| `eap7-hibernate-core` | Red Hat:jboss_enterprise_application_platform:7.3::el6 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el6eap |
| `eap7-hibernate-entitymanager` | Red Hat:jboss_enterprise_application_platform:7.3::el6 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el6eap |
| `eap7-hibernate-envers` | Red Hat:jboss_enterprise_application_platform:7.3::el6 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el6eap |
| `eap7-hibernate-java8` | Red Hat:jboss_enterprise_application_platform:7.3::el6 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el6eap |
| `eap7-hibernate` | Red Hat:jboss_enterprise_application_platform:7.3::el7 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el7eap |
| `eap7-hibernate-core` | Red Hat:jboss_enterprise_application_platform:7.3::el7 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el7eap |
| `eap7-hibernate-entitymanager` | Red Hat:jboss_enterprise_application_platform:7.3::el7 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el7eap |
| `eap7-hibernate-envers` | Red Hat:jboss_enterprise_application_platform:7.3::el7 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el7eap |
| `eap7-hibernate-java8` | Red Hat:jboss_enterprise_application_platform:7.3::el7 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el7eap |
| `eap7-hibernate` | Red Hat:jboss_enterprise_application_platform:7.3::el8 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el8eap |
| `eap7-hibernate-core` | Red Hat:jboss_enterprise_application_platform:7.3::el8 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el8eap |
| `eap7-hibernate-entitymanager` | Red Hat:jboss_enterprise_application_platform:7.3::el8 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el8eap |
| `eap7-hibernate-envers` | Red Hat:jboss_enterprise_application_platform:7.3::el8 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el8eap |
| `eap7-hibernate-java8` | Red Hat:jboss_enterprise_application_platform:7.3::el8 | All versions | 0:5.3.18-2.Final_redhat_00002.1.el8eap |
| `hibernate5` | SUSE:Manager Server Module 4.1 | All versions | 5.3.7-3.6.1 |
| `mgr-libmod` | SUSE:Manager Server Module 4.1 | All versions | 4.1.10-3.25.2 |
| `mgr-osad` | SUSE:Manager Server Module 4.1 | All versions | 4.1.6-2.12.2 |
| `prometheus-formula` | SUSE:Manager Server Module 4.1 | All versions | 0.3.5-3.15.1 |
| `py27-compat-salt` | SUSE:Manager Server Module 4.1 | All versions | 3000.3-6.18.1 |
| `spacecmd` | SUSE:Manager Server Module 4.1 | All versions | 4.1.16-4.33.2 |
| `spacewalk-admin` | SUSE:Manager Server Module 4.1 | All versions | 4.1.11-3.18.2 |
| `spacewalk-backend` | SUSE:Manager Server Module 4.1 | All versions | 4.1.30-4.47.2 |
| `spacewalk-certs-tools` | SUSE:Manager Server Module 4.1 | All versions | 4.1.20-3.25.2 |
| `spacewalk-client-tools` | SUSE:Manager Server Module 4.1 | All versions | 4.1.11-4.18.2 |
| `spacewalk-java` | SUSE:Manager Server Module 4.1 | All versions | 4.1.43-3.63.1 |
| `spacewalk-reports` | SUSE:Manager Server Module 4.1 | All versions | 4.1.5-3.9.1 |
| `spacewalk-setup` | SUSE:Manager Server Module 4.1 | All versions | 4.1.10-3.15.2 |
| `spacewalk-utils` | SUSE:Manager Server Module 4.1 | All versions | 4.1.19-3.27.2 |
| `spacewalk-web` | SUSE:Manager Server Module 4.1 | All versions | 4.1.31-3.39.1 |
| `suseRegisterInfo` | SUSE:Manager Server Module 4.1 | All versions | 4.1.4-4.6.2 |
| `susemanager` | SUSE:Manager Server Module 4.1 | All versions | 4.1.32-3.42.2 |
| `susemanager-doc-indexes` | SUSE:Manager Server Module 4.1 | All versions | 4.1-11.49.2 |
| `susemanager-docs_en` | SUSE:Manager Server Module 4.1 | All versions | 4.1-11.49.1 |
| `susemanager-schema` | SUSE:Manager Server Module 4.1 | All versions | 4.1.24-3.39.2 |
| `susemanager-sls` | SUSE:Manager Server Module 4.1 | All versions | 4.1.32-3.54.1 |

Products: Debian Debian Linux, Hibernate Hibernate Orm, Oracle Communications Cloud Native Core Console, Oracle Retail Customer Management and Segmentation Foundation, Quarkus Quarkus.

## How do I fix CVE-2020-25638?

Upgrade org.hibernate:hibernate-core to a fixed version for your release line: 5.3.20.Final or 5.4.24.Final.

## Is CVE-2020-25638 being exploited?

There is no known exploitation of CVE-2020-25638 in the wild and no public exploit code.

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-25638 and fix it if it is affected.

What it is: CVE-2020-25638 is a high-severity SQL injection vulnerability in Debian Debian Linux, published on 2 Dec 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2020-25638 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.hibernate:hibernate-core (Maven): affected all versions; fixed in 5.3.20.Final
- org.hibernate:hibernate-core (Maven): affected all versions; fixed in 5.3.20.Final
- org.hibernate:hibernate-core (Maven): affected from 5.4.0.Final; fixed in 5.4.24.Final
- org.hibernate:hibernate-core (Maven): affected from 5.4.0.Final; fixed in 5.4.24.Final

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-25638/ (Markdown: https://insights.sbomify.com/CVE-2020-25638/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-25638
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-25638
- OSV: https://osv.dev/vulnerability/CVE-2020-25638

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-25638/
Summaries are generated and may contain mistakes; the official description above is the record.
