Spring HATEOAS vulnerable to Improper Neutralization of HTTP Headers for Scripting Syntax

Description

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.

Basic information

Type
reviewed
Severity
medium
Advisory on GitHub
Open advisory ↗
Repository advisory
Source code
Browse source ↗
Published (advisory)
2023-07-17 12:30:32 UTC
Updated
2023-11-06 05:05:38 UTC
GitHub reviewed
2023-07-17 14:10:24 UTC
NVD published
2023-07-17

EPSS Score

Score Percentile
0.38% 59.66%

CVSS Scores

Base score Version Severity Vector
5.3 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:N)
Service keeps running; no real outage angle.

Identifiers

CWEs

CWE id Name
CWE-116 Improper Encoding or Escaping of Output
CWE-644 Improper Neutralization of HTTP Headers for Scripting Syntax

Affected packages (3)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
maven org.springframework.hateoas:spring-hateoas < 1.5.5 1.5.5
maven org.springframework.hateoas:spring-hateoas >= 2.0.0, < 2.0.5 2.0.5
maven org.springframework.hateoas:spring-hateoas >= 2.1.0, < 2.1.1 2.1.1

References

cvelogic Threat Intelligence