CVE-2025-22228

published 20 Mar 2025 · updated 26 Feb 2026

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

7.4HighCVSS 7.4EPSS 1%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 1%. Fixed in 5.7.16, 5.8.18, 6.0.16 and 4 more.

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

Vendors, products and packages with version ranges

VendorProductVersionsFixed
Spring>=5.7.x <5.7.16, >=5.8.x <5.8.18, >=6.0.x <6.0.16, >=6.1.x <6.1.14, >=6.2.x <6.2.10, >=6.3.x <6.3.8, >=6.4.x <6.4.45.7.16, 5.8.18, 6.0.16, 6.1.14, 6.2.10, 6.3.8, 6.4.4

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2025-22228 severity on Zeptric[![CVE-2025-22228](https://zeptric.io/badge/cve/CVE-2025-22228.svg)](https://zeptric.io/cve/CVE-2025-22228)