[http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process#10886
Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom Apr 29, 2020
Conversation
…read into different buffer slices. Signed-off-by: Antonio Vicente <avd@google.com>
asraa
reviewed
Apr 22, 2020
asraa
previously approved these changes
Apr 28, 2020
Contributor
asraa
left a comment
There was a problem hiding this comment.
Thank you for the positive/negative test coverage!
mattklein123
requested changes
Apr 28, 2020
Member
mattklein123
left a comment
There was a problem hiding this comment.
Awesome, thanks. Just small comment typo from a quick skim.
/wait
mattklein123
approved these changes
Apr 29, 2020
Contributor
Author
|
/backport |
Contributor
|
@lambdai Someone has to backport those changes to older branches. cc @antoniovicente for visibility and/or volunteering to backport. |
lambdai
pushed a commit
to lambdai/envoy-dai
that referenced
this pull request
Jul 28, 2020
…ire multiple dispatch calls to process (envoyproxy#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com>
lambdai
pushed a commit
to lambdai/envoy-dai
that referenced
this pull request
Jul 28, 2020
…ire multiple dispatch calls to process (envoyproxy#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: antonio <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com>
lambdai
pushed a commit
to lambdai/envoy-dai
that referenced
this pull request
Jul 28, 2020
…ire multiple dispatch calls to process (envoyproxy#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> Signed-off-by: antonio <avd@google.com>
lambdai
added a commit
that referenced
this pull request
Jul 29, 2020
…at requ… (#12320) [http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process (#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com>
lambdai
added a commit
that referenced
this pull request
Jul 29, 2020
…ire multiple dispatch calls to process (#12323) Cherry-pick [http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process (#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com>
lambdai
added a commit
that referenced
this pull request
Jul 31, 2020
…at requ… (#12319) * [http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process (#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Also various fix to allow build on clang-10 Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com>
brian-avery
pushed a commit
to istio/envoy
that referenced
this pull request
Oct 7, 2020
* doc: version 1.12.7 Signed-off-by: Yuchen Dai <silentdai@gmail.com> * Preserve LWS from the middle of HTTP1 header values that requ… (envoyproxy#12319) * [http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process (envoyproxy#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Also various fix to allow build on clang-10 Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * http: header map security fixes for duplicate headers (#197) (#204) Previously header matching did not match on all headers for non-inline headers. This patch changes the default behavior to always logically match on all headers. Multiple individual headers will be logically concatenated with ',' similar to what is done with inline headers. This makes the behavior effectively consistent. This behavior can be temporary reverted by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to "false". Targeted fixes have been additionally performed on the following extensions which make them consider all duplicate headers by default as a comma concatenated list: 1) Any extension using CEL matching on headers. 2) The header to metadata filter. 3) The JWT filter. 4) The Lua filter. Like primary header matching used in routing, RBAC, etc. this behavior can be disabled by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to false. Finally, the setCopy() header map API previously only set the first header in the case of duplicate non-inline headers. setCopy() now behaves similiarly to the other set*() APIs and replaces all found headers with a single value. This may have had security implications in the extauth filter which uses this API. This behavior can be disabled by setting the runtime value "envoy.reloadable_features.http_set_copy_replace_all_headers" to false. Fixes https://github.com/envoyproxy/envoy-setec/issues/188 Signed-off-by: Matt Klein <mklein@lyft.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix wasm compile Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix typo Signed-off-by: Yuchen Dai <silentdai@gmail.com>
istio-testing
pushed a commit
to istio/envoy
that referenced
this pull request
Oct 8, 2020
* docs: kick-off 1.13.5 release. (envoyproxy#12164) Signed-off-by: Piotr Sikora <piotrsikora@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * Preserve LWS from the middle of HTTP1 header values that requ… (envoyproxy#12320) [http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process (envoyproxy#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * http: header map security fixes for duplicate headers (#197) (#203) Previously header matching did not match on all headers for non-inline headers. This patch changes the default behavior to always logically match on all headers. Multiple individual headers will be logically concatenated with ',' similar to what is done with inline headers. This makes the behavior effectively consistent. This behavior can be temporary reverted by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to "false". Targeted fixes have been additionally performed on the following extensions which make them consider all duplicate headers by default as a comma concatenated list: 1) Any extension using CEL matching on headers. 2) The header to metadata filter. 3) The JWT filter. 4) The Lua filter. Like primary header matching used in routing, RBAC, etc. this behavior can be disabled by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to false. Finally, the setCopy() header map API previously only set the first header in the case of duplicate non-inline headers. setCopy() now behaves similiarly to the other set*() APIs and replaces all found headers with a single value. This may have had security implications in the extauth filter which uses this API. This behavior can be disabled by setting the runtime value "envoy.reloadable_features.http_set_copy_replace_all_headers" to false. Fixes https://github.com/envoyproxy/envoy-setec/issues/188 Signed-off-by: Matt Klein <mklein@lyft.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fixed compile Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix test Signed-off-by: Yuchen Dai <silentdai@gmail.com> Co-authored-by: Piotr Sikora <piotrsikora@google.com> Co-authored-by: Yuchen Dai <silentdai@gmail.com> Co-authored-by: Piotr Sikora <piotrsikora@google.com>
istio-testing
pushed a commit
to istio/envoy
that referenced
this pull request
Oct 8, 2020
* doc: version 1.12.7 Signed-off-by: Yuchen Dai <silentdai@gmail.com> * Preserve LWS from the middle of HTTP1 header values that requ… (envoyproxy#12319) * [http1] Preserve LWS from the middle of HTTP1 header values that require multiple dispatch calls to process (envoyproxy#10886) Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice. Also various fix to allow build on clang-10 Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * http: header map security fixes for duplicate headers (#197) (#204) Previously header matching did not match on all headers for non-inline headers. This patch changes the default behavior to always logically match on all headers. Multiple individual headers will be logically concatenated with ',' similar to what is done with inline headers. This makes the behavior effectively consistent. This behavior can be temporary reverted by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to "false". Targeted fixes have been additionally performed on the following extensions which make them consider all duplicate headers by default as a comma concatenated list: 1) Any extension using CEL matching on headers. 2) The header to metadata filter. 3) The JWT filter. 4) The Lua filter. Like primary header matching used in routing, RBAC, etc. this behavior can be disabled by setting the runtime value "envoy.reloadable_features.header_match_on_all_headers" to false. Finally, the setCopy() header map API previously only set the first header in the case of duplicate non-inline headers. setCopy() now behaves similiarly to the other set*() APIs and replaces all found headers with a single value. This may have had security implications in the extauth filter which uses this API. This behavior can be disabled by setting the runtime value "envoy.reloadable_features.http_set_copy_replace_all_headers" to false. Fixes https://github.com/envoyproxy/envoy-setec/issues/188 Signed-off-by: Matt Klein <mklein@lyft.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix wasm compile Signed-off-by: Yuchen Dai <silentdai@gmail.com> * fix typo Signed-off-by: Yuchen Dai <silentdai@gmail.com> Co-authored-by: Yuchen Dai <silentdai@gmail.com>
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.
Description: Correctly preserve linear whitespace in the middle of HTTP1 header values. The fix in 6a95a21 trimmed away both leading and trailing whitespace when accepting header value fragments which can result in inner LWS in header values being stripped away if the LWS lands at the beginning or end of a buffer slice.
Risk Level: low
Testing: unit and integration
Docs Changes: n/a
Release Notes: n/a
Fixes #10270