-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Remove X-Forwarded-Uri and X-Forwarded-Method from untrusted IP #4036
Conversation
I've fixed the bug by just removing the additional headers before letting oxy/forward remove the other ones. I wanted to have a small changeset for 1.7, for the master the fix could easily be added in forwarded_header.go, which should make it more elegant as all forwarded headers are removed at the same place. |
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.
LGTM
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.
LGTM
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.
LGTM
comes from an untrusted ip. Failing to do so would result in an inconsistent and insecure behaviour for the forward authentication. If TrustForwardHeader is active in the forward auth, the auth endpoint receives these two headers if they have been sent from an untrusted ip. Whereas other X-Forward headers have been removed in the request and are safe to use in the auth endpoint.
What does this PR do?
Remove X-Forwarded-Uri and X-Forwarded-Method headers if a request
comes from an untrusted IP.
Motivation
Failing to do so would result in an inconsistent and insecure behaviour
for the forward authentication. If TrustForwardHeader is active in the
forward auth, the auth endpoint receives these two headers if they
have been sent from an untrusted IP. Whereas other X-Forward headers
have been removed in the request and are safe to use in the auth
endpoint.
More
Additional Notes