10000 EZP-26491: Remove "Forwarded" header in the VCL to avoid ConflictingHeadersException by jacek-foremski · Pull Request #275 · ezsystems/ezplatform · GitHub
[go: up one dir, main page]

Skip to content

EZP-26491: Remove "Forwarded" header in the VCL to avoid ConflictingHeadersException #275

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 s 8000 end you account related emails.

Already on GitHub? Sign in to your account

Conversation

jacek-foremski
Copy link
Contributor

JIRA issue: EZP-26491

This PR adds the following line: https://github.com/ezsystems/ezplatform/blob/1.13/doc/varnish/vcl/varnish4_xkey.vcl#L31 to our other VCL templates. This is done to avoid ConflictingHeadersException, which is thrown by Symfony when there are both "X-Forwarded-For" and "Forwarded" headers set.
This is also suggested in the Symfony documentation: https://symfony.com/doc/2.8/http_cache/varnish.html#make-symfony-trust-the-reverse-proxy.

@andrerom andrerom merged commit d9e7461 into ezsystems:1.7 Mar 12, 2018
@jacek-foremski jacek-foremski deleted the EZP-26491_fix_confictingheadersexception branch March 12, 2018 09:49
@davidsayre
Copy link

Thank you for looking into this ticket.
I really appreciate that someone was able to replicate and confirm this.

@andrerom
Copy link
Contributor
andrerom commented Mar 12, 2018

You're welcome @davidsayre!

Note: Be aware that the ConflictingHeadersException hints that for some reason something is setting conflicting Forward header. I can think of two possible cases, 1. load balancer injecting header change but not injecting similar change on X-Forward, if so this is worth looking into 2. Browsers/users trying to spoof this header for some reason, if so then this fixes it, and before they only got exception anyway.

Additional side note: Symfony 3 does not suggest unsetting this any longer, so might be Symfony 3 is handling this differently.

@jacek-foremski
Copy link
Contributor Author
892B

FYI: Forward header is set by the browsers in at least two cases (that I know of):

The issue was solved in Symfony 3.3 by not trusting any header by default: symfony/symfony#20178 and symfony/symfony#22238.

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

Successfully merging this pull request may close these issues.

4 participants
0