GHSA-x873-6rgc-94jc CVE-2023-20862
Spring Security logout not clearing security context
- Severity
- 6.3 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 0.65%
- Chance of exploitation in the next 30 days. Higher than 51.05% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-459 Incomplete Cleanup
- Fix
5.7.8- Upgrade org.springframework.security:spring-security-core to this version or later
Description
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.
Affected versions
Maven
| Package | Vulnerable | Fixed in |
|---|---|---|
| org.springframework.security:spring-security-core | >= 5.7.0, < 5.7.8 |
5.7.8 |
| org.springframework.security:spring-security-core | >= 5.8.0, < 5.8.3 |
5.8.3 |
| org.springframework.security:spring-security-core | >= 6.0.0, < 6.0.3 |
6.0.3 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
org.springframework.security:spring-security-core Maven → 5.7.8
- maven
<dependency><groupId>org.springframework.security</groupId><artifactId>spring-security-core</artifactId><version>5.7.8</version></dependency>- gradle
implementation("org.springframework.security:spring-security-core:5.7.8")
Severity breakdown
CVSS 3.1 6.3
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
Weakness
CWE-459: Incomplete Cleanup
The product does not properly "clean up" and remove temporary or supporting resources after they have been used.
How to prevent it
- Architecture and Design, Implementation: Temporary files and other supporting resources should be deleted/released immediately after they are no longer needed.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-vxf7-qj7q-83fh Spring Security Vulnerable to User Attribute Enumeration when Using DaoAuthenticationProvider | Low | Also affects org.springframework.security:spring-security-core |
| GHSA-x2wq-9x2f-fhj7 Spring Security Core has a TOCTOU race condition when One-Time Token login with JdbcOneTimeTokenService is configured | Medium | Also affects org.springframework.security:spring-security-core |
| GHSA-vqxh-445g-37fc Spring Security has a broken timing attack mitigation implemented in DaoAuthenticationProvide | Medium | Also affects org.springframework.security:spring-security-core |
| GHSA-8v5q-rhf3-jphm Spring Security annotation detection mechanism has authorization bypass | High | Also affects org.springframework.security:spring-security-core |
| GHSA-9pp5-9c7g-4r83 Spring Security authorization bypass for method security annotations on private methods | Critical | Also affects org.springframework.security:spring-security-core |
| GHSA-hh3m-g4qj-4835 Spring Security Vulnerable to Authorization Bypass via Security Annotations | Medium | Also affects org.springframework.security:spring-security-core |
| GHSA-q3v6-hm2v-pw99 Spring Framework has Authorization Bypass for Case Sensitive Comparisons | Medium | Also affects org.springframework.security:spring-security-core |
| GHSA-hmqf-wpq9-jq83 Spring Security Missing Authorization vulnerability | High | Also affects org.springframework.security:spring-security-core |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor