CVE-2023-34036: Spring Framework Spring HATEOAS Vulnerable To Improper Vulnerability

MODERATE
Advisory Identifier: GHSA-7m5c-fgwf-mwph
CVSS 5.3
CWE-116 CWE-644
Published
Advisory Summary

CVE-2023-34036 is a MODERATE (CVSS 5.3) spring hateoas vulnerable to improper vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring hateoas vulnerable to improper neutralization of http headers for scripting syntax. Remediation is available by upgrading affected packages to version 1.5.5, 2.0.5, 2.1.1.

CVE-2023-34036 at a Glance

CVE Identifier CVE-2023-34036
GHSA Identifier GHSA-7m5c-fgwf-mwph
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

How to Fix CVE-2023-34036

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.hateoas:spring-hateoas fixed: 1.5.5
<dependency>
    <groupId>org.springframework.hateoas</groupId>
    <artifactId>spring-hateoas</artifactId>
    <version>1.5.5</version>
</dependency>
org.springframework.hateoas:spring-hateoas fixed: 2.0.5
<dependency>
    <groupId>org.springframework.hateoas</groupId>
    <artifactId>spring-hateoas</artifactId>
    <version>2.0.5</version>
</dependency>
org.springframework.hateoas:spring-hateoas fixed: 2.1.1
<dependency>
    <groupId>org.springframework.hateoas</groupId>
    <artifactId>spring-hateoas</artifactId>
    <version>2.1.1</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.hateoas

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.springframework.hateoas 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-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. 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

Reactive web applications that use Spring HATEOAS to produce hypermedia-based responses might be exposed to malicious forwarded headers if they are not behind a trusted proxy that ensures correctness of such headers, or if they don't have anything else in place to handle (and possibly discard) forwarded headers either in WebFlux or at the level of the underlying HTTP server. For the application to be affected, it needs to satisfy the following requirements: * It needs to use the reactive web stack (Spring WebFlux) and Spring HATEOAS to create links in hypermedia-based responses. * The application infrastructure does not guard against clients submitting (X-)Forwarded… headers.

CVE-2023-34036 Affected Spring Framework Versions

3 component(s)
Fixed Versions:
1.5.52.0.52.1.1
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.hateoas:spring-hateoas
Maven
< 1.5.5
1.5.5
org.springframework.hateoas:spring-hateoas
Maven
≥ 2.0.0
< 2.0.5
2.0.5
org.springframework.hateoas:spring-hateoas
Maven
≥ 2.1.0
< 2.1.1
2.1.1

References

Frequently Asked Questions

What is CVE-2023-34036?
CVE-2023-34036 is a security vulnerability in Spring Framework involving Spring HATEOAS vulnerable to Improper Neutralization of HTTP Headers for Scripting Syntax under CWE-116: Improper Encoding or Escaping of Output.
Which Spring Framework versions are affected?
Affected versions include releases prior to 1.5.5, 2.0.5, 2.1.1 across affected packages: org.springframework.hateoas:spring-hateoas.
What version fixes CVE-2023-34036?
Upgrading to 1.5.5, 2.0.5, 2.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-hateoas affected?
Yes, org.springframework.hateoas:spring-hateoas is affected in releases prior to 1.5.5, 2.0.5, 2.1.1. Upgrade your dependency to 1.5.5, 2.0.5, 2.1.1 or later.
What is the CVSS score of CVE-2023-34036?
CVE-2023-34036 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2023-34036?
CVE-2023-34036 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check Maven dependencies for CVE-2023-34036?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.hateoas'. 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-7m5c-fgwf-mwph",
  "modified" : "2023-07-19T19:23:53Z",
  "published" : "2023-07-17T12:30:32Z",
  "aliases" : [ "CVE-2023-34036" ],
  "summary" : "Spring HATEOAS vulnerable to Improper Neutralization of HTTP Headers for Scripting Syntax",
  "details" : "Reactive web applications that use Spring HATEOAS to produce hypermedia-based responses might be exposed to malicious forwarded headers if they are not behind a trusted proxy that ensures correctness of such headers, or if they don't have anything else in place to handle (and possibly discard) forwarded headers either in WebFlux or at the level of the underlying HTTP server.\n\nFor the application to be affected, it needs to satisfy the following requirements:\n\n  *  It needs to use the reactive web stack (Spring WebFlux) and Spring HATEOAS to create links in hypermedia-based responses.\n  *  The application infrastructure does not guard against clients submitting (X-)Forwarded… headers.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.hateoas:spring-hateoas"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.hateoas:spring-hateoas"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.hateoas:spring-hateoas"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34036"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-projects/spring-hateoas"
  }, {
    "type" : "WEB",
    "url" : "https://spring.io/security/cve-2023-34036"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-644" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-17T14:10:24Z",
    "nvd_published_at" : "2023-07-17T11:15:09Z"
  }
}