CVE-2025-22228
JSON

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 packageVersionsReported by
Spring Securityfrom 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.4CVE 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.16GitHub Advisory Database

All scores

vmware7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
GitHub7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Classification

CWE-287CWE-521

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

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

SourceRecordLicence
CVE ListCVE-2025-22228 changed 2026-02-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-mg83-c7gq-rv5c changed 2026-09-10CC-BY-4.0
NVDCVE-2025-22228 changed 2026-06-17Public domain