Repository navigation
Conversation
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.
Out-of-bounds read textifying a truncated AMQP container
When frame tracing textifies a received frame,
consume_count()reads the 4-byte element count of a 32-bit list/map/array after only checking the value region is non-empty, andpn_value_dump_array()reads the shared element-constructor byte of a zero-count array the same way. A frame that declares a 32-bit container but carries fewer than 4 bytes of content (or an array carrying only its count with no constructor) makes both read past the end of the value. The count read also underflows the remaining size, so the element walk that follows runs further off the buffer. Both paths reach the publicpn_value_dump()for any received frame once FRAME-level logging is on, so the length is attacker controlled. Added the missing length checks so a truncated container dumps as empty.Repro: under AddressSanitizer,
pn_value_dump()ond0 00 00 00 01 55faults inconsume_countand onf0 00 00 00 04 00 00 00 00inpn_value_dump_array. The newvalue_dump_truncated_containercase indata_test.cppcovers both and aborts before the change.This is a functional fix, so it wants a PROTON JIRA key; I'll raise one and prefix the title before this is published.