Repository navigation
FastLz: Guard decompression against truncated input (#17000) - #17015
Merged
Merged
Conversation
Motivation: Malformed FastLZ compressed blocks can declare input that is empty or ends in the middle of match metadata. FastLz.decompress should treat these blocks as corrupted input instead of reading past the supplied chunk length. Modification: Return 0 for empty compressed input and check the input length before reading optional match length and distance bytes. Add FastLzFrameDecoder regression coverage for empty compressed payloads and truncated match metadata. Result: Malformed FastLZ compressed blocks now fail through the decoder as DecompressionException instead of triggering ByteBuf bounds exceptions. Security impact: This is not considered a security issue. Malformed compressed input can already cause the decoder to fail the channel, and the previous behavior was a Java `ByteBuf` bounds exception rather than native memory corruption, data disclosure, or privilege boundary bypass. The change makes the failure mode consistent by treating truncated FastLZ blocks as corrupted input and surfacing the existing `DecompressionException` path. --------- Co-authored-by: multicode <[email protected]> (cherry picked from commit 775ad71)
yungs4909-creator
suggested changes
Jun 29, 2026
There was a problem hiding this comment.
|
View it on GitHub
…On Mon, Jun 29, 2026, 4:47 PM Chris Vest ***@***.***> wrote:
Motivation:
Malformed FastLZ compressed blocks can declare input that is empty or ends
in the middle of match metadata. FastLz.decompress should treat these
blocks as corrupted input instead of reading past the supplied chunk length.
Modification:
Return 0 for empty compressed input and check the input length before
reading optional match length and distance bytes. Add FastLzFrameDecoder
regression coverage for empty compressed payloads and truncated match
metadata.
Result:
Malformed FastLZ compressed blocks now fail through the decoder as
DecompressionException instead of triggering ByteBuf bounds exceptions.
Security impact:
This is not considered a security issue. Malformed compressed input can
already cause the decoder to fail the channel, and the previous behavior
was a Java ByteBuf bounds exception rather than native memory corruption,
data disclosure, or privilege boundary bypass. The change makes the failure
mode consistent by treating truncated FastLZ blocks as corrupted input and
surfacing the existing DecompressionException path.
------------------------------
Co-authored-by: multicode ***@***.***
(cherry picked from commit 775ad71
<775ad71>
)
------------------------------
You can view, comment on, or merge this pull request online at:
#17015
Commit Summary
- eb2dcd8
<eb2dcd8>
FastLz: Guard decompression against truncated input (#17000)
File Changes
(2 files <https://github.com/netty/netty/pull/17015/files>)
- *M*
codec/src/main/java/io/netty/handler/codec/compression/FastLz.java
<https://github.com/netty/netty/pull/17015/files#diff-8af32267152b67c260b58e5d9418ff081fb5e16b7f521de164a57bb6d2b4fb7f>
(19)
- *A*
codec/src/test/java/io/netty/handler/codec/compression/FastLzFrameDecoderTest.java
<https://github.com/netty/netty/pull/17015/files#diff-c1c362ffafd84830e13e7f116f94bfe70179aad04ba58c3611c0964b51816a24>
(61)
Patch Links:
- https://github.com/netty/netty/pull/17015.patch
- https://github.com/netty/netty/pull/17015.diff
—
Reply to this email directly, view it on GitHub
<#17015?email_source=notifications&email_token=CBPZIMKO5IV6ASOIKZXMLBT5CLPWFA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTSNJYHA4TIOBQGOTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CBPZIMP4T7YPBOMUE66D3W35CLPWFAVCNFSNUABDKJSXA33TNF2G64TZHMYTANRUGU3DGO2JONZXKZJ3GQ3TOMJYGA3DINRUUF3AE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Member
Author
|
@yungs4909-creator what are you talking about? |
lltopk
pushed a commit
to lltopk/netty
that referenced
this pull request
Oct 24, 2026
…tty#17015) Motivation: Malformed FastLZ compressed blocks can declare input that is empty or ends in the middle of match metadata. FastLz.decompress should treat these blocks as corrupted input instead of reading past the supplied chunk length. Modification: Return 0 for empty compressed input and check the input length before reading optional match length and distance bytes. Add FastLzFrameDecoder regression coverage for empty compressed payloads and truncated match metadata. Result: Malformed FastLZ compressed blocks now fail through the decoder as DecompressionException instead of triggering ByteBuf bounds exceptions. Security impact: This is not considered a security issue. Malformed compressed input can already cause the decoder to fail the channel, and the previous behavior was a Java `ByteBuf` bounds exception rather than native memory corruption, data disclosure, or privilege boundary bypass. The change makes the failure mode consistent by treating truncated FastLZ blocks as corrupted input and surfacing the existing `DecompressionException` path. --------- Co-authored-by: multicode <[email protected]> (cherry picked from commit 775ad71) Co-authored-by: Jonas Konrad <[email protected]>
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.
Motivation:
Malformed FastLZ compressed blocks can declare input that is empty or ends in the middle of match metadata. FastLz.decompress should treat these blocks as corrupted input instead of reading past the supplied chunk length.
Modification:
Return 0 for empty compressed input and check the input length before reading optional match length and distance bytes. Add FastLzFrameDecoder regression coverage for empty compressed payloads and truncated match metadata.
Result:
Malformed FastLZ compressed blocks now fail through the decoder as DecompressionException instead of triggering ByteBuf bounds exceptions.
Security impact:
This is not considered a security issue. Malformed compressed input can already cause the decoder to fail the channel, and the previous behavior was a Java
ByteBufbounds exception rather than native memory corruption, data disclosure, or privilege boundary bypass. The change makes the failure mode consistent by treating truncated FastLZ blocks as corrupted input and surfacing the existingDecompressionExceptionpath.Co-authored-by: multicode [email protected]
(cherry picked from commit 775ad71)