Skip to content

bounds-check OnUserControlMessage like sibling control handlers#3329

Open
sahvx655-wq wants to merge 1 commit into
apache:masterfrom
sahvx655-wq:ucm-min-length
Open

bounds-check OnUserControlMessage like sibling control handlers#3329
sahvx655-wq wants to merge 1 commit into
apache:masterfrom
sahvx655-wq:ucm-min-length

Conversation

@sahvx655-wq
Copy link
Copy Markdown

the sibling control-message handlers (OnSetChunkSize, OnAck, OnWindowAckSize, OnSetPeerBandwidth) all validate message_length before touching the body, but OnUserControlMessage only caps the upper bound at 32. reading the code, a user control message with length 0 or 1 reads the 2-byte event type past the end of the stack buffer, and message_length - 2 underflows (uint32_t) to roughly 4G for the event_data StringPiece. require at least 2 bytes up front like the siblings do.

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