Open
Conversation
Trust HTTP_X_FORWARDED_PROTO and HTTP_X_FORWARDED_PORT even if not coming from trusted proxy. It's not security problem like directly parsing HTTP_X_FORWARDED_FOR. This fixes HTTPS in proxy server setups with enabled mod_remoteip.
55b5376 to
45e2638
Compare
c2bbf57 to
db54e1c
Compare
26f846b to
4be7cde
Compare
8fd7f28 to
51a304f
Compare
Contributor
|
You can spam application with shitload of errors if app breaks with an incompatible url. In worst case would be e.g. possible send user an email with url of attacker website. |
Contributor
|
You can always mark all proxies as trusted with |
Member
|
@kncsvk does this work for you: (https://doc.nette.org/cs/3.0/configuring#toc-http-proxy) http:
proxy: 0.0.0.0/0 |
0011929 to
ddf9e8e
Compare
9a14e6e to
a20fb8f
Compare
55488bd to
2042d2e
Compare
4960652 to
5e67add
Compare
689f4ae to
33aae19
Compare
09923de to
02ae846
Compare
dc02250 to
80e8e2b
Compare
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
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.
I have web server setup with HTTP proxy and Apache web server with module mod_remoteip (This mod replace REMOTE_ADDR to real client IP instead of proxy IP).
HTTP works as expected but with HTTPS I have these problems:
With router:
$router[] = new Route('<presenter>/<action>[/<id>]', 'Dashboard:default');Result URL was
https://example.com:80/With router:
$router[] = new Route('https://%host%/<presenter>/<action>[/<id>]', 'Dashboard:default');Result in browser was redirect loop (
ERR_TOO_MANY_REDIRECTS)I searched in code and found that HTTP_X_FORWARDED* headers are ignored if they din't come from trusted proxy. After bypassing this check for HTTP_X_FORWARDED_PROTO and HTTP_X_FORWARDED_PORT router works again as expected.
I don't see any security problem if these two variables didn't come from trusted proxy.