CVE-2025-22228: Spring Security Does Not Enforce Password Length
BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.
Published Mar 20, 2025 · Updated Apr 26, 2025
Affected packages
org.springframework.security:spring-security-crypto
- Ecosystem
- Maven
- Affected
- >= 6.3.0, < 6.3.8
- Fixed in
- 6.3.8
- Check
mvn dependency:tree -Dincludes=org.springframework.security:spring-security-crypto
org.springframework.security:spring-security-crypto
- Ecosystem
- Maven
- Affected
- >= 6.4.0, < 6.4.4
- Fixed in
- 6.4.4
- Check
mvn dependency:tree -Dincludes=org.springframework.security:spring-security-crypto
org.springframework.security:spring-security-crypto
- Ecosystem
- Maven
- Affected
- >= 6.2.0, <= 6.2.9
- Fixed in
- 6.2.10
- Check
mvn dependency:tree -Dincludes=org.springframework.security:spring-security-crypto
org.springframework.security:spring-security-crypto
- Ecosystem
- Maven
- Affected
- >= 6.1.0, <= 6.1.13
- Fixed in
- 6.1.14
- Check
mvn dependency:tree -Dincludes=org.springframework.security:spring-security-crypto
org.springframework.security:spring-security-crypto
- Ecosystem
- Maven
- Affected
- >= 6.0.0, <= 6.0.15
- Fixed in
- 6.0.16
- Check
mvn dependency:tree -Dincludes=org.springframework.security:spring-security-crypto
org.springframework.security:spring-security-crypto
- Ecosystem
- Maven
- Affected
- >= 5.8.0, <= 5.8.17
- Fixed in
- 5.8.18
- Check
mvn dependency:tree -Dincludes=org.springframework.security:spring-security-crypto
org.springframework.security:spring-security-crypto
- Ecosystem
- Maven
- Affected
- <= 5.7.15
- Fixed in
- 5.7.16
- Check
mvn dependency:tree -Dincludes=org.springframework.security:spring-security-crypto
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
