CVE-2025-22228 is a high-severity (CVSS 7.4) Improper Authentication vulnerability in org.springframework.security:spring-security-crypto. A fix is available for org.springframework.security:spring-security-crypto — see the affected versions and patch details below.
Spring Security Does Not Enforce Password Length
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-22228.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
org.springframework.security:spring-security-crypto☕org.springframework.security:spring-security-crypto☕org.springframework.security:spring-security-crypto☕org.springframework.security:spring-security-crypto☕org.springframework.security:spring-security-crypto☕org.springframework.security:spring-security-crypto☕org.springframework.security:spring-security-cryptoReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.springframework.security:spring-security-crypto | ≥ 6.3.0&&< 6.3.8 | 6.3.8org.springframework.security:spring-security-crypto:6.3.8 |
| ☕Maven | org.springframework.security:spring-security-crypto | ≥ 6.4.0&&< 6.4.4 | 6.4.4org.springframework.security:spring-security-crypto:6.4.4 |
| ☕Maven | org.springframework.security:spring-security-crypto | ≥ 6.2.0&&< 6.2.10 | 6.2.10org.springframework.security:spring-security-crypto:6.2.10 |
| ☕Maven | org.springframework.security:spring-security-crypto | ≥ 6.1.0&&< 6.1.14 | 6.1.14org.springframework.security:spring-security-crypto:6.1.14 |
| ☕Maven | org.springframework.security:spring-security-crypto | ≥ 6.0.0&&< 6.0.16 | 6.0.16org.springframework.security:spring-security-crypto:6.0.16 |
| ☕Maven | org.springframework.security:spring-security-crypto | ≥ 5.8.0&&< 5.8.18 | 5.8.18org.springframework.security:spring-security-crypto:5.8.18 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.springframework.security:spring-security-crypto, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.springframework.security:spring-security-crypto to 6.3.8 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-22228 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat Product Security does not have a recommended mitigation at this time.Source: Red Hat security advisory for CVE-2025-22228 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| OCP-Tools-4.12-RHEL-8 | jenkins-0:2.504.2.1750932984-3.el8 | RHSA-2025:10118 |
| OCP-Tools-4.13-RHEL-8 | jenkins-0:2.504.2.1750916374-3.el8 | RHSA-2025:10119 |
| OCP-Tools-4.14-RHEL-8 | jenkins-0:2.504.2.1750903189-3.el8 | RHSA-2025:10120 |
| OCP-Tools-4.15-RHEL-8 | jenkins-0:2.504.2.1750856366-3.el8 | RHSA-2025:10104 |
| OCP-Tools-4.16-RHEL-9 | jenkins-0:2.504.2.1750857144-3.el9 | RHSA-2025:10098 |
| OCP-Tools-4.17-RHEL-9 | jenkins-0:2.504.2.1750851690-3.el9 | RHSA-2025:10097 |
| OCP-Tools-4.18-RHEL-9 | jenkins-0:2.504.2.1750846524-3.el9 | RHSA-2025:10092 |
| Red Hat build of Apache Camel 4.8.5 for Spring Boot | spring-security-core | RHSA-2025:3543 |
Frequently Asked Questions
Is CVE-2025-22228 in your dependencies?
Find it across Maven, including transitive dependencies.