# CVE-2025-22234: Spring Security - BCrypt Password Encoder maximum password length breaks timing attack mitigation

> Attackers can infer valid usernames via timing differences due to a broken mitigation in Spring Security's BCrypt encoder under specific configurations.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/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:** 22 Jan 2026
- **Updated:** 22 Jan 2026
- **Also known as:** CLSA-2025-1754525015, GHSA-vqxh-445g-37fc, MINI-5h5q-p2m5-f2gc, MINI-7mf5-6q3c-8rh6, MINI-8794-24gr-ffq5

## What is CVE-2025-22234?

CVE-2025-22234 is a medium-severity vulnerability in Spring Security, published on 22 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The fix applied in CVE-2025-22228 inadvertently broke the timing attack mitigation implemented in DaoAuthenticationProvider. This can allow attackers to infer valid usernames or other authentication behavior via response-time differences under certain configurations.

Weakness: CWE-208 (Observable Timing Discrepancy)

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

4 open source packages ship an affected version, including org.springframework.security:spring-security-core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.springframework.security:spring-security-core` | Maven | From 6.3.8 | 6.3.9 |
| `org.springframework.security:spring-security-core` | Maven | From 6.3.8 | 6.3.9 |
| `org.springframework.security:spring-security-core` | Maven | From 6.4.4 | 6.4.5 |
| `org.springframework.security:spring-security-core` | Maven | From 6.4.4 | 6.4.5 |

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

Upgrade org.springframework.security:spring-security-core to a fixed version for your release line: 6.3.9 or 6.4.5.

## Is CVE-2025-22234 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2025-22234 is a medium-severity vulnerability in Spring Security, published on 22 Jan 2026. 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-2025-22234 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.springframework.security:spring-security-core (Maven): affected from 6.3.8; fixed in 6.3.9
- org.springframework.security:spring-security-core (Maven): affected from 6.3.8; fixed in 6.3.9
- org.springframework.security:spring-security-core (Maven): affected from 6.4.4; fixed in 6.4.5
- org.springframework.security:spring-security-core (Maven): affected from 6.4.4; fixed in 6.4.5

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

## Sources

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

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