First published: Thu Mar 20 2025(Updated: )
BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.
Credit: security@vmware.com
Affected Software | Affected Version | How to fix |
---|---|---|
Spring Security | ||
maven/org.springframework.security:spring-security-crypto | <=5.7.15 | 5.7.16 |
maven/org.springframework.security:spring-security-crypto | >=5.8.0<=5.8.17 | 5.8.18 |
maven/org.springframework.security:spring-security-crypto | >=6.0.0<=6.0.15 | 6.0.16 |
maven/org.springframework.security:spring-security-crypto | >=6.1.0<=6.1.13 | 6.1.14 |
maven/org.springframework.security:spring-security-crypto | >=6.2.0<=6.2.9 | 6.2.10 |
maven/org.springframework.security:spring-security-crypto | >=6.4.0<6.4.4 | 6.4.4 |
maven/org.springframework.security:spring-security-crypto | >=6.3.0<6.3.8 | 6.3.8 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2025-22228 is considered a high-severity vulnerability due to its impact on password validation.
To fix CVE-2025-22228, update to the latest version of Spring Security that addresses this vulnerability.
CVE-2025-22228 can allow unauthorized access as it may incorrectly validate long passwords that share the same first 72 characters.
CVE-2025-22228 affects all versions of Spring Security that do not include the fix for this vulnerability.
CVE-2025-22228 is exploitable in applications that use BCryptPasswordEncoder for password validation, particularly with long passwords.