Skip to content

Fix malformed packets in pack() causing challenge loop & buffer overread#17

Open
johnqherman wants to merge 1 commit intodsyomichev:masterfrom
johnqherman:fix/remove-trailing-preamble
Open

Fix malformed packets in pack() causing challenge loop & buffer overread#17
johnqherman wants to merge 1 commit intodsyomichev:masterfrom
johnqherman:fix/remove-trailing-preamble

Conversation

@johnqherman
Copy link
Copy Markdown

pack() appends a trailing FF FF FF FF to every packet by including preamble at both the start and end of the
Buffer.concat() call. Per the Source Query Protocol, packets should only have the FF FF FF FF header at the start.

This causes the server to reject challenge responses as malformed and re-send the challenge. Since solicit() only handles
a single challenge round, it treats the second challenge (9 bytes) as the actual query response and passes it to the
parser, which overreads the buffer.

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