Skip to main content
← All vulnerabilities
CVE-2025-22228GHSA-MG83-C7GQ-RV5C

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

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 5.7.16, 5.8.18, 6.0.16, 6.1.14, 6.2.10, and 2 more
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: none
  • Automatable: no
  • Technical impact: total

Summary

BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: total

  3. Record last updated

Affected versions

  • Spring Security

    From 5.7.x · fixed in 5.7.16; From 5.8.x · fixed in 5.8.18; From 6.0.x · fixed in 6.0.16; From 6.1.x · fixed in 6.1.14; From 6.2.x · fixed in 6.2.10; From 6.3.x · fixed in 6.3.8; From 6.4.x · fixed in 6.4.4

  • org.springframework.security:spring-security-cryptoMaven

    From 6.3.0 · fixed in 6.3.8

  • org.springframework.security:spring-security-cryptoMaven

    From 6.4.0 · fixed in 6.4.4

  • org.springframework.security:spring-security-cryptoMaven

    From 6.2.0 · fixed in 6.2.10

  • org.springframework.security:spring-security-cryptoMaven

    From 6.1.0 · fixed in 6.1.14

  • org.springframework.security:spring-security-cryptoMaven

    From 6.0.0 · fixed in 6.0.16

  • org.springframework.security:spring-security-cryptoMaven

    From 5.8.0 · fixed in 5.8.18

  • org.springframework.security:spring-security-cryptoMaven

    fixed in 5.7.16

References 1

spring.io