-
Notifications
You must be signed in to change notification settings - Fork 62
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
Header value matching (including Host) only supports case sensitive matching #175
Comments
Currently only HTTP headers For the specific use case of matching the |
@incfly I think there are two problems here.
The expected behavior is like the following.
|
I think RFC 3982 and RFC7230 only say header "field names" are case-insensitive, not the field value. You have to read the spec to determine how to match each header. https://httpwg.org/specs/rfc7230.html#rfc.section.2.7.3
I'm not sure how to best handle this in authservice. You could special case some headers and lowercase them before processing. Or provide an optional case insensitive matching mode. Or allow matching the |
I will +1 on the option to provide a option to match with case insenstive, similiar to Envoy's StringMatcher API https://www.envoyproxy.io/docs/envoy/latest/api-v3/type/matcher/v3/string.proto#string-matcher Where you can specify but back to this overall issue, it'll be solved if #140 is solved as well right? If we provide an option in the overall matches, that if no match found, return 403 instead of pass through at authservice level. |
Yes, addressing #140 will resolve the security impact of this issue. There is already no security risk if an Istio AuthorizationPolicy is applied after authservice and requires a JWT for all requests (for example, |
I saw some issues that FilterChain matcher and TriggerRule might be merged? There is another issue in the filter chain matching that I wanted to point out while you are working on that area of the code. #172 #171
The
prefix
andequality
match operators match the header value case sensitively, and this is a problem for matchingHost:
.It is possible to bypass an authservice chain with an
equality
match onHost: example.com
by with a request likecurl http://EXAMPLE.COM
. If an Istio AuthorizationPolicy is used after Authservice, this isn't an auth bypass because the request would be rejected withRBAC: access denied
due to a missing JWT. I can't tell if using Istio AuthZ is considered optional or required though. Regardless this still a bug that I wanted your team to be aware of if you're fixing up that area of code.The related code is:
authservice/src/filters/filter_chain.cc
Lines 93 to 113 in e91ca69
I haven't tested this on a recent version of authservice, but I think the case sensitive behavior is still there.
The text was updated successfully, but these errors were encountered: