Skip to content

Validate special ping packets before decoding - #5818

Open
acts-1631 wants to merge 1 commit into
supertuxkart:masterfrom
acts-1631:fix-ping-packet-length
Open

Validate special ping packets before decoding#5818
acts-1631 wants to merge 1 commit into
supertuxkart:masterfrom
acts-1631:fix-ping-packet-length

Conversation

@acts-1631

Copy link
Copy Markdown

The client receive loop handles unencrypted ping packets before normal event parsing. It accepted any packet with the five-byte ping prefix, then read a timestamp and a counted peer list without first checking that those bytes were present. A malformed packet from a connected server could terminate the listening thread.

Check the fixed ping header before decoding it, then verify that the remaining packet contains every advertised peer record. Invalid ping packets are dropped before they reach the decoder.

The receive loop accepted a five-byte ping prefix, then read a timestamp

and a counted peer list without checking their lengths.

Reject packets shorter than the fixed header or the advertised peer

records before decoding them.
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.

1 participant