CVE-2024-22257: Spring Framework Erroneous Authentication Pass Vulnerability
HIGHCVE-2024-22257 is a HIGH (CVSS 8.2) erroneous authentication pass vulnerability (CWE-287: Improper Authentication) affecting Spring Framework libraries in the Maven ecosystem. The issue involves erroneous authentication pass in spring security. Remediation is available by upgrading affected packages to version 5.7.12, 5.8.11, 6.1.8, 6.2.3.
CVE-2024-22257 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N).
How to Fix CVE-2024-22257
To remediate this vulnerability, upgrade all affected Spring Framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.7.12</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.8.11</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>6.1.8</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>6.2.3</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.springframework.security
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2024-22257, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.springframework.security
Analyze the terminal output to locate any version of Spring Framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.7.12), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.springframework.security command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Spring Framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-22257 Affected Spring Framework Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.springframework.security:spring-security-core
|
Maven |
< 5.7.12
|
5.7.12
|
|
org.springframework.security:spring-security-core
|
Maven |
≥ 5.8.0
< 5.8.11
|
5.8.11
|
|
org.springframework.security:spring-security-core
|
Maven |
≥ 6.0.0
< 6.1.8
|
6.1.8
|
|
org.springframework.security:spring-security-core
|
Maven |
≥ 6.2.0
< 6.2.3
|
6.2.3
|
References
Frequently Asked Questions
What is CVE-2024-22257?
Which Spring Framework versions are affected?
What version fixes CVE-2024-22257?
Is spring-security-core affected?
What is the CVSS score of CVE-2024-22257?
What CWE is associated with CVE-2024-22257?
How can I check Maven dependencies for CVE-2024-22257?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f3jh-qvm4-mg39",
"modified" : "2025-02-13T19:05:40Z",
"published" : "2024-03-18T15:30:51Z",
"aliases" : [ "CVE-2024-22257" ],
"summary" : "Erroneous authentication pass in Spring Security",
"details" : "In Spring Security, versions 5.7.x prior to 5.7.12, 5.8.x prior to 5.8.11, versions 6.0.x prior to 6.0.9, versions 6.1.x prior to 6.1.8, versions 6.2.x prior to 6.2.3, an application is possible vulnerable to broken access control when it directly uses the AuthenticatedVoter#vote passing a null Authentication parameter.\n\nSpecifically, an application is vulnerable if:\n\nThe application uses AuthenticatedVoter directly and a null authentication parameter is passed to it resulting in an erroneous true return value.\n\nAn application is not vulnerable if any of the following is true:\n\n* The application does not use AuthenticatedVoter#vote directly.\n* The application does not pass null to AuthenticatedVoter#vote.\n\nNote that AuthenticatedVoter is deprecated since 5.8, use implementations of AuthorizationManager as a replacement.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.7.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.8.0"
}, {
"fixed" : "5.8.11"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.1.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.2.0"
}, {
"fixed" : "6.2.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22257"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-security/commit/5a7f12f1a9fdb4edaab6f61495f1d781a7273b61"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/spring-projects/spring-security"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20240419-0005"
}, {
"type" : "WEB",
"url" : "https://spring.io/security/cve-2024-22257"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287", "CWE-862" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-18T20:10:27Z",
"nvd_published_at" : "2024-03-18T15:15:41Z"
}
}