Skip to content

Auto-port 5.0: Fix IndexOutOfBoundsException from mismatched varint length in Http3FrameCodec - #17560

Merged
normanmaurer merged 1 commit into
5.0from
auto-port-pr-17523-to-5.0
Sep 21, 2026
Merged

normanmaurer merged 1 commit into
5.0from
auto-port-pr-17523-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #17523 to 5.0
Cherry-picked commit: ae1798a


Motivation:

decodeFrame() and decodeSettings() checked that the buffer held at
least the frame's declared payload length, but the length of the
variable-length integer(s) inside that payload is derived from the
integer's own first byte, independent of the declared payload length.
A CANCEL_PUSH/GO_AWAY/MAX_PUSH_ID/PUSH_PROMISE frame (or a SETTINGS
key/value) whose declared length was shorter than what its own prefix
bits require caused readVariableLengthInteger() to call
readLong()/readInt()/etc. past what was verified available, throwing
a raw IndexOutOfBoundsException instead of failing the connection
with H3_FRAME_ERROR.

Modifications:

Validate the integer's encoded length against the declared payload
length before reading it, and add regression tests for each affected
frame type plus both SETTINGS key and value lengths.

Result:

Correctly handle varint lenght parsing

…rameCodec (#17523)

Motivation:

decodeFrame() and decodeSettings() checked that the buffer held at
least the frame's declared payload length, but the length of the
variable-length integer(s) inside that payload is derived from the
integer's own first byte, independent of the declared payload length.
A CANCEL_PUSH/GO_AWAY/MAX_PUSH_ID/PUSH_PROMISE frame (or a SETTINGS
key/value) whose declared length was shorter than what its own prefix
bits require caused readVariableLengthInteger() to call
readLong()/readInt()/etc. past what was verified available, throwing
a raw IndexOutOfBoundsException instead of failing the connection
with H3_FRAME_ERROR.

Modifications:

Validate the integer's encoded length against the declared payload
length before reading it, and add regression tests for each affected
frame type plus both SETTINGS key and value lengths.

Result:

Correctly handle varint lenght parsing

(cherry picked from commit ae1798a)
@testlens-app

testlens-app Bot commented Sep 20, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 11ac831
▶️ Tests: 231477 executed
⚪️ Checks: 12/12 completed


Learn more about TestLens at testlens.app/docs.

@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Sep 21, 2026
@normanmaurer
normanmaurer merged commit 5a0b781 into 5.0 Sep 21, 2026
13 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17523-to-5.0 branch September 21, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants