CVE-2024-22271: Spring Framework Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-j4r7-p9fp-w3f3
CVSS 8.2
CWE-20
Published
Advisory Summary

CVE-2024-22271 is a HIGH (CVSS 8.2) denial of service vulnerability (CWE-20: Improper Input Validation) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring cloud function framework vulnerable to denial of service. Remediation is available by upgrading affected packages to version 4.0.8, 4.1.2.

CVE-2024-22271 at a Glance

CVE Identifier CVE-2024-22271
GHSA Identifier GHSA-j4r7-p9fp-w3f3
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-20: Improper Input Validation
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:N/I:L/A:H).

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 None (C:N)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2024-22271

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.cloud:spring-cloud-function-context fixed: 4.0.8
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-function-context</artifactId>
    <version>4.0.8</version>
</dependency>
org.springframework.cloud:spring-cloud-function-context fixed: 4.1.2
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-function-context</artifactId>
    <version>4.1.2</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.cloud

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-22271, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.springframework.cloud

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 4.0.8), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.springframework.cloud 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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 Cloud Function framework, versions 4.1.x prior to 4.1.2, 4.0.x prior to 4.0.8 an application is vulnerable to a DOS attack when attempting to compose functions with non-existing functions. Specifically, an application is vulnerable when all of the following are true: User is using Spring Cloud Function Web module Affected Spring Products and Versions Spring Cloud Function Framework 4.1.0 to 4.1.2 4.0.0 to 4.0.8 References https://spring.io/security/cve-2022-22979   https://checkmarx.com/blog/spring-function-cloud-dos-cve-2022-22979-and-unintended-function-invocation/  History 2020-01-16: Initial vulnerability report published.

CVE-2024-22271 Affected Spring Framework Versions

2 component(s)
Fixed Versions:
4.0.84.1.2
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.cloud:spring-cloud-function-context
Maven
≥ 4.0.0
< 4.0.8
4.0.8
org.springframework.cloud:spring-cloud-function-context
Maven
≥ 4.1.0
< 4.1.2
4.1.2

References

Frequently Asked Questions

What is CVE-2024-22271?
CVE-2024-22271 is a security vulnerability in Spring Framework involving Spring Cloud Function Framework vulnerable to Denial of Service under CWE-20: Improper Input Validation.
Which Spring Framework versions are affected?
Affected versions include releases prior to 4.0.8, 4.1.2 across affected packages: org.springframework.cloud:spring-cloud-function-context.
What version fixes CVE-2024-22271?
Upgrading to 4.0.8, 4.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-cloud-function-context affected?
Yes, org.springframework.cloud:spring-cloud-function-context is affected in releases prior to 4.0.8, 4.1.2. Upgrade your dependency to 4.0.8, 4.1.2 or later.
What is the CVSS score of CVE-2024-22271?
CVE-2024-22271 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:N/I:L/A:H.
What CWE is associated with CVE-2024-22271?
CVE-2024-22271 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Maven dependencies for CVE-2024-22271?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.cloud'. 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-j4r7-p9fp-w3f3",
  "modified" : "2024-07-09T21:13:48Z",
  "published" : "2024-07-09T15:30:53Z",
  "aliases" : [ "CVE-2024-22271" ],
  "summary" : "Spring Cloud Function Framework vulnerable to Denial of Service",
  "details" : "In Spring Cloud Function framework, versions 4.1.x prior to 4.1.2, 4.0.x prior to 4.0.8 an application is vulnerable to a DOS attack when attempting to compose functions with non-existing functions.\n\nSpecifically, an application is vulnerable when all of the following are true:\n\nUser is using Spring Cloud Function Web module\n\nAffected Spring Products and Versions Spring Cloud Function Framework 4.1.0 to 4.1.2 4.0.0 to 4.0.8\n\nReferences  https://spring.io/security/cve-2022-22979   https://checkmarx.com/blog/spring-function-cloud-dos-cve-2022-22979-and-unintended-function-invocation/  History 2020-01-16: Initial vulnerability report published.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.cloud:spring-cloud-function-context"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.cloud:spring-cloud-function-context"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22271"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-cloud/spring-cloud-function/issues/1139"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-cloud/spring-cloud-function/commit/59fe298b67fcb9249db727a7b3a33612fc7a9f75"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-cloud/spring-cloud-function"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-cloud/spring-cloud-function/releases/tag/v4.1.2"
  }, {
    "type" : "WEB",
    "url" : "https://spring.io/security/cve-2024-22271"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-09T21:13:48Z",
    "nvd_published_at" : "2024-07-09T13:15:09Z"
  }
}