Reject client-side receipt of server Initial packets with non-zero Token Length (RFC 9000 §17.2.2)#148
Open
tarunbtw wants to merge 1 commit into
Open
Conversation
…ken Length RFC 9000, Section 17.2.2 requires a client to discard, or MAY close the connection on, an Initial packet from the server that carries a non-zero-length Token field, since only clients are permitted to send Initial tokens. quiche parsed and stored header.retry_token but never checked for this case on the client receive path. Add a check in QuicConnection::OnUnauthenticatedPublicHeader() that closes the connection with IETF_QUIC_PROTOCOL_VIOLATION when a client receives a server Initial packet with a non-empty retry token, plus a regression test. Fixes google#138
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reject client-side receipt of server Initial packets with non-zero Token Length
Fixes google/quiche#138
Problem
RFC 9000, Section 17.2.2 requires a client to discard, or MAY close the
connection on, an Initial packet from the server that carries a
non-zero-length Token field, since only clients are permitted to send
Initial tokens.
quicheparsed and storedheader.retry_tokenbut never checked forthis case on the client receive path. A server, or an on-path attacker
spoofing one, could send an Initial packet with a non-empty token and
the client would accept it.
Fix
Added a check in
QuicConnection::OnUnauthenticatedPublicHeader()that closes the connection with
IETF_QUIC_PROTOCOL_VIOLATIONwhen aclient receives a server Initial packet with a non-empty retry token.
Testing
Added
ClientRejectsServerInitialWithNonZeroTokenLengthtoquic_connection_test.cc. It constructs a server-perspective Initialpacket with a non-empty retry token, feeds it through
ProcessUdpPacket, and asserts the connection closes withIETF_QUIC_PROTOCOL_VIOLATION.All 8 parameterized instances pass, including both gQUIC (short-circuited
by the existing
!IsIetfQuic()check) and IETF QUIC versions.