Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-22228: Vulnerability in Spring Spring Security

0
High
VulnerabilityCVE-2025-22228cvecve-2025-22228
Published: Thu Mar 20 2025 (03/20/2025, 05:49:19 UTC)
Source: CVE
Vendor/Project: Spring
Product: Spring Security

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.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 02/26/2026, 23:47:30 UTC

Technical Analysis

CVE-2025-22228 identifies a critical vulnerability in the Spring Security framework's BCryptPasswordEncoder.matches(CharSequence, String) method. BCrypt, a widely used password hashing algorithm, truncates input passwords to 72 characters during hashing. However, the vulnerable implementation incorrectly returns true for password matches if the first 72 characters match, regardless of any additional characters appended beyond this limit. This means an attacker can authenticate successfully by providing a password that matches the first 72 characters of the legitimate password, followed by any arbitrary characters, effectively bypassing the intended password verification process. The vulnerability affects a broad range of Spring Security versions, specifically 5.7.x through 6.4.x, indicating a long-standing issue across multiple releases. The CVSS v3.1 score of 7.4 reflects a high severity, with network attack vector, high attack complexity, no privileges required, and no user interaction needed. The flaw impacts confidentiality and integrity by allowing unauthorized access without affecting availability. No patches are currently linked, and no known exploits have been reported in the wild, but the risk remains significant due to the widespread use of Spring Security in enterprise Java applications. The CWE-287 classification highlights an authentication bypass weakness. Given the critical role of authentication in securing applications, this vulnerability poses a serious threat to systems relying on Spring Security for user authentication.

Potential Impact

The primary impact of CVE-2025-22228 is unauthorized access due to authentication bypass. Attackers can exploit this vulnerability to gain access to systems protected by Spring Security without knowing the full password, only the first 72 characters. This compromises confidentiality by exposing sensitive user data and integrity by allowing unauthorized actions under compromised accounts. Since Spring Security is widely used in enterprise Java applications, the scope of affected systems is extensive, including web applications, APIs, and microservices. The vulnerability does not affect availability directly but can lead to further attacks such as privilege escalation, data exfiltration, or lateral movement within networks. Organizations relying on vulnerable versions face increased risk of account compromise, data breaches, and potential regulatory non-compliance due to weakened authentication controls. The lack of required privileges or user interaction lowers the barrier for exploitation, increasing the threat landscape. The high attack complexity rating indicates some effort is needed, but skilled attackers can leverage this flaw effectively. Overall, the vulnerability undermines trust in authentication mechanisms and can have severe operational and reputational consequences.

Mitigation Recommendations

To mitigate CVE-2025-22228, organizations should prioritize upgrading to patched versions of Spring Security once available, as this is the most effective and permanent solution. Until patches are released, consider implementing the following specific mitigations: 1) Enforce maximum password length validation on the client and server side to limit passwords to 72 characters or fewer, preventing attackers from exploiting the truncation behavior. 2) Supplement BCrypt with additional hashing or salting mechanisms that do not truncate input, or switch to alternative password encoders that handle longer passwords correctly. 3) Implement multi-factor authentication (MFA) to reduce reliance on password strength alone and mitigate the risk of compromised credentials. 4) Conduct thorough code reviews and penetration testing focused on authentication logic to detect similar weaknesses. 5) Monitor authentication logs for unusual login attempts involving long passwords or repeated failures followed by success. 6) Educate developers about the limitations of BCrypt and secure password handling best practices. 7) Restrict network access to authentication endpoints where feasible to reduce exposure. These targeted actions go beyond generic advice and address the root cause and exploitation vectors of the vulnerability.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.1
Assigner Short Name
vmware
Date Reserved
2025-01-02T04:29:59.191Z
Cisa Enriched
true

Threat ID: 682d983ec4522896dcbefae9

Added to database: 5/21/2025, 9:09:18 AM

Last enriched: 2/26/2026, 11:47:30 PM

Last updated: 3/26/2026, 9:35:43 AM

Views: 65

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses