Repository navigation
fix: OCF block message count unbounded with zero-byte-consuming decode - #643
Merged
Merged
Conversation
Kriskras99
approved these changes
Aug 26, 2026
martin-g
force-pushed
the
04-block-message-count-unbounded
branch
2 times, most recently
from
August 26, 2026 11:10
2f185e3 to
7d4c595
Compare
martin-g
force-pushed
the
04-block-message-count-unbounded
branch
from
August 26, 2026 11:13
7d4c595 to
debb80f
Compare
Base automatically changed from
recursion-depth-check-decoding-deserializing
to
main
August 26, 2026 15:40
After decompression, if the declared count exceeds the number of bytes actually in the block (only possible when some datums are zero-width, e.g. schema "null"), the count itself must pass safe_collection_len::<Value> — i.e. the number of conjurable-from-nothing objects is bounded by the allocation budget (~16-21M at the 512MB default) instead of being trusted. Counts backed by at least one byte per object are unchanged, and the existing :209 guard still errors when a non-empty buffer yields a zero-consumption decode. Reported-by: Security scans
martin-g
force-pushed
the
04-block-message-count-unbounded
branch
from
August 26, 2026 15:40
debb80f to
799bd1a
Compare
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.
After decompression, if the declared count exceeds the number of bytes actually in the block (only possible when some datums are zero-width, e.g. schema "null"), the count itself must pass safe_collection_len:: — i.e. the number of conjurable-from-nothing objects is bounded by the allocation budget (~16-21M at the 512MB default) instead of being trusted. Counts backed by at least one byte per object are unchanged, and the existing :209 guard still errors when a non-empty buffer yields a zero-consumption decode.
Reported-by: Security scans