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

- Severity: High 7.4 (CVSS:3.1, scored by vmware) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.61%, higher than 50% of CVEs (2026-12-01)
- Published: 2025-03-20T05:49:19.275Z
- Modified: 2026-09-10T03:49:48.718Z
- Also known as: GHSA-mg83-c7gq-rv5c
- Weaknesses: CWE-287, CWE-521
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: vmware

## 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.

(As written by CVE List.)

## Affected

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

## Every score

- vmware: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`

## References

- <https://spring.io/security/cve-2025-22228> (web)
- <https://security.netapp.com/advisory/ntap-20250425-0009/>
- <https://nvd.nist.gov/vuln/detail/CVE-2025-22228> (advisory)
- <https://github.com/spring-projects/spring-security/commit/46f0dc6dfc8402cd556c598fdf2d31f9d46cdbf3> (web)
- <https://github.com/spring-projects/spring-security> (package)
- <https://security.netapp.com/advisory/ntap-20250425-0009> (web)

## Sources

- CVE List: [CVE-2025-22228](https://www.cve.org/CVERecord?id=CVE-2025-22228), CVE Terms of Use, modified 2026-02-26
- GitHub Advisory Database: [GHSA-mg83-c7gq-rv5c](https://github.com/advisories/GHSA-mg83-c7gq-rv5c), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-22228](https://nvd.nist.gov/vuln/detail/CVE-2025-22228), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-22228 · Whole record: https://cve.day/CVE-2025-22228.json · Rebuilt by cve.day 2026-11-25T22:58:55.370Z
