CVE-2024-22257: Spring Framework Erroneous Authentication Pass Vulnerability

HIGH
Advisory Identifier: GHSA-f3jh-qvm4-mg39
CVSS 8.2
CWE-287 CWE-862
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2024-22257
GHSA Identifier GHSA-f3jh-qvm4-mg39
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-287: Improper Authentication
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (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.

org.springframework.security:spring-security-core fixed: 5.7.12
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>5.7.12</version>
</dependency>
org.springframework.security:spring-security-core fixed: 5.8.11
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>5.8.11</version>
</dependency>
org.springframework.security:spring-security-core fixed: 6.1.8
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>6.1.8</version>
</dependency>
org.springframework.security:spring-security-core fixed: 6.2.3
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>6.2.3</version>
</dependency>
Verify Direct and Transitive Dependencies

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

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. Specifically, an application is vulnerable if: The application uses AuthenticatedVoter directly and a null authentication parameter is passed to it resulting in an erroneous true return value. An application is not vulnerable if any of the following is true: * The application does not use AuthenticatedVoter#vote directly. * The application does not pass null to AuthenticatedVoter#vote. Note that AuthenticatedVoter is deprecated since 5.8, use implementations of AuthorizationManager as a replacement.

CVE-2024-22257 Affected Spring Framework Versions

4 component(s)
Fixed Versions:
5.7.125.8.116.1.86.2.3
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?
CVE-2024-22257 is a security vulnerability in Spring Framework involving Erroneous authentication pass in Spring Security under CWE-287: Improper Authentication.
Which Spring Framework versions are affected?
Affected versions include releases prior to 5.7.12, 5.8.11, 6.1.8, 6.2.3 across affected packages: org.springframework.security:spring-security-core.
What version fixes CVE-2024-22257?
Upgrading to 5.7.12, 5.8.11, 6.1.8, 6.2.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-security-core affected?
Yes, org.springframework.security:spring-security-core is affected in releases prior to 5.7.12, 5.8.11, 6.1.8, 6.2.3. Upgrade your dependency to 5.7.12, 5.8.11, 6.1.8, 6.2.3 or later.
What is the CVSS score of CVE-2024-22257?
CVE-2024-22257 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2024-22257?
CVE-2024-22257 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Maven dependencies for CVE-2024-22257?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.security'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}