{"id":"CVE-2025-22228","published":"2025-03-20T05:49:19Z","modified":"2026-02-26T19:09:20Z","title":"CVE-2025-22228: Spring Security BCryptPasswordEncoder does not enforce maximum password length","vendor":"Spring","product":"Spring Security","tier":"tail","description":{"text":"BCryptPasswordEncoder.matches(CharSequence,String) will incorrectly return true for passwords larger than 72 characters as long as the first 72 characters are the same.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.4,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0061,"percentile":0.50162,"provenance":"source"},"cwes":[{"id":"CWE-287","name":"Improper Authentication"}],"references":[{"url":"https://spring.io/security/cve-2025-22228","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20250425-0009/","tags":[]}],"priority":{"score":15.2,"factors":[{"name":"EPSS percentile","points":10.03},{"name":"CVSS severity","points":5.18}]},"vendorSlug":"spring","affectedVersions":[{"vendor":"Spring","product":"Spring Security","versions":[">= 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.4"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-03-21T03:55:17.357088Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Maven","package":"org.springframework.security:spring-security-crypto","vulnerableRanges":[">=6.3.0, <6.3.8",">=6.4.0, <6.4.4",">=6.2.0, <6.2.10",">=6.1.0, <6.1.14",">=6.0.0, <6.0.16",">=5.8.0, <5.8.18","<5.7.16"],"patched":["6.3.8","6.4.4","6.2.10","6.1.14","6.0.16","5.8.18","5.7.16"],"from":["GHSA-mg83-c7gq-rv5c"],"provenance":"source"}],"summary":{"text":"Spring Security's BCryptPasswordEncoder, in its matches(CharSequence, String) method, incorrectly accepts passwords longer than 72 characters whenever their first 72 characters match the stored password. An attacker who can submit login attempts over the network, without authentication or user interaction, can authenticate by supplying any password that shares the first 72 characters of the real one, provided the application uses this encoder for password checks.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:30:33Z"},"euvd":{"id":"EUVD-2025-6744","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-spring-security-cve-2022-22976","parents":[{"from":"CVE-2022-22976","to":"CVE-2025-22228","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["crypto/src/main/java/org/springframework/security/crypto/bcrypt/BCrypt.java"],"commits":["https://github.com/spring-projects/spring-security/commit/388a7b62b906bd56deadb7ca45248fa1a63bdf12","https://github.com/spring-projects/spring-security/commit/a40f73521c0dd88b879ff6165d280e78bdf8154f","https://github.com/spring-projects/spring-security/commit/46f0dc6dfc8402cd556c598fdf2d31f9d46cdbf3"],"basis":"shared function","functions":["hashpw"]}]}],"children":[{"from":"CVE-2025-22228","to":"CVE-2025-22234","relation":"regression","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"regression","quote":"The fix applied in CVE-2025-22228 inadvertently broke the timing attack mitigation implemented in DaoAuthenticationProvider.","from":"CVE.org","in":"CVE-2025-22234"}]}]}}