[2.1] Address issues with proxy lookups#9229
Conversation
|
I'm still doing testing... (I tested as best I can without actually having a proxy!)
|
Signed-off-by: Shawn Bulen <bulens@pacbell.net>
Signed-off-by: Shawn Bulen <bulens@pacbell.net>
|
Ready for review/test. My core tests are below: |
|
Note on the UI... I was initially a little concerned about defaulting to 'disable', where the current logic defaulted to 'autodetect' but... If you install 2.1.7 today, $modSettings['proxy_ip_header'] is not set. BUT... SMF displays the setting as: "Do not allow Proxy IP Headers"... Blank/empty is just displaying the first value in the list... So in fact, defaulting to 'autodetect' was out of sync with what was displayed in the UI. 'disable' is more accurate. In fact, the only way to fix that in 2.1.7, to bring the setting in sync with the behavior, is to modify the field to another value, then change it back... |
Fixes #9143
I took a stab at this.
Changes:
CONCERN:
Note that the ban check validates against BOTH the member_ip and member_ip2, i.e., both the proxy and the end user IP. Also note that the proxy may be using a valid 'localhost' IP. So... When we get this working, a ban on a user by IP can effectively ban a valid 'localhost' IP, i.e., a huge swath of (or even all...) proxy traffic.
Here:
SMF/Sources/Security.php
Line 181 in 2ce5fbc
I believe we should only check the end user in the ban check, not the proxy server...
If agreed, I'll add this to this PR...
If we wish to proceed with this I'll submit the 3.0 version once approved.