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
SocketsHttpHandler should replace received new lines in headers with spaces #116688
Field values containing CR, LF, or NUL characters are invalid and dangerous, due to the varying ways that implementations might parse and interpret those characters; a recipient of CR, LF, or NUL within a field value MUST either reject the message or replace each of those characters with SP before further processing or forwarding of that message. Field values containing other CTL characters are also invalid; however, recipients MAY retain such characters for the sake of robustness when they appear within a safe context (e.g., an application-specific quoted string that will not be processed by any downstream HTTP parser).
With HTTP/1.1 it's not possible for a user of HttpClient to observe new lines in the response headers collection since the new line itself is a protocol-level separator.
When parsing HTTP/1.1 line folds, we do replace the new lines with spaces.
Activity
dotnet-policy-service commentedon Jun 16, 2025
Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
Replace dangerous characters in response headers (dotnet#117290)