Repository navigation
Remove LF_CHUNK_TERMINATION from non-legacy HttpCompliance modes (12.0) - #15503
Merged
lachlan-roberts merged 5 commits intoJul 30, 2026
Merged
Conversation
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Contributor
|
@lachlan-roberts some test failures here.
|
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
lachlan-roberts
requested review from
joakime and
olamy
and removed request for
sbordet
July 30, 2026 01:08
joakime
approved these changes
Jul 30, 2026
olamy
approved these changes
Jul 30, 2026
pstreef
added a commit
to moderne-backpatch-alliance/backpatch-jetty.project
that referenced
this pull request
Oct 22, 2026
GHSA-xc35-c22g-239h. HttpParser.next() returns a bare LF as a line end, and the chunk states took it as the end of a chunk-size line, of the chunk data and of the last chunk: a front end that only honours CRLF frames the body differently (request smuggling). In the chunk states (size line, extensions, after chunk data, last line) a bare LF is now a 400 "Bad EOL". Header lines still accept a bare LF, as RFC 9112 2.2 allows for the start line and fields. Original work modelled on upstream's 12.0.38 fix (PR jetty#15503, merge 5bc1f4d): - 389ffcb (Lachlan Roberts): Modernize the non-legacy HttpCompliance modes - 315d269 and de4c1e5 (Lachlan Roberts): fix failing tests from https://github.com/eclipse/jetty.project. Upstream makes a bare LF in chunk framing a violation (LF_CHUNK_TERMINATION) of its default modes and allows it only in RFC2616_LEGACY and RFC7230_LEGACY. 9.2 has no HttpCompliance, so upstream's default applies and no switch is added. A blank bare-LF line between chunks, which upstream does not flag, is rejected here too. Tests: HttpParserTest#testChunkLinesNeedCRLF and #testChunkCRLFSplitAcrossBuffers are ours. As in upstream's de4c1e5, PartialRFC2616Test's chunked bodies now use CRLF (its header lines keep LF). Upstream-Commit: 389ffcb Upstream-Commit: 315d269 Upstream-Commit: de4c1e5 Upstream-Commit: 5bc1f4d Co-authored-by: Lachlan Roberts <lachlan.p.roberts@gmail.com> Co-authored-by: Lachlan <lachlan@webtide.com>
pstreef
added a commit
to moderne-backpatch-alliance/backpatch-jetty.project
that referenced
this pull request
Oct 29, 2026
…EGACY allows a bare LF GHSA-xc35-c22g-239h. HttpParser.next() returns a bare LF as a line end, and every chunk state took it: the chunk-size line, its extensions (00001 kept LF there on purpose), the line after chunk data, the last chunk and the trailer. A front end that only honours CRLF frames the body differently (request smuggling); the advisory's vector is 3D;!<LF>. As upstream's 12.0 fix, a bare LF in chunk framing is now a violation of a new HttpComplianceSection, LF_CHUNK_TERMINATION. Like TRANSFER_ENCODING_WITH_CONTENT_LENGTH it is a requirement: RFC2616, RFC7230, RFC7230_LEGACY, RFC7230_NO_AMBIGUOUS_URIS and the custom default include it. RFC2616_LEGACY excludes it, so it still accepts a bare LF and reports the violation. LEGACY has none. Unlike upstream, RFC7230_LEGACY keeps the requirement (Peter, 2026-10-29, changing his 2026-10-26 answer for that mode only): 9.4's etc/jetty-http.xml defaults the plain-HTTP connector of a jetty-home install to RFC7230_LEGACY, while Jetty 12's distribution defaults to RFC7230, so upstream's mode list would have left a default 9.4 install open. A deployment that needs bare-LF chunk framing sets jetty.http.compliance=RFC2616_LEGACY or a custom mode. A rejected line ends the message as an early EOF, the parser's path for every bad byte after the headers, as in 00006. Header lines still accept a bare LF. Adapted from upstream's 12.0.38 fix (PR jetty#15503, merge 5bc1f4d): - 389ffcb (Lachlan Roberts): Modernize the non-legacy HttpCompliance modes - 315d269 and de4c1e5 (Lachlan Roberts): fix failing tests from https://github.com/eclipse/jetty.project. Upstream marks a bare LF with new EOL tokens from next(); 9.4 keeps HttpTokens unchanged and checks the byte before next() in a private nextChunkToken, the jetty-9.2 port's shape. A blank bare-LF line between chunks, which upstream does not flag, is a violation here too, as in the 9.2 port. Tests: HttpParserTest#testChunkLinesNeedCRLF and #testChunkCRLFSplitAcrossBuffers are the 9.2 port's (a333152), with a bare-LF trailer line added. #testLFChunkTerminationAllowedOnlyByRFC2616LegacyCompliance is ours: RFC7230, RFC7230_LEGACY, RFC7230_NO_AMBIGUOUS_URIS and RFC2616 reject the advisory's vector; RFC2616_LEGACY accepts it and every bare-LF case and reports LF_CHUNK_TERMINATION. The bare-LF case of 00006's #testChunkDataWithLineTerminator moves to those tests. As in upstream's de4c1e5, the chunked bodies of PartialRFC2616Test and RFC2616BaseTest now use CRLF (their header lines keep LF). Upstream-Commit: 389ffcb Upstream-Commit: 315d269 Upstream-Commit: de4c1e5 Upstream-Commit: 5bc1f4d Co-authored-by: Lachlan Roberts <lachlan.p.roberts@gmail.com> Co-authored-by: Lachlan <lachlan@webtide.com>
pstreef
added a commit
to finos-osera-forks/patch-jetty.project
that referenced
this pull request
Oct 29, 2026
…EGACY allows a bare LF GHSA-xc35-c22g-239h. HttpParser.next() returns a bare LF as a line end, and every chunk state took it: the chunk-size line, its extensions (00001 kept LF there on purpose), the line after chunk data, the last chunk and the trailer. A front end that only honours CRLF frames the body differently (request smuggling); the advisory's vector is 3D;!<LF>. As upstream's 12.0 fix, a bare LF in chunk framing is now a violation of a new HttpComplianceSection, LF_CHUNK_TERMINATION. Like TRANSFER_ENCODING_WITH_CONTENT_LENGTH it is a requirement: RFC2616, RFC7230, RFC7230_LEGACY, RFC7230_NO_AMBIGUOUS_URIS and the custom default include it. RFC2616_LEGACY excludes it, so it still accepts a bare LF and reports the violation. LEGACY has none. Unlike upstream, RFC7230_LEGACY keeps the requirement (Peter, 2026-10-29, changing his 2026-10-26 answer for that mode only): 9.4's etc/jetty-http.xml defaults the plain-HTTP connector of a jetty-home install to RFC7230_LEGACY, while Jetty 12's distribution defaults to RFC7230, so upstream's mode list would have left a default 9.4 install open. A deployment that needs bare-LF chunk framing sets jetty.http.compliance=RFC2616_LEGACY or a custom mode. A rejected line ends the message as an early EOF, the parser's path for every bad byte after the headers, as in 00006. Header lines still accept a bare LF. Adapted from upstream's 12.0.38 fix (PR jetty#15503, merge 5bc1f4d): - 389ffcb (Lachlan Roberts): Modernize the non-legacy HttpCompliance modes - 315d269 and de4c1e5 (Lachlan Roberts): fix failing tests from https://github.com/eclipse/jetty.project. Upstream marks a bare LF with new EOL tokens from next(); 9.4 keeps HttpTokens unchanged and checks the byte before next() in a private nextChunkToken, the jetty-9.2 port's shape. A blank bare-LF line between chunks, which upstream does not flag, is a violation here too, as in the 9.2 port. Tests: HttpParserTest#testChunkLinesNeedCRLF and #testChunkCRLFSplitAcrossBuffers are the 9.2 port's (a333152), with a bare-LF trailer line added. #testLFChunkTerminationAllowedOnlyByRFC2616LegacyCompliance is ours: RFC7230, RFC7230_LEGACY, RFC7230_NO_AMBIGUOUS_URIS and RFC2616 reject the advisory's vector; RFC2616_LEGACY accepts it and every bare-LF case and reports LF_CHUNK_TERMINATION. The bare-LF case of 00006's #testChunkDataWithLineTerminator moves to those tests. As in upstream's de4c1e5, the chunked bodies of PartialRFC2616Test and RFC2616BaseTest now use CRLF (their header lines keep LF). Upstream-Commit: 389ffcb Upstream-Commit: 315d269 Upstream-Commit: de4c1e5 Upstream-Commit: 5bc1f4d Co-authored-by: Lachlan Roberts <lachlan.p.roberts@gmail.com> Co-authored-by: Lachlan <lachlan@webtide.com>
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.
Backport changes for #15502 to
jetty-12.0.x.