You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whitespace trimmed when header value split across tcp packets
Description
Whitespace trimming issue when a header value is split across 2 tcp packets where a whitespace character (or many whitespaces) is the last char of the first packet or the first char of the second packet.
We noticed reports from our users complaining of intermittent 4xx due to corrupted Authorization header value where the space between the token type (Bearer) and the encoded token string disappeared.
We tracked down the issue to envoy with tcpdump captures of incoming and outgoing traffic. And we could reproduce the issue locally.
We would like to make sure regression tests are implemented if not yet present, and hope by reporting the symptoms, it will avoid extra troubleshooting to other users that may be affected.
The text was updated successfully, but these errors were encountered:
Whitespace trimmed when header value split across tcp packets
Description
Whitespace trimming issue when a header value is split across 2 tcp packets where a whitespace character (or many whitespaces) is the last char of the first packet or the first char of the second packet.
We noticed reports from our users complaining of intermittent 4xx due to corrupted Authorization header value where the space between the token type (Bearer) and the encoded token string disappeared.
We tracked down the issue to envoy with tcpdump captures of incoming and outgoing traffic. And we could reproduce the issue locally.
Repro steps
Clone repository at https://github.com/jeremybaumont/envoy-httpbin , it uses envoy as front proxy and httpbin as upstream service.We wrote a script to simulate the split between 2 tcp packets at https://gist.github.com/jeremybaumont/f5d7ddc63f6a3a75431a4a6a5016efbe The script call the headers endpoint of the httpbin service that displays the headers of the http request.
Start the docker-compose and run the above script:
The output of the script is similar to:
We observed that >= v1.12.2, v1.13.x, v1.14.x versions were affected, but prior v1.12.1 and v1.15.0 are not affected .
We think the bug is introduced by the following line but not sure: https://github.com/envoyproxy/envoy/blob/master/source/common/http/http1/codec_impl.cc#L613
We don’t know if v1.15.0 fixed the bug accidentally, we did not see much github issues reporting the same symptoms (except #10270) and could not identify something related in the changelog of v1.15.0 https://www.envoyproxy.io/docs/envoy/latest/version_history/v1.15.0.
We would like to make sure regression tests are implemented if not yet present, and hope by reporting the symptoms, it will avoid extra troubleshooting to other users that may be affected.
The text was updated successfully, but these errors were encountered: