CVE-2023-34036: Spring Framework Spring HATEOAS Vulnerable To Improper Vulnerability
MODERATECVE-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
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).
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.
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>2.1.1</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.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
CVE-2023-34036 Affected Spring Framework Versions
3 component(s)| 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?
Which Spring Framework versions are affected?
What version fixes CVE-2023-34036?
Is spring-hateoas affected?
What is the CVSS score of CVE-2023-34036?
What CWE is associated with CVE-2023-34036?
How can I check Maven dependencies for CVE-2023-34036?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}