# CVE-2025-35036: hibernate-validator insecure default Expression Language interpolation

> Attackers can execute arbitrary Java code or access sensitive data via Expression Language injection in Hibernate Validator constraint messages.

- **Severity:** Medium 6.9 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Jun 2025
- **Updated:** 5 Jun 2025
- **Also known as:** DEBIAN-CVE-2025-35036, GHSA-7v6m-28jr-rg84, UBUNTU-CVE-2025-35036

## What is CVE-2025-35036?

CVE-2025-35036 is a medium-severity code injection vulnerability in Hibernate Validator, published on 3 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Hibernate Validator before 6.2.0 and 7.0.0, by default and depending how it is used, may interpolate user-supplied input in a constraint violation message with Expression Language. This could allow an attacker to access sensitive information or execute arbitrary Java code. Hibernate Validator as of 6.2.0 and 7.0.0 no longer interpolates custom constraint violation messages with Expression Language and strongly recommends not allowing user-supplied input in constraint violation messages. CVE-2020-5245 and CVE-2025-4428 are examples of related, downstream vulnerabilities involving Expression Language intepolation of user-supplied data.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2025-35036?

8 open source packages ship an affected version, including org.hibernate.validator:hibernate-validator and org.hibernate:hibernate-validator. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.hibernate.validator:hibernate-validator` | Maven | All versions | 6.2.0.CR1 |
| `org.hibernate.validator:hibernate-validator` | Maven | All versions | 6.2.0.CR1 |
| `org.hibernate.validator:hibernate-validator` | Maven | From 7.0.0.Alpha1 | 7.0.0.CR1 |
| `org.hibernate.validator:hibernate-validator` | Maven | From 7.0.0.Alpha1 | 7.0.0.CR1 |
| `org.hibernate:hibernate-validator` | Maven | All versions | 6.2.0.CR1 |
| `org.hibernate:hibernate-validator` | Maven | All versions | 6.2.0.CR1 |
| `org.hibernate:hibernate-validator` | Maven | From 7.0.0.Alpha1 | 7.0.0.CR1 |
| `org.hibernate:hibernate-validator` | Maven | From 7.0.0.Alpha1 | 7.0.0.CR1 |

Products: Redhat Hibernate Validator.

## How do I fix CVE-2025-35036?

Upgrade org.hibernate.validator:hibernate-validator to a fixed version for your release line: 6.2.0.CR1 or 7.0.0.CR1.

## Is CVE-2025-35036 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-35036 exists.

## Other vulnerabilities in Hibernate Validator

- [CVE-2017-7536](https://insights.sbomify.com/CVE-2017-7536/): Privilege Escalation in Hibernate Validator (high 7.0)
- [CVE-2014-3558](https://insights.sbomify.com/CVE-2014-3558/): Improper Authentication in Hibernate Validator (medium 5.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-35036 and fix it if it is affected.

What it is: CVE-2025-35036 is a medium-severity code injection vulnerability in Hibernate Validator, published on 3 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-35036 exists.

Affected packages and fixed versions:
- org.hibernate.validator:hibernate-validator (Maven): affected all versions; fixed in 6.2.0.CR1
- org.hibernate.validator:hibernate-validator (Maven): affected all versions; fixed in 6.2.0.CR1
- org.hibernate.validator:hibernate-validator (Maven): affected from 7.0.0.Alpha1; fixed in 7.0.0.CR1
- org.hibernate.validator:hibernate-validator (Maven): affected from 7.0.0.Alpha1; fixed in 7.0.0.CR1
- org.hibernate:hibernate-validator (Maven): affected all versions; fixed in 6.2.0.CR1
- org.hibernate:hibernate-validator (Maven): affected all versions; fixed in 6.2.0.CR1
- org.hibernate:hibernate-validator (Maven): affected from 7.0.0.Alpha1; fixed in 7.0.0.CR1
- org.hibernate:hibernate-validator (Maven): affected from 7.0.0.Alpha1; fixed in 7.0.0.CR1

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-2025-35036/ (Markdown: https://insights.sbomify.com/CVE-2025-35036/index.md)
```

## Sources

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

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