CVE-2025-22228
7.4high
CVE-2025-22228: Spring Security BCryptPasswordEncoder does not enforce maximum password length
- Severity
- 7.4high CVSS:3.1 by vmware
- Exploit likelihood
- 0.61% (higher than 50% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- vmware
- Also known as
- GHSA-mg83-c7gq-rv5c
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
| Product or package | Versions | Reported by |
|---|---|---|
| Spring Security | from 5.7.x before 5.7.16, from 5.8.x before 5.8.18, from 6.0.x before 6.0.16, from 6.1.x before 6.1.14, from 6.2.x before 6.2.10, from 6.3.x before 6.3.8, from 6.4.x before 6.4.4 | CVE List |
| org.springframework.security:spring-security-crypto (Maven) | from 6.3.0 before 6.3.8, from 6.4.0 before 6.4.4, from 6.2.0 before 6.2.10, from 6.1.0 before 6.1.14, from 6.0.0 before 6.0.16, from 5.8.0 before 5.8.18, before 5.7.16 | GitHub Advisory Database |
All scores
| vmware | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
| GitHub | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
Classification
What each source says
CVE List
BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.
NVD (es)
BCryptPasswordEncoder.matches(CharSequence,String) devolverá incorrectamente verdadero para contraseñas con más de 72 caracteres siempre que los primeros 72 caracteres sean iguales.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-22228 changed 2026-02-26 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mg83-c7gq-rv5c changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2025-22228 changed 2026-06-17 | Public domain |