7.4
CWE
521 287
Advisory Published
Advisory Published
Updated

CVE-2025-22228: Spring Security BCryptPasswordEncoder does not enforce maximum password length

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 SoftwareAffected VersionHow 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

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of CVE-2025-22228?

    CVE-2025-22228 is considered a high-severity vulnerability due to its impact on password validation.

  • How do I fix CVE-2025-22228?

    To fix CVE-2025-22228, update to the latest version of Spring Security that addresses this vulnerability.

  • What impact does CVE-2025-22228 have on password security?

    CVE-2025-22228 can allow unauthorized access as it may incorrectly validate long passwords that share the same first 72 characters.

  • Which versions of Spring Security are affected by CVE-2025-22228?

    CVE-2025-22228 affects all versions of Spring Security that do not include the fix for this vulnerability.

  • Is CVE-2025-22228 exploitable in any application?

    CVE-2025-22228 is exploitable in applications that use BCryptPasswordEncoder for password validation, particularly with long passwords.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203