Skip to content

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

Merged
jzheaux merged 1 commit into
spring-projects:7.0.xfrom
skdas20:docs-19461-forwarded-headers
Aug 3, 2026
Merged

Differentiate Forwarded and X-Forwarded headers in proxy docs#19477
jzheaux merged 1 commit into
spring-projects:7.0.xfrom
skdas20:docs-19461-forwarded-headers

Conversation

@skdas20

@skdas20 skdas20 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 29, 2026
@jzheaux jzheaux self-assigned this Aug 3, 2026
@jzheaux jzheaux added in: docs An issue in Documentation or samples type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 3, 2026
@jzheaux jzheaux added this to the 7.0.7 milestone Aug 3, 2026
@jzheaux
jzheaux force-pushed the docs-19461-forwarded-headers branch from 6bf7721 to 023c805 Compare August 3, 2026 23:03
@jzheaux
jzheaux changed the base branch from main to 7.0.x August 3, 2026 23:03
@jzheaux

jzheaux commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Rebased this onto 7.0.x since the same conflated text exists there too. No content changes.

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.

Closes spring-projectsgh-19461

Signed-off-by: Sumit Kumar Das <skdas5405@gmail.com>
@jzheaux
jzheaux force-pushed the docs-19461-forwarded-headers branch from 023c805 to 4bd0adb Compare August 3, 2026 23:37
@jzheaux
jzheaux merged commit 2c4db99 into spring-projects:7.0.x Aug 3, 2026
6 checks passed
@jzheaux

jzheaux commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks, @skdas20, for the PR! This is now merged into 7.0.x and main and will go out in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: docs An issue in Documentation or samples type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants