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

EcosystemPackageFixed inAdvisory
Mavenorg.springframework.security:spring-security-crypto6.3.8GHSA-mg83-c7gq-rv5c
Mavenorg.springframework.security:spring-security-crypto6.4.4GHSA-mg83-c7gq-rv5c
Mavenorg.springframework.security:spring-security-crypto6.2.10GHSA-mg83-c7gq-rv5c
Mavenorg.springframework.security:spring-security-crypto6.1.14GHSA-mg83-c7gq-rv5c
Mavenorg.springframework.security:spring-security-crypto6.0.16GHSA-mg83-c7gq-rv5c
Mavenorg.springframework.security:spring-security-crypto5.8.18GHSA-mg83-c7gq-rv5c
Mavenorg.springframework.security:spring-security-crypto5.7.16GHSA-mg83-c7gq-rv5c

Affected products (as reported)

VendorProductVersions
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

References