Spring Security Advisories

CVE-2023-34036: Forwarded header exploit with Spring HATEOAS on WebFlux

MEDIUM | JULY 15, 2023 | CVE-2023-34036

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.

Affected Spring Products and Versions

Spring HATEOAS

  • 1.5.4 or older
  • 2.0.4 or older
  • 2.1.0

Mitigation

Applications are encouraged to upgrade to Spring HATEOAS versions:

  • 1.5.5 or newer
  • 2.0.5 or newer
  • 2.1.1 or newer

Alternatively, infrastructure means can be deployed that ensure that client submitted (X-)Forwarded… headers are disregarded before forwarding the request to the application.

Credit

The source of the problem was originally detected by Hans Hosea Schaefer (ing.de)

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all