CVE-2025-22228
Spring Security: BCryptPasswordEncoder accepts passwords over 72 characters that share the first 72
Technology
Spring Security
CVSS Score
7.4 / 10.0
Affected Versions
5.7.15 and earlier; 5.8.0 to 5.8.17; 6.0.0 to 6.0.15; 6.1.0 to 6.1.13; 6.2.0 to 6.2.9; 6.3.0 to 6.3.7; 6.4.0 to 6.4.3
Upstream Fix
6.3.8; 6.4.4; 6.2.10, 6.1.14, 6.0.16, 5.8.18, 5.7.16 (Enterprise Support Only)
Published
March 20, 2025
OSSeva Coverage
Fixed upstream
Description
BCryptPasswordEncoder.matches(CharSequence, String) incorrectly returns true for a password longer than 72 characters as long as its first 72 characters match. The fix enforces the maximum length; CVE-2025-22234 later found that the fix weakened the timing attack mitigation. The 7.4 score is VMware's as the CNA.
Is your Spring Security deployment affected?
If you're running 5.7.15 and earlier; 5.8.0 to 5.8.17; 6.0.0 to 6.0.15; 6.1.0 to 6.1.13; 6.2.0 to 6.2.9; 6.3.0 to 6.3.7; 6.4.0 to 6.4.3, you need this patch. Book a discovery call to get covered.