|
|
|
|
|
by lxgr
322 days ago
|
|
You do need to make sure only trusted parties get to add headers. Otherwise, you are letting the client freely define their own IP as seen by your server. Dropping and re-setting the header at your trust boundary is just the simplest implementation of that. You could also count instances, or sign the header, but I don’t think there’s a standard for that, and it would mean quite some overhead. |
|
Instead of dropping, I maintain a list of trusted proxies, and I remove them from the list instead at the application level. The rightmost or final value is then the client.