Skip to content

reject event stream messages with inconsistent prelude lengths - #3780

Open
ubeddulla wants to merge 1 commit into
boto:developfrom
ubeddulla:eventstream-prelude-length-check
Open

reject event stream messages with inconsistent prelude lengths#3780
ubeddulla wants to merge 1 commit into
boto:developfrom
ubeddulla:eventstream-prelude-length-check

Conversation

@ubeddulla

Copy link
Copy Markdown

EventStreamBuffer._validate_prelude checks the header and payload lengths against their maximums but never confirms the prelude fields agree with each other, and payload_length is derived as total_length minus headers_length minus the prelude and message-crc sizes. A response whose prelude declares a headers_length larger than total_length makes payload_length negative, which slips past the greater-than-maximum guard, and the decoder then reads headers_end bytes past the message boundary instead of raising a ParserError. Reject a prelude whose implied payload length is negative so malformed framing surfaces as InvalidPreludeLength like the other length checks.

@ubeddulla
ubeddulla requested a review from a team as a code owner August 18, 2026 11:43
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