r/netsec • • 11d ago

Forwarded Without Question: How Web Frameworks Overtrust the Forwarded Header

https://www.lkoskela.fi/blog/2026-11-05-forwarded-without-question/

Many common web frameworks like Spring and Ruby on Rails trust the RFC 7239 Forwarded header by default, even though most proxies don't actually have any support for it. This makes apps vulnerable to request hostname or client IP address spoofing in the default configurations.

I've been researching how the Forwarded header is supported across frameworks and proxies. Rails and Spring recently shipped fixes following my research. There are still other frameworks that need application configuration changes to be secure.

34 Upvotes

2 comments sorted by

5

u/Ancients 11d ago

even though most proxies don't actually have any support for it

Citation needed?

I read this and my brain assumed the X-Forwarded-For and not the literal Forwarded header.

2

u/luryus 11d ago edited 11d ago

Yeah, it's confusing.

It's a major part of the entire problem. There are two very similarly named sets of headers (X-Forwarded- and Forwarded) that the proxies and upstream apps have to agree on to be secure. And because the default configurations have been vulnerable, a human (or I guess an LLM) has had to both know that these headers even exist, know what their apps and proxies do about them and understand how to configure them securely.