Advisory Database
  • Advisories
  • Dependency Scanning
  1. maven
  2. ›
  3. org.springframework.security/spring-security-crypto
  4. ›
  5. CVE-2025-22228

CVE-2025-22228: Spring Security Does Not Enforce Password Length

March 20, 2025 (updated April 26, 2025)

BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.

References

  • github.com/advisories/GHSA-mg83-c7gq-rv5c
  • github.com/spring-projects/spring-security
  • github.com/spring-projects/spring-security/commit/46f0dc6dfc8402cd556c598fdf2d31f9d46cdbf3
  • nvd.nist.gov/vuln/detail/CVE-2025-22228
  • security.netapp.com/advisory/ntap-20250425-0009
  • spring.io/security/cve-2025-22228

Code Behaviors & Features

Detect and mitigate CVE-2025-22228 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 5.7.16, all versions starting from 5.8.0 before 5.8.18, all versions starting from 6.0.0 before 6.0.16, all versions starting from 6.1.0 before 6.1.14, all versions starting from 6.2.0 before 6.2.10, all versions starting from 6.3.0 before 6.3.8, all versions starting from 6.4.0 before 6.4.4

Fixed versions

  • 6.3.8
  • 6.4.4
  • 6.2.10
  • 6.1.14
  • 6.0.16
  • 5.8.18
  • 5.7.16

Solution

Upgrade to versions 5.7.16, 5.8.18, 6.0.16, 6.1.14, 6.2.10, 6.3.8, 6.4.4 or above.

Impact 7.4 HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-287: Improper Authentication
  • CWE-521: Weak Password Requirements

Source file

maven/org.springframework.security/spring-security-crypto/CVE-2025-22228.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:50 +0000.