Skip to content

Differentiate Forwarded and X-Forwarded headers in proxy docs - #19477

Open
skdas20 wants to merge 1 commit into
spring-projects:mainfrom
skdas20:docs-19461-forwarded-headers
Open

Differentiate Forwarded and X-Forwarded headers in proxy docs#19477
skdas20 wants to merge 1 commit into
spring-projects:mainfrom
skdas20:docs-19461-forwarded-headers

Conversation

@skdas20

@skdas20 skdas20 commented Jul 29, 2026

Copy link
Copy Markdown

See gh-19461.

The proxy server section currently says:

To fix this, you can use RFC 7239 to specify that a load balancer is being used.
To make the application aware of this, you need to configure your application server to be aware of the X-Forwarded headers.

which points at RFC 7239 and then, in the next sentence, refers to the X-Forwarded-* headers as though they were the same mechanism. They are not: RFC 7239 defines a single standard Forwarded header, while X-Forwarded-Host / X-Forwarded-Proto / X-Forwarded-For are the older non-standard set.

This change:

  • describes the two kinds of headers separately, so a reader can tell which applies to their deployment;
  • notes that most proxies still send X-Forwarded-* while Spring Framework and servers such as Reactor Netty and Jetty understand both, so neither can be assumed to be the only one in use;
  • adds a note that both kinds are client-supplied unless a proxy overwrites them, and states that the edge proxy has to drop or overwrite untrusted values for both kinds — dropping only one set still leaves the application spoofable through the other;
  • mentions that ForwardedHeaderFilter / ForwardedHeaderTransformer handle both kinds and can be configured to remove the headers instead of applying them.

The wording follows the framing in the issue. Only features/exploits/http.adoc needed changing — the servlet and reactive pages xref this section rather than repeating it.

Happy to adjust the emphasis or trim it if you had a different structure in mind; this is meant as a starting point rather than a finished opinion on the guidance.

The proxy server section pointed at RFC 7239 and then told the reader to
configure the application server for the X-Forwarded headers, conflating
the standard Forwarded header with the non-standard X-Forwarded-* set.

Describe the two kinds of headers separately, note that most proxies send
X-Forwarded-* while Spring Framework and servers such as Reactor Netty and
Jetty understand both, and state that the edge proxy has to drop or
overwrite untrusted values for both kinds rather than only one.

See spring-projectsgh-19461

Signed-off-by: Sumit Kumar Das <skdas5405@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants