CVE-2024-22262: Spring Framework Spring Framework URL Parsing With Vulnerability

HIGH
Advisory Identifier: GHSA-2wrp-6fg6-hmc5
CVSS 8.1
CWE-601
Published
Advisory Summary

CVE-2024-22262 is a HIGH (CVSS 8.1) spring framework url parsing with vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring framework url parsing with host validation. Remediation is available by upgrading affected packages to version 5.3.34, 6.0.19, 6.1.6.

CVE-2024-22262 at a Glance

CVE Identifier CVE-2024-22262
GHSA Identifier GHSA-2wrp-6fg6-hmc5
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.1

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:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-22262

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:spring-web fixed: 5.3.34
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>5.3.34</version>
</dependency>
org.springframework:spring-web fixed: 6.0.19
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>6.0.19</version>
</dependency>
org.springframework:spring-web fixed: 6.1.6
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>6.1.6</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

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.springframework

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

Note: The mvn dependency:tree -Dincludes=org.springframework 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. 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

Applications that use UriComponentsBuilder to parse an externally provided URL (e.g. through a query parameter) AND perform validation checks on the host of the parsed URL may be vulnerable to a open redirect https://cwe.mitre.org/data/definitions/601.html  attack or to a SSRF attack if the URL is used after passing validation checks. This is the same as CVE-2024-22259 https://spring.io/security/cve-2024-22259  and CVE-2024-22243 https://spring.io/security/cve-2024-22243 , but with different input.

CVE-2024-22262 Affected Spring Framework Versions

3 component(s)
Fixed Versions:
5.3.346.0.196.1.6
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework:spring-web
Maven
< 5.3.34
5.3.34
org.springframework:spring-web
Maven
≥ 6.0.0
< 6.0.19
6.0.19
org.springframework:spring-web
Maven
≥ 6.1.0
< 6.1.6
6.1.6

References

Frequently Asked Questions

What is CVE-2024-22262?
CVE-2024-22262 is a security vulnerability in Spring Framework involving Spring Framework URL Parsing with Host Validation under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Spring Framework versions are affected?
Affected versions include releases prior to 5.3.34, 6.0.19, 6.1.6 across affected packages: org.springframework:spring-web.
What version fixes CVE-2024-22262?
Upgrading to 5.3.34, 6.0.19, 6.1.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-web affected?
Yes, org.springframework:spring-web is affected in releases prior to 5.3.34, 6.0.19, 6.1.6. Upgrade your dependency to 5.3.34, 6.0.19, 6.1.6 or later.
What is the CVSS score of CVE-2024-22262?
CVE-2024-22262 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-22262?
CVE-2024-22262 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Maven dependencies for CVE-2024-22262?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework'. 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-2wrp-6fg6-hmc5",
  "modified" : "2025-02-13T19:00:56Z",
  "published" : "2024-04-16T06:30:28Z",
  "aliases" : [ "CVE-2024-22262" ],
  "summary" : "Spring Framework URL Parsing with Host Validation",
  "details" : "Applications that use UriComponentsBuilder to parse an externally provided URL (e.g. through a query parameter) AND perform validation checks on the host of the parsed URL may be vulnerable to a  open redirect https://cwe.mitre.org/data/definitions/601.html  attack or to a SSRF attack if the URL is used after passing validation checks.\n\nThis is the same as  CVE-2024-22259 https://spring.io/security/cve-2024-22259  and  CVE-2024-22243 https://spring.io/security/cve-2024-22243 , but with different input.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework:spring-web"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.3.34"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework:spring-web"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.19"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework:spring-web"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.1.0"
      }, {
        "fixed" : "6.1.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22262"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-projects/spring-framework"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-framework/blob/main/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240524-0003"
  }, {
    "type" : "WEB",
    "url" : "https://spring.io/security/cve-2024-22262"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-16T16:15:13Z",
    "nvd_published_at" : "2024-04-16T06:15:46Z"
  }
}