Skip to content
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

Should getLastAddressFromXFF() handle comma-separated lists without spaces too? #3607

Closed
rgs1 opened this issue Jun 12, 2018 · 3 comments · Fixed by #3610
Closed

Should getLastAddressFromXFF() handle comma-separated lists without spaces too? #3607

rgs1 opened this issue Jun 12, 2018 · 3 comments · Fixed by #3610
Labels

Comments

@rgs1
Copy link
Member

rgs1 commented Jun 12, 2018

I just bumped into 035a816 where Utility::appendXff() went from generating x-forwarded-for with a comma plus a space as the separator, to just a comma (no spaces).

Does that mean that Utility::getLastAddressFromXFF() needs to handle both types of separators (with and without spaces)? The IP tagging module certainly breaks when there's no space after the comma...

Happy to send a PR if the desired behavior is to handle both cases (I am looking up what's actually valid for XFF values...).

@mattklein123, @alyssawilk thoughts?

@rgs1
Copy link
Member Author

rgs1 commented Jun 12, 2018

Looks like both cases (space and no space) are valid in HTTP lists:

https://tools.ietf.org/html/rfc7239#section-7.1

@mattklein123
Copy link
Member

Ugh. Yes, we definitely need to handle both cases. cc @danielhochman this might require another rollback. We might want to just revert 035a816 while we sort this out.

rgs1 pushed a commit to rgs1/envoy that referenced this issue Jun 12, 2018
Currently, `Utility::getLastAddressFromXFF()` only handles lists that
use a comma plus a space as the separator.

Per https://tools.ietf.org/html/rfc7239#section-7.1, spaces are allowed
around commas — so we should handle that too.

This fixes envoyproxy#3607.

Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
@rgs1
Copy link
Member Author

rgs1 commented Jun 12, 2018

@mattklein123 something like #3610 perhaps?

rgs1 pushed a commit to rgs1/envoy that referenced this issue Jun 13, 2018
This should catch some regressions related to XFF parsing, like what's
described in envoyproxy#3607.

Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
alyssawilk pushed a commit that referenced this issue Jun 13, 2018
This should catch some regressions related to XFF parsing, like what's
described in #3607.

Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants