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
{{ message }}
Repository navigation
Reject malformed HTTP/1 header fields and trailers in both classic and async transports. - #724
Why do we need all this? @ok2c
The issue is that FormattedHeader bypasses BasicLineFormatter, allowing CR/LF in the raw buffer to reach the wire with an explicit charset encoder.
The issue is that FormattedHeader bypasses BasicLineFormatter, allowing CR/LF in the raw buffer to reach the wire with an explicit charset encoder.
@arturobernalg And to remedy that you suggest we introduce a super expensive scan over each and every header in one of the hottest execution path of the library?
@arturobernalg And to remedy that you suggest we introduce a super expensive scan over each and every header in one of the hottest execution path of the library?
Both classic and async transports preserve CR/LF in a raw FormattedHeader when an explicit UTF-8 encoder is configured. The default path replaces them with ?. Confirmed against clean master.
I agree this edge case does not justify scanning every header. The current patch is too broad.
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
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.
Validate serialized header fields, including
FormattedHeader, to preventCRLFinjection without modifying valid header content.Add regression tests for both transports, covering requests, responses, and chunked trailers.