-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Make HttpCache behaves more like a real reverse proxy #7034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fabpot
commented
Feb 9, 2013
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #6982, #7000 |
License | MIT |
Doc PR | n/a |
Awesome, thanks Fabien. should this not target 2.0/2.1? |
@@ -72,6 +72,9 @@ class HttpCache implements HttpKernelInterface, TerminableInterface | |||
* This setting is overridden by the stale-if-error HTTP Cache-Control extension | |||
* (see RFC 5861). | |||
* | |||
* * forwarded_for Specifies whether the client's IP address in the HTTP requests the cache forwards | |||
* should be appended to the X-Forwarded-For header (default: true). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces a security vulnerability as any client can now fake any IP by populating this header, imo you should just remove this option and always overwrite X_Forwarded_For with REMOTE_ADDR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, one can argue can you can only trust the proxy if the forwarded_for option is set to true (which is the default). If you turn off this option, then, the proxy cannot be trusted anymore, so theere is no security issue if everything is configured as it should be. As setting this option to false is probably not a common case, I'm going to remove this option.
@bendavies Indeed, I'm going to merge it to the 2.1 branch |
This PR was submitted for the 2.2 branch but it was merged into the 2.1 branch instead (closes #7034). Commits ------- 1fdded5 [HttpKernel] added support for the X-Forwarded-For header (closes #6982, closes #7000) be65d7c [HttpKernel] fixed the IP address in HttpCache when calling the backend Discussion ---------- Make HttpCache behaves more like a real reverse proxy | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #6982, #7000 | License | MIT | Doc PR | n/a --------------------------------------------------------------------------- by bendavies at 2013-02-10T00:55:29Z Awesome, thanks Fabien. should this not target 2.0/2.1?
Is there a specific reason why 127.0.01 is not on the trusted Proxy list by default? |
@fabpot Shouldn't you be adding the port number here if it is not 80 or 443?
As you see, the |
@leofeyer Please open a new issue if you think that you found a bug. |
Will do as soon as I know for sure that it is a bug. 😄 |
@leofeyer There's |