GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — HAProxyMessage: validate the length of all TLV types by yawkat · Pull Request #17834 · netty/netty Conversation
Contributor
Motivation: HAProxyMessage.readNextTLV checks that the length of a PP2_TYPE_SSL TLV does Modification:
Result: A TLV that is longer than the header fails with a HAProxyProtocolException Discovered by fuzzing. 🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMotivation: HAProxyMessage.readNextTLV checks that the length of a PP2_TYPE_SSL TLV does not exceed the remaining header, but not the length of the other TLV types. For those, readRetainedSlice throws an IndexOutOfBoundsException, which ByteToMessageDecoder wraps in a DecoderException. HAProxyMessageDecoder only handles HAProxyProtocolException, so it does not close the channel, and it decodes the following bytes as another header. Modification: - Check the TLV length against the readable bytes for all TLV types. - Add unit tests. Result: A TLV that is longer than the header fails with a HAProxyProtocolException and closes the channel. Discovered by fuzzing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced
normanmaurer
approved these changes
yawkat
marked this pull request as ready for review
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
normanmaurer
added a commit
that referenced
this pull request
…17845) Auto-port of #17834 to 4.1 Cherry-picked commit: f25d65c --- Motivation: HAProxyMessage.readNextTLV checks that the length of a PP2_TYPE_SSL TLV does not exceed the remaining header, but not the length of the other TLV types. For those, readRetainedSlice throws an IndexOutOfBoundsException, which ByteToMessageDecoder wraps in a DecoderException. HAProxyMessageDecoder only handles HAProxyProtocolException, so it does not close the channel, and it decodes the following bytes as another header. Modification: - Check the TLV length against the readable bytes for all TLV types. - Add unit tests. Result: A TLV that is longer than the header fails with a HAProxyProtocolException and closes the channel. Discovered by fuzzing. --------- Co-authored-by: Jonas Konrad <[email protected]> Co-authored-by: Norman Maurer <[email protected]>
normanmaurer
added a commit
that referenced
this pull request
…17847) Auto-port of #17834 to 5.0 Cherry-picked commit: f25d65c --- Motivation: HAProxyMessage.readNextTLV checks that the length of a PP2_TYPE_SSL TLV does not exceed the remaining header, but not the length of the other TLV types. For those, readRetainedSlice throws an IndexOutOfBoundsException, which ByteToMessageDecoder wraps in a DecoderException. HAProxyMessageDecoder only handles HAProxyProtocolException, so it does not close the channel, and it decodes the following bytes as another header. Modification: - Check the TLV length against the readable bytes for all TLV types. - Add unit tests. Result: A TLV that is longer than the header fails with a HAProxyProtocolException and closes the channel. Discovered by fuzzing. --------- Co-authored-by: Jonas Konrad <[email protected]> Co-authored-by: Norman Maurer <[email protected]>
normanmaurer
pushed a commit
that referenced
this pull request
…der (#17835) Motivation: A TLV consists of a 1 byte type, a 2 byte length and a value that may be empty. HAProxyMessage.readNextTLV requires at least 4 readable bytes, so it ignores a TLV with an empty value at the end of the header or at the end of a PP2_TYPE_SSL TLV. Such a TLV is also lost when a decoded message is encoded and decoded again. Modification: - Read a TLV when at least 3 bytes are readable. - Add unit tests. Result: TLVs with an empty value are decoded. Three trailing bytes that declare a non-zero length are now rejected instead of ignored, while one or two trailing bytes are still ignored. One or two trailing bytes cannot form a TLV header; they are left as is on purpose to stay compatible with lenient or padding senders, and rejecting them could be a separate change. This change depends on #17834 ("HAProxyMessage: validate the length of all TLV types"), which makes such a TLV fail with a HAProxyProtocolException. This branch is based on that PR, so it also contains its commit. Discovered by fuzzing.
normanmaurer
pushed a commit
that referenced
this pull request
…of the header (#17835) Motivation: A TLV consists of a 1 byte type, a 2 byte length and a value that may be empty. HAProxyMessage.readNextTLV requires at least 4 readable bytes, so it ignores a TLV with an empty value at the end of the header or at the end of a PP2_TYPE_SSL TLV. Such a TLV is also lost when a decoded message is encoded and decoded again. Modification: - Read a TLV when at least 3 bytes are readable. - Add unit tests. Result: TLVs with an empty value are decoded. Three trailing bytes that declare a non-zero length are now rejected instead of ignored, while one or two trailing bytes are still ignored. One or two trailing bytes cannot form a TLV header; they are left as is on purpose to stay compatible with lenient or padding senders, and rejecting them could be a separate change. This change depends on #17834 ("HAProxyMessage: validate the length of all TLV types"), which makes such a TLV fail with a HAProxyProtocolException. This branch is based on that PR, so it also contains its commit. Discovered by fuzzing.
normanmaurer
added a commit
that referenced
this pull request
…of the header (#17835) (#17874) Motivation: A TLV consists of a 1 byte type, a 2 byte length and a value that may be empty. HAProxyMessage.readNextTLV requires at least 4 readable bytes, so it ignores a TLV with an empty value at the end of the header or at the end of a PP2_TYPE_SSL TLV. Such a TLV is also lost when a decoded message is encoded and decoded again. Modification: - Read a TLV when at least 3 bytes are readable. - Add unit tests. Result: TLVs with an empty value are decoded. Three trailing bytes that declare a non-zero length are now rejected instead of ignored, while one or two trailing bytes are still ignored. One or two trailing bytes cannot form a TLV header; they are left as is on purpose to stay compatible with lenient or padding senders, and rejecting them could be a separate change. This change depends on #17834 ("HAProxyMessage: validate the length of all TLV types"), which makes such a TLV fail with a HAProxyProtocolException. This branch is based on that PR, so it also contains its commit. Discovered by fuzzing. Co-authored-by: Jonas Konrad <[email protected]>
normanmaurer
added a commit
that referenced
this pull request
…of the header (#17835) (#17877) Motivation: A TLV consists of a 1 byte type, a 2 byte length and a value that may be empty. HAProxyMessage.readNextTLV requires at least 4 readable bytes, so it ignores a TLV with an empty value at the end of the header or at the end of a PP2_TYPE_SSL TLV. Such a TLV is also lost when a decoded message is encoded and decoded again. Modification: - Read a TLV when at least 3 bytes are readable. - Add unit tests. Result: TLVs with an empty value are decoded. Three trailing bytes that declare a non-zero length are now rejected instead of ignored, while one or two trailing bytes are still ignored. One or two trailing bytes cannot form a TLV header; they are left as is on purpose to stay compatible with lenient or padding senders, and rejecting them could be a separate change. This change depends on #17834 ("HAProxyMessage: validate the length of all TLV types"), which makes such a TLV fail with a HAProxyProtocolException. This branch is based on that PR, so it also contains its commit. Discovered by fuzzing. Co-authored-by: Jonas Konrad <[email protected]>
lltopk
pushed a commit
to lltopk/netty
that referenced
this pull request
…etty#17845) Auto-port of netty#17834 to 4.1 Cherry-picked commit: f25d65c --- Motivation: HAProxyMessage.readNextTLV checks that the length of a PP2_TYPE_SSL TLV does not exceed the remaining header, but not the length of the other TLV types. For those, readRetainedSlice throws an IndexOutOfBoundsException, which ByteToMessageDecoder wraps in a DecoderException. HAProxyMessageDecoder only handles HAProxyProtocolException, so it does not close the channel, and it decodes the following bytes as another header. Modification: - Check the TLV length against the readable bytes for all TLV types. - Add unit tests. Result: A TLV that is longer than the header fails with a HAProxyProtocolException and closes the channel. Discovered by fuzzing. --------- Co-authored-by: Jonas Konrad <[email protected]> Co-authored-by: Norman Maurer <[email protected]>
lltopk
pushed a commit
to lltopk/netty
that referenced
this pull request
…of the header (netty#17835) (netty#17877) Motivation: A TLV consists of a 1 byte type, a 2 byte length and a value that may be empty. HAProxyMessage.readNextTLV requires at least 4 readable bytes, so it ignores a TLV with an empty value at the end of the header or at the end of a PP2_TYPE_SSL TLV. Such a TLV is also lost when a decoded message is encoded and decoded again. Modification: - Read a TLV when at least 3 bytes are readable. - Add unit tests. Result: TLVs with an empty value are decoded. Three trailing bytes that declare a non-zero length are now rejected instead of ignored, while one or two trailing bytes are still ignored. One or two trailing bytes cannot form a TLV header; they are left as is on purpose to stay compatible with lenient or padding senders, and rejecting them could be a separate change. This change depends on netty#17834 ("HAProxyMessage: validate the length of all TLV types"), which makes such a TLV fail with a HAProxyProtocolException. This branch is based on that PR, so it also contains its commit. Discovered by fuzzing. Co-authored-by: Jonas Konrad <[email protected]>
1 of 11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |