Vulnerability · Published Mar 20, 2025 · Assigned by vmware
CVE-2025-22228CVE-2025-22228: Spring Security BCryptPasswordEncoder does not enforce maximum password length
High 7.4
In plain English
A high-severity improper authentication in Spring Security from Spring. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 49% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Severity (CVSS 3.1)7.4High
Exploit odds (30 days)0.6%top 50.6% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known
Official description
BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Maven | org.springframework.security:spring-security-crypto | 6.3.8 | GHSA-mg83-c7gq-rv5c |
| Maven | org.springframework.security:spring-security-crypto | 6.4.4 | GHSA-mg83-c7gq-rv5c |
| Maven | org.springframework.security:spring-security-crypto | 6.2.10 | GHSA-mg83-c7gq-rv5c |
| Maven | org.springframework.security:spring-security-crypto | 6.1.14 | GHSA-mg83-c7gq-rv5c |
| Maven | org.springframework.security:spring-security-crypto | 6.0.16 | GHSA-mg83-c7gq-rv5c |
| Maven | org.springframework.security:spring-security-crypto | 5.8.18 | GHSA-mg83-c7gq-rv5c |
| Maven | org.springframework.security:spring-security-crypto | 5.7.16 | GHSA-mg83-c7gq-rv5c |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Spring | Spring Security | 5.7.x – before 5.7.165.8.x – before 5.8.186.0.x – before 6.0.166.1.x – before 6.1.146.2.x – before 6.2.106.3.x – before 6.3.86.4.x – before 6.4.4 |
Weakness: CWE-287 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N