Repository navigation
Refuse Transfer-Encoding in HTTP/1.0 messages - #91
Merged
Merged
Conversation
RFC 9112 §6.1: a recipient of an HTTP/1.0 message with Transfer-Encoding MUST treat its framing as faulty, even with a Content-Length, and close the connection after it. Both hardened parsers checked Transfer-Encoding against Content-Length and against any value but chunked, never against the version, so an HTTP/1.0 request or response with Transfer-Encoding: chunked parsed and was framed as chunked. HTTP/1.0 has no transfer codings, so a hop that speaks only 1.0 frames such a body another way. Both now refuse it beside the TE + CL check, as 400 for a request. Fixes #90
Merged
MDA2AV
added a commit
to MDA2AV/ioxide
that referenced
this pull request
Nov 13, 2026
… faulty framing, and its connection closed, rather than read as chunked RFC 9112 6.1: a client that receives an HTTP/1.0 message with a Transfer-Encoding MUST treat its framing as faulty and close the connection after it. The client takes its framing from Glyph11, which had no such rule. Glyph11 0.4.1 refuses the message in its hardened parsers (dotnet-web-stack/Glyph11#91), and the client turns that into a failed request on a discarded connection, as it does any malformed head. The client moves from Glyph11 0.3.7 to 0.4.1, onto TryParseResponseHeader: TryExtractFullResponseHeaderROM is obsolete since 0.4.0, and the new entry point reports the header block's true length, so the + 1 goes. Glyph11's other response fixes since 0.3.7 come with it, among them a bare-LF head refused at once rather than waited on (Glyph11#85), status codes above 599 refused (Glyph11#80), and Content-Length lists and oversized values framed by their length (Glyph11#74, Glyph11#75, Glyph11#77). HttpClientHttp10Tests: the issue's test, a 304, and a keep-alive response whose connection must not be reused, beside the Content-Length control. On Glyph11 0.4.0 the three refusals fail; on 0.4.1 they pass.
MDA2AV
added a commit
to MDA2AV/ioxide
that referenced
this pull request
Nov 14, 2026
… faulty framing, and its connection closed, rather than read as chunked (#565) RFC 9112 6.1: a client that receives an HTTP/1.0 message with a Transfer-Encoding MUST treat its framing as faulty and close the connection after it. The client takes its framing from Glyph11, which had no such rule. Glyph11 0.4.1 refuses the message in its hardened parsers (dotnet-web-stack/Glyph11#91), and the client turns that into a failed request on a discarded connection, as it does any malformed head. The client moves from Glyph11 0.3.7 to 0.4.1, onto TryParseResponseHeader: TryExtractFullResponseHeaderROM is obsolete since 0.4.0, and the new entry point reports the header block's true length, so the + 1 goes. Glyph11's other response fixes since 0.3.7 come with it, among them a bare-LF head refused at once rather than waited on (Glyph11#85), status codes above 599 refused (Glyph11#80), and Content-Length lists and oversized values framed by their length (Glyph11#74, Glyph11#75, Glyph11#77). HttpClientHttp10Tests: the issue's test, a 304, and a keep-alive response whose connection must not be reused, beside the Content-Length control. On Glyph11 0.4.0 the three refusals fail; on 0.4.1 they pass.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #90
Why
RFC 9112 §6.1: "A server or client that receives an HTTP/1.0 message containing a Transfer-Encoding header field MUST treat the message as if the framing is faulty, even if a Content-Length is present, and close the connection after processing the message."
Both hardened parsers checked Transfer-Encoding against Content-Length and against any value but
chunked, never against the version. SoPOST / HTTP/1.0orHTTP/1.0 200withTransfer-Encoding: chunkedparsed, andBodyFramingDetectorframed it as chunked. HTTP/1.0 has no transfer codings, so a hop that speaks only 1.0 frames such a body another way, and what it leaves on the connection is read as the next message.What changes
UltraHardenedParser.FullHeader.ROM.csandUltraHardenedParser.FullResponse.ROM.cs: after the TE + CL check, Transfer-Encoding in an HTTP/1.0 message throwsTransfer-Encoding in an HTTP/1.0 message.(400). The version is the one the start line already validated, so this is one byte compare, made only when Transfer-Encoding is present.SECURITY.md: a "Transfer-Encoding in HTTP/1.0" entry under Request Smuggling.Decisions worth reviewing
HttpParseException. For a response, refusing is all a client can safely do with a message whose end it can't know.BodyFramingDetector. The detector frames what it is given, andFlexibleParserinput is trusted by contract (SECURITY.md). The rule sits with the other smuggling checks, so everyUltraHardenedParsercaller gets it.chunked, in practice it is chunked.Downstream
MDA2AV/ioxide#565 checks this in ioxide's HTTP client for now. Once a release carries this, that can become a version bump.
Tests
UltraHardenedParser.Semantics.cs: an HTTP/1.0 request withTransfer-Encoding: chunkedthrows 400; withContent-Lengthit parses. ROM and multi-segment.UltraHardenedParser.Response.cs: an HTTP/1.0 200 and an HTTP/1.0 304 withTransfer-Encoding: chunkedthrow; a 200 withContent-Lengthparses.dotnet test -f net10.0: 1134 passed (1125 before), 0 failed.dotnet build src/Glyph11.slnbuilds with no new warnings. net8.0 and net9.0 aren't installed on this machine; CI runs them.