8000 [HttpFoundation] fix false-positive ConflictingHeadersException by nicolas-grekas · Pull Request #28144 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] fix false-positive ConflictingHeadersException #28144

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
Aug 8, 2018

Conversation

nicolas-grekas
Copy link
Member
@nicolas-grekas nicolas-grekas commented Aug 6, 2018
Q A
Branch? 2.8
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #28153
License MIT
Doc PR -

Fixes https://jira.ez.no/browse/EZP-29492 & https://jira.ez.no/browse/EZP-29497
Ping @andrerom

// Remove port (unfortunately, it does happen)
if (preg_match('{((?:\d+\.){3}\d+)\:\d+}', $clientIp, $match)) {
$clientIps[$key] = $clientIp = $match[1];
if (strpos($clientIp, '.')) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this part of the patch is a bugfix backported from 4.1, needed by the fix line 1946 (brackets should not be removed from the value)

@@ -967,7 +967,7 @@ public function testGetClientIpsWithAgreeingHeaders($httpForwarded, $httpXForwar
'HTTP_X_FORWARDED_FOR' => $httpXForwardedFor,
);

Request::setTrustedProxies(array('88.88.88.88'));
Request::setTrustedProxies(array('88.88.88.88'), -1);
Copy link
Member Author
@nicolas-grekas nicolas-grekas Aug 6, 2018

Choose a reason for hiding this comment

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

wrongly set to Request::HEADER_X_FORWARDED_ALL on 3.4+, this will act as a reminder by the conflict it will create when merging

@mateuszbieniek
Copy link

I can confirm that this PR fixed https://jira.ez.no/browse/EZP-29497 on my local installation.

@nicolas-grekas nicolas-grekas merged commit 6089290 into symfony:2.8 Aug 8, 2018
nicolas-grekas added a commit that referenced this pull request Aug 8, 2018
…ption (nicolas-grekas)

This PR was merged into the 2.8 branch.

Discussion
----------

[HttpFoundation] fix false-positive ConflictingHeadersException

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28153
| License       | MIT
| Doc PR        | -

Fixes https://jira.ez.no/browse/EZP-29492 & https://jira.ez.no/browse/EZP-29497
Ping @andrerom

Commits
-------

6089290 [HttpFoundation] fix false-positive ConflictingHeadersException
@nicolas-grekas nicolas-grekas deleted the http-fix branch August 8, 2018 08:10
@stloyd
Copy link
Contributor
stloyd commented Aug 16, 2018

@fabpot @nicolas-grekas Can we get v2.8.45 being released? Without this fix we can't upgrade to latest security fix (v2.8.44) release due to BC regression being fixed here.

nicolas-grekas referenced this pull request in symfony/http-kernel Aug 26, 2018
* 3.4:
  [HttpKernel] fix trusted headers management in HttpCache and InlineFragmentRenderer
This was referenced Aug 27, 2018
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.

4 participants
0