Skip to content

Scalar starters make the whole application trust client-supplied forwarded headers, and render pages from a shared mutable properties bean

Moderate
bnasslahsen published GHSA-c925-vm88-mpp9 Sep 6, 2026

Package

maven org.springdoc:springdoc-openapi-starter-webflux-scalar (Maven)

Affected versions

>= 2.8.13, < 2.9.1
>= 3.0.0, < 3.1.1

Patched versions

2.9.1
3.1.1
maven org.springdoc:springdoc-openapi-starter-webmvc-scalar (Maven)
>= 2.8.13, < 2.9.1
>= 3.0.0, < 3.1.1
2.9.1
3.1.1

Description

Two issues in the Scalar starters are fixed in these releases. Both were reported together and ship in the same versions.

Impact 1 — the whole application trusts client-supplied forwarded headers (CWE-1188)

The Scalar starters registered a forwarded-header handler as an application-wide bean: ForwardedHeaderFilter on the servlet stack and ForwardedHeaderTransformer on the reactive stack.

Those beans are not scoped to the Scalar documentation endpoints. Registering them makes the entire application trust the Forwarded and X-Forwarded-* headers of every caller, silently overriding Spring Boot's server.forward-headers-strategy=none default. An application that added a Scalar starter — and that is not behind a reverse proxy which strips or rewrites those headers — would begin deriving scheme, host and port from attacker-controlled input.

Any part of the application that builds absolute URLs is then influenced by the caller: generated links, redirects, Location headers and URLs embedded in emails such as password-reset links. This is the classic host-header poisoning precondition, and it applied to the whole application rather than to springdoc's own endpoints.

Impact 2 — Scalar pages were rendered from a shared mutable bean (CWE-362)

AbstractScalarController wrote request-specific state — the api-docs URL derived from the current request, and the group sources — back onto the singleton ScalarProperties bean while serving the request.

Because the bean is shared by every request, concurrent callers raced on it. One caller's api-docs URL, derived from their own Host or forwarded headers, could be rendered into a different caller's Scalar page. When groups are configured the controller performed two successive writes, so a request landing between them could render a page whose url was null.

Affected

Applications with springdoc-openapi-starter-webmvc-scalar or springdoc-openapi-starter-webflux-scalar on the classpath. Both issues affect the Spring Boot 3 and Spring Boot 4 lines.

Patches

Fixed in 2.9.1 and 3.1.1.

The Scalar starters no longer register a ForwardedHeaderFilter or a ForwardedHeaderTransformer; forwarded-header handling is left entirely to the application's own configuration, as it is for every other Spring Boot application. AbstractScalarController now copies the configured properties and applies request-specific state only to the per-request copy, leaving the singleton untouched.

Upgrade note. If your application runs behind a trusted reverse proxy and relied on the removed bean, enable forwarded-header support explicitly:

server.forward-headers-strategy=framework

(or native when the proxy support is provided by the container). Enable it only when a trusted proxy is guaranteed to overwrite the incoming forwarded headers.

Workarounds

Ensure your reverse proxy strips or overwrites client-supplied Forwarded and X-Forwarded-* headers. There is no workaround for the rendering race other than upgrading.

References

  • 921e1f4a6 – stop trusting forwarded headers application-wide (4.x)
  • 593ee5280 – render Scalar from a request-local properties copy (4.x)
  • 67abb9036 – defer forwarded-header handling to the application (2.x)
  • 6316b2cb1 – render the Scalar page from request-local state (2.x)

Credits

Reported by Scrutineer (Alpha-Omega).

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

CVE ID

No known CVE

Weaknesses

Concurrent Execution using Shared Resource with Improper Synchronization

The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. Learn more on MITRE.

Initialization of a Resource with an Insecure Default

The product initializes or sets a resource with a default that is intended to be changed by the product's installer, administrator, or maintainer, but the default is not secure. Learn more on MITRE.

Credits