Skip to content

Fix missing readable-bytes checks in QuicHeaderParser - #17515

Merged
normanmaurer merged 3 commits into
4.2from
quic_header_parser_fix
Sep 21, 2026
Merged

normanmaurer merged 3 commits into
4.2from
quic_header_parser_fix

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

QuicHeaderParser read the destination/source connection-id length
bytes of a long-header QUIC packet without first verifying enough
bytes were readable, unlike every other read in the class. A
truncated datagram could trigger a raw IndexOutOfBoundsException
instead of the expected QuicException, or silently read stale bytes
from an over-allocated buffer.

Modifications:

Add the missing checkReadable() guards and a regression test.

Result:

No more risk of IOOBE

Motivation:

QuicHeaderParser read the destination/source connection-id length
bytes of a long-header QUIC packet without first verifying enough
bytes were readable, unlike every other read in the class. A
truncated datagram could trigger a raw IndexOutOfBoundsException
instead of the expected QuicException, or silently read stale bytes
from an over-allocated buffer.

Modifications:

Add the missing checkReadable() guards and a regression test.

Result:

No more risk of IOOBE
@normanmaurer normanmaurer added this to the 4.2.19.Final milestone Sep 17, 2026
@normanmaurer normanmaurer added the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 17, 2026
@testlens-app

testlens-app Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 37333a0
▶️ Tests: 470330 executed
⚪️ Checks: 26/26 completed


Learn more about TestLens at testlens.app/docs.

@normanmaurer
normanmaurer merged commit fdd2b67 into 4.2 Sep 21, 2026
27 checks passed
@normanmaurer
normanmaurer deleted the quic_header_parser_fix branch September 21, 2026 07:17
@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #17561

@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 21, 2026
normanmaurer added a commit that referenced this pull request Sep 21, 2026
…17561)

Auto-port of #17515 to 5.0
Cherry-picked commit: fdd2b67

---
Motivation:

QuicHeaderParser read the destination/source connection-id length
bytes of a long-header QUIC packet without first verifying enough
bytes were readable, unlike every other read in the class. A
truncated datagram could trigger a raw IndexOutOfBoundsException
instead of the expected QuicException, or silently read stale bytes
from an over-allocated buffer.

Modifications:

Add the missing checkReadable() guards and a regression test.

Result:

No more risk of IOOBE

Co-authored-by: Norman Maurer <[email protected]>
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