Authentication bypass via BCrypt password truncation
Published Mar 20, 2025 · Updated Feb 26, 2026
Authentication bypass in Spring Security 6.4.3 and earlier allows remote attackers to access accounts via crafted long passwords. BCryptPasswordEncoder.matches(CharSequence,String) passes supplied UTF-8 password bytes to BCrypt without rejecting input over 72 bytes, so BCrypt ignores the suffix and compares only the first 72 bytes. The target account must use a password over 72 bytes, and remote attackers must know its first 72 bytes to authenticate as that account.
Summary
What happened
Authentication bypass in Spring Security 6.4.3 and earlier allows remote attackers to access accounts via crafted long passwords. BCryptPasswordEncoder.matches(CharSequence,String) passes supplied UTF-8 password bytes to BCrypt without rejecting input over 72 bytes, so BCrypt ignores the suffix and compares only the first 72 bytes. The target account must use a password over 72 bytes, and remote attackers must know its first 72 bytes to authenticate as that account.
The record
- CVE
- CVE-2025-22228
- Published
- Mar 20, 2025
- Updated
- Feb 26, 2026
- Vendor
- Spring
- Product
- Spring Security
- Classifications
- CWE-521, CWE-287, T1078
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Mar 20, 2025CVE publishedPublication date reported by the CVE source.
- Feb 26, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=5.7.x <5.7.16
- Affected versionversion=5.8.x <5.8.18
- Affected versionversion=6.0.x <6.0.16
- Affected versionversion=6.1.x <6.1.14
- Affected versionversion=6.2.x <6.2.10
- Affected versionversion=6.3.x <6.3.8
- Affected versionversion=6.4.x <6.4.4
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
No public exploit references are available in this record.
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo