http: disallow unknown transfer encodings #9316
Merged
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.
This tests that Envoy does not proxy requests with content length and transfer encoding, protecting downstream servers from smuggling attacks.
This also blocks Envoy from proxying unknown transfer encodings. http_parser doesn't for example treat identity,chunked as chunked which is technically buggy. It's not an exploitable bug, because no http requests can be smuggles in a chunk length header but it's still poor form.
Minor improvements to matcher utils, now printing the headers that don't match because why wouldn't you?
Risk Level: medium (blocking legitimate but sketchy transfer encodings)
Testing: new unit tests, integration tests
Docs Changes: no
Release Notes: yes
Fixes https://github.com/envoyproxy/envoy-setec/issues/52
Fixes https://github.com/envoyproxy/envoy-setec/issues/50