-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFundation][FrameworkBundle] Deprecate the HEADER_X_FORWARDED_ALL constant #38954
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8be58b8
to
8a4eb65
Compare
dunglas
approved these changes
Nov 2, 2020
fabpot
requested changes
Nov 2, 2020
8a4eb65
to
1ae32f9
Compare
fabpot
approved these changes
Nov 2, 2020
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
Show resolved
Hide resolved
1ae32f9
to
a96c0bb
Compare
a96c0bb
to
fc921b1
Compare
fc921b1
to
5baba3d
Compare
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
5baba3d
to
fbea094
Compare
ea9ff44
to
fe344eb
Compare
nicolas-grekas
approved these changes
Nov 2, 2020
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.
(with some remaining nitpicking)
fe344eb
to
7cf4dd6
Compare
Can you please submit recipe PR to not use the constant in any version? |
Thank you @jderusse. |
Merged
LukeTowers
added a commit
to wintercms/storm
that referenced
this pull request
Dec 9, 2021
Refs: - symfony/symfony#37734 - symfony/symfony#38954 This upgrade causes a breaking change since newly generated config files created from v1.1.4 to v1.1.8 include a default reference to `Illuminate\Http\Request::HTTP_X_FORWARDED_ALL` which no longer exists as of Laravel 9 / Symfony 6 and there is no way for us to replace that class to add it back ourselves without copying the entirety of the class into our project and class_alias()ing it, which would be a bad idea for lots of reasons.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
HEADER_X_FORWARDED_ALL
implicitly trust thex-forwarded-host
header, leading to possible host header attack (as warned in the documentation.)Moreover, this
HEADER_X_FORWARDED_ALL
does not really fowards all headers, as ti does not supportsX-Forwarded-Prefix
headers.This PR deprecate the constant and the new framework bundle configuration. It will be removed in 6.0. People have to use: either:
Request::setTrustedProxies(['1.2.3.4'], Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);
Request::setTrustedProxies(['1.2.3.4'], Request::HEADER_X_FORWARDED_TRAEFIK);
framework.trusted_headers: [x-forwarded-for, x-forwarded-host, x-forwarded-port, x-forwarded-proto]