Skip to content

[HttpKernel] Make sure HttpCache is a trusted proxy #11937

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

Merged
merged 1 commit into from
Sep 22, 2014

Conversation

thewilkybarkid
Copy link
Contributor

Q A
Bug fix? yes (of sorts)
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #9292
License MIT
Doc PR symfony/symfony-docs#4239

Fixes #9292 by adding 127.0.0.1 as a trusted proxy when using HttpCache (assuming it hasn't been already).

@thewilkybarkid thewilkybarkid changed the title Make sure HttpCache is a trusted proxy [HttpKernel] Make sure HttpCache is a trusted proxy Sep 16, 2014
@jakzal
Copy link
Contributor

jakzal commented Sep 16, 2014

👍

@jakzal
Copy link
Contributor

jakzal commented Sep 16, 2014

This is not really a bug fix though.

@@ -462,6 +462,12 @@ protected function forward(Request $request, $catch = false, Response $entry = n
// is always called from the same process as the backend.
$request->server->set('REMOTE_ADDR', '127.0.0.1');

// make sure HttpCache is a trusted proxy
if (!in_array('127.0.0.1', $trustedProxies = Request::getTrustedProxies())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about adding 127.0.0.1 directly in the list of trusted proxies in the Request class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabpot it should be trusted only when the HttpCache is used, not always. Otherwise it will trust the forwarded headers all the time

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stof this seems to be necessary also when using a subrequest (at least in my experience).

@fabpot
Copy link
Member

fabpot commented Sep 22, 2014

👍

@fabpot
Copy link
Member

fabpot commented Sep 22, 2014

Thank you @thewilkybarkid.

@fabpot fabpot merged commit ca65362 into symfony:2.3 Sep 22, 2014
fabpot added a commit that referenced this pull request Sep 22, 2014
…lkybarkid)

This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Make sure HttpCache is a trusted proxy

| Q             | A
| ------------- | ---
| Bug fix?      | yes (of sorts)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9292
| License       | MIT
| Doc PR        | symfony/symfony-docs#4239

Fixes #9292 by adding `127.0.0.1` as a trusted proxy when using `HttpCache` (assuming it hasn't been already).

Commits
-------

ca65362 Make sure HttpCache is a trusted proxy
@thewilkybarkid thewilkybarkid deleted the httpcache-trusted-proxy branch September 22, 2014 13:46
weaverryan added a commit to symfony/symfony-docs that referenced this pull request Sep 22, 2014
…ilkybarkid)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #4239).

Discussion
----------

Remove redundant references to trusting HttpCache

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets |

Removes references to making `HttpCache` a trusted proxy as symfony/symfony#11937 would cause it to be handled automatically.

Alternatively it could be reworded, but I'm not sure it's useful to say that this happens (since it was a bit odd to have to configure Symfony to let one part of the code base trust another).

Commits
-------

8f157dc Remove redundant references to trusting HttpCache
@ureimers
Copy link
Contributor

ureimers commented Jun 2, 2015

Thanks @thewilkybarkid. Unfortunately I didn't take the time to do it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy