Authentication Bypass by Primary Weakness Affecting org.springframework.security:spring-security-crypto package, versions [,6.3.8)[6.4.0,6.4.4)


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-ORGSPRINGFRAMEWORKSECURITY-9486467
  • published20 Mar 2025
  • disclosed19 Mar 2025
  • creditLars Bruun-Hansen

Introduced: 19 Mar 2025

NewCVE-2025-22228  (opens in a new tab)
CWE-305  (opens in a new tab)

How to fix?

Upgrade org.springframework.security:spring-security-crypto to version 6.3.8, 6.4.4 or higher.

Overview

org.springframework.security:spring-security-crypto is a spring-security-crypto library for Spring Security.

Affected versions of this package are vulnerable to Authentication Bypass by Primary Weakness in the BCryptPasswordEncoder.matches() function, which only takes the first 72 characters for comparison. Passwords longer than this will incorrectly return true when compared against other strings sharing the same first 72 characters, making them easier to brute force.

Note: Patches have also been issued for older versions of Enterprise Support packages.

CVSS Base Scores

version 4.0
version 3.1