What’s Vulnerable › Vulnerabilities
CVE-2025-22228: CVE-2025-22228: Spring Security BCryptPasswordEncoder does not enforce maximum password length
- Severity: high (CVSS 7.4 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.6% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2025-03-20 · updated 2026-06-17
- Weakness: CWE-287
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 products
- Spring Security: from 5.7.x before 5.7.16; from 5.8.x before 5.8.18; from 6.0.x before 6.0.16; from 6.1.x before 6.1.14; from 6.2.x before 6.2.10; from 6.3.x before 6.3.8 — fixed in 5.7.16, 5.8.18, 6.0.16, 6.1.14, 6.2.10, 6.3.8
How to fix
Upgrade to a fixed version: Spring Security 5.7.16, 5.8.18, 6.0.16, 6.1.14. Check the vendor advisory for mitigations.
References
Get alerted when CVE-2025-22228 or the next vulnerability affects your stack