Skip to content

fix(quic support): Wipe buffers after reading post-handshake message#5750

Merged
WesleyRosenblum merged 7 commits intomainfrom
quic_fix
Feb 20, 2026
Merged

fix(quic support): Wipe buffers after reading post-handshake message#5750
WesleyRosenblum merged 7 commits intomainfrom
quic_fix

Conversation

@maddeleine
Copy link
Copy Markdown
Contributor

Goal

Succeed when reading more than one post-handshake message in our quic support API.

We would like to thank Joshua Rogers (https://joshua.hu/) of AISLE Research Team (https://aisle.com/) for reporting this issue.

Why

s2n_recv_quic_post_handshake_message will fail if you ever call it twice in a row. Each time you call that API, the header read cursor is reset to 0. This is to handle the case where the message happens to be fragmented and we block, the next time we call the API, we can now reparse the header to get the expected message length. However if you read two messages in a row, you will reread the old header again, which leads to a parsing error.

We never hit this bug in s2n-quic as we never read more than one session ticket message. But we should fix it since we might one day need to process more than one post-handshake message.

How

Wipes the header and message buffers after successfully reading a post-handshake message in our quic support API.

Callouts

Testing

Includes unit test.

Related

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants