Security#2
Conversation
They must be explicitly named in the list of headers to pay attention to. Also, add a test to make sure that an explicit list of header names is obeyed.
Include discussion of explicitly naming headers to check and the security reasons for doing so. Also list the headers that are inspected.
|
We agree that specifying headers instead of doing the guess work is nice, while keeping the backward compatibility. However, i still don't get the particular instance of usefulness of here's why: In your commit note, you're linking to Ian Bicking's suggestion. Further googling shows that he wanted to set those headers to implement WSGIProxy, which is the opposite of what we usually do: making a WSGI proxy app that turns WSGI into an outgoing HTTP calls. http://pythonpaste.org/wsgiproxy/ This is a fine idea, so implementing that (i.e. maybe Plack::App::Proxy extension) should be great, but I really, really don't think we should support manglign SCRIPT_NAME and PATH_INFO in the ReverseProxy setup. My vote is to merge c6v1c70 and a01a25c but drop 0b84671. You could still use your own TweakEnv middleware (or write your own non-Plack namespaced middleware to do the same in one shot) to bring in X-Forwarded-Script-Name. |
|
On that note, adding X-Real-Ip to the list of recognizable headers (off by default, of course) would be a good idea since it's one of nginx's default module. http://wiki.nginx.org/NginxHttpRealIpModule If there's any other particular headers that nginx/lighttpd/pound/mod_proxy/perlbal supports, then i'm open for adding those, too. |
|
Here's the issue I want to solve with X-Forwarded-ScriptName:
I was assuming this was a common-ish need. I could have my |
|
Oh, and as to your last note, I think it'd be reasonable to allow the —Theory |
Okay, based on feedback on my previous pull request, here is a new one. This changes things so that one can specify a list of headers to check. This will make it more secure. It also adds two additional headers (which will only be checked if they're specified):
HTTP_X_FORWARDED_SCRIPT_NAMEandHTTP_X_FORWARDED_PATH_INFO.