Spring Security logout not clearing security context
Published 19 Apr 2023 · Updated 16 Feb 2024
Is your project on an affected org.springframework.security:spring-security-core?
Look after several Java apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=5.7.0 <5.7.8
- Fixed in
- 5.7.8
mvn versions:use-dep-version -Dincludes=org.springframework.security:spring-security-core -DdepVersion=5.7.8 -DforceVersion=true- Affected
- >=5.8.0 <5.8.3
- Fixed in
- 5.8.3
mvn versions:use-dep-version -Dincludes=org.springframework.security:spring-security-core -DdepVersion=5.8.3 -DforceVersion=true- Affected
- >=6.0.0 <6.0.3
- Fixed in
- 6.0.3
mvn versions:use-dep-version -Dincludes=org.springframework.security:spring-security-core -DdepVersion=6.0.3 -DforceVersion=trueDetails
In Spring Security, versions 5.7.x prior to 5.7.8, versions 5.8.x prior to 5.8.3, and versions 6.0.x prior to 6.0.3, the logout support does not properly clean the security context if using serialized versions. Additionally, it is not possible to explicitly save an empty security context to the HttpSessionSecurityContextRepository. This vulnerability can keep users authenticated even after they performed logout. Users of affected versions should apply the following mitigation. 5.7.x users should upgrade to 5.7.8. 5.8.x users should upgrade to 5.8.3. 6.0.x users should upgrade to 6.0.3.
Is GHSA-x873-6rgc-94jc in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected org.springframework.security:spring-security-core, and gives you the command that fixes it.
More advisories for org.springframework.security:spring-security-core
- LowCVE-2026-22746Spring Security Vulnerable to User Attribute Enumeration when Using DaoAuthenticationProvider · 22 Apr 2026
- MediumCVE-2026-22751Spring Security Core has a TOCTOU race condition when One-Time Token login with JdbcOneTimeTokenService is configured · 21 Apr 2026
- MediumCVE-2025-22234Spring Security has a broken timing attack mitigation implemented in DaoAuthenticationProvide · 22 Jan 2026
- HighCVE-2025-41248Spring Security annotation detection mechanism has authorization bypass · 16 Sept 2025
- CriticalCVE-2025-41232Spring Security authorization bypass for method security annotations on private methods · 21 May 2025
- MediumCVE-2025-22223Spring Security Vulnerable to Authorization Bypass via Security Annotations · 24 Mar 2025
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.