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 — Auto-port 5.0: Reject truncated QPACK prefixed integers in field section decode by netty-project-bot · Pull Request #17922 · netty/netty Conversation
Contributor
Auto-port of #17778 to 5.0 Motivation: QpackDecoder.decode works on a buffer that already holds the complete QPACK field section. Each line is decoded with QpackUtil.decodePrefixedInteger, which returns -1 when it would need more bytes and rewinds the reader index. In the decode path that -1 was only guarded by When the dynamic table is enabled a peer can send a tiny HEADERS block whose last line is an Indexed Field Line With Post-Base Index with a truncated integer (e.g. the 3 bytes Modification: Added decodePrefixedIntOrThrow / decodePrefixedLongOrThrow in QpackDecoder that turn a -1 result into a QpackException (decompression error), and routed every prefixed-integer read in decodeIndexed, decodeIndexedWithPostBase, decodeLiteralWithNameRef, decodeLiteralWithPostBaseNameRef, decodeHuffmanEncodedLiteral, decodeRequiredInsertCount and decodeBase through them. The streaming encoder/decoder instruction handlers still use the raw -1 "need more bytes" contract and are untouched. Result: A truncated field section now fails with a QPACK decompression error that Http3FrameCodec already handles, instead of hanging the event loop. Added a regression test in QpackDecoderTest that reproduces the post-base case; it hangs/asserts before the change and passes after.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions) Motivation: QpackDecoder.decode works on a buffer that already holds the complete QPACK field section. Each line is decoded with QpackUtil.decodePrefixedInteger, which returns -1 when it would need more bytes and rewinds the reader index. In the decode path that -1 was only guarded by `assert idx >= 0`, which is off in production. When the dynamic table is enabled a peer can send a tiny HEADERS block whose last line is an Indexed Field Line With Post-Base Index with a truncated integer (e.g. the 3 bytes `02 00 1f`). decode then calls getEntryRelativeEncodedField(base - 1), gets a live entry, never consumes the trailing byte, and the `while (in.isReadable())` loop spins forever on the QUIC event loop thread. With assertions enabled it throws AssertionError instead, but the production path is a hard hang. The same -1 reaches the dynamic-table index math and the literal length in the other helpers. Modification: Added decodePrefixedIntOrThrow / decodePrefixedLongOrThrow in QpackDecoder that turn a -1 result into a QpackException (decompression error), and routed every prefixed-integer read in decodeIndexed, decodeIndexedWithPostBase, decodeLiteralWithNameRef, decodeLiteralWithPostBaseNameRef, decodeHuffmanEncodedLiteral, decodeRequiredInsertCount and decodeBase through them. The streaming encoder/decoder instruction handlers still use the raw -1 "need more bytes" contract and are untouched. Result: A truncated field section now fails with a QPACK decompression error that Http3FrameCodec already handles, instead of hanging the event loop. Added a regression test in QpackDecoderTest that reproduces the post-base case; it hangs/asserts before the change and passes after. Co-authored-by: Norman Maurer <[email protected]> (cherry picked from commit e526345)
|
There was an error while loading. Please reload this page.
🚨 TestLens detected 2 failed tests 🚨Test SummaryTip Inspect all details with the TestLens CLI: Build PR / macos-x86_64-java25-boringssl build > Netty/Transport/Native/KQueue
🏷️ Commit: 5a56cc9 Test FailuresKQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeMixedByteBuf(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-x86_64-java25-boringssl build)KQueueDatagramUnicastIPv6MappedTest > testSimpleSendHeapByteBuf(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-x86_64-java25-boringssl build)Rerun ControlsNote Checks are currently running using the configuration below. Select tests to mute in this pull request: 🔲 KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeMixedByteBuf(TestInfo) Reuse successful test results: 🔲 ♻️ Only rerun the tests that failed or were muted before Click the checkbox to trigger a rerun: 🔲 Rerun jobs Learn more about TestLens at testlens.app/docs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.