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
Managed HttpListener accepts whitespace around request header names #132128
The managed HttpListener implementation normalizes malformed request header names by trimming them:
string name = header.AsSpan(0, colon).Trim().ToString();
HTTP requires the field name to be immediately followed by : . A server must reject request messages containing whitespace between the field name and colon with 400 Bad Request. The managed implementation should validate the field name without trimming it. Optional ASCII spaces and tabs around the field value should continue to be removed.
Tests should cover valid headers and malformed names containing leading whitespace or whitespace before the colon.
Reproduction Steps
Send a request containing header : value.
Expected behavior
It should be rejected with 400 Bad Request.
Actual behavior
The request reaches the application with the header normalized to header .
Activity
dotnet-policy-service commentedon Aug 11, 2026
Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Aug 11, 2026
Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
Limit header name in HtppListenerRequest (#132163)