Forum Discussion
Bubbagump_12531
Nimbostratus
Oct 30, 2013Prevent X-Forwarded-For spoofing
We insert an X-Forwarded-For header to pass back to our web servers. One application we have looks to this header to allow or deny certain servers access to us. However, we want to prevent spoofing t...
Kevin_Stewart
Employee
Oct 30, 2013The XFF option in the HTTP profile is an insert, so yes it will allow spoofing. What you need is a replace function:
when HTTP_REQUEST {
foreach x [HTTP::header names] {
if { $x equals "X-FORWARDED-FOR" } {
HTTP::header remove X-FORWARDED-FOR
HTTP::header replace X-FORWARDED-FOR [IP::client_addr]
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
