|
|
|
|
|
by knorker
323 days ago
|
|
1. Have (and maintain!) a list of addresses you trust to not lie (e.g. your own proxy layers, cloudflare's proxy IP list, akamai, GCP LB, AWS LB, etc…) 2. If the connecting party (real TCP connection remote end) is in the trusted list, then take the rightmost address in XFF and set as remote end. 3. Repeat 2 until you get an address not in the trusted list. 4. That is now the real client IP. Discard anything to the left of it in XFF. (though maybe log it, if you want) The article seems to forget the step of checking the real TCP connection remote address (from my skimming), which means that if the web server can be accessed directly, and not just through a load balancer that always sets the header, then the article is a security hole. |
|