Skip to content

Fix units mismatch in picture metadata limit checks#912

Open
hyder365 wants to merge 1 commit into
xiph:masterfrom
hyder365:fix-picture-units
Open

Fix units mismatch in picture metadata limit checks#912
hyder365 wants to merge 1 commit into
xiph:masterfrom
hyder365:fix-picture-units

Conversation

@hyder365

Copy link
Copy Markdown

FLAC__bitreader_limit_remaining() returns bits, but the picture
metadata parser was comparing it directly against byte lengths for
MIME type, description, and picture data fields. This meant fields
with lengths between (limit/8, limit] could bypass the check.

The actual read would still be caught by the downstream
FLAC__bitreader_read_byte_block_aligned_no_crc which correctly
converts bytes to bits before comparing, so this is not exploitable,
but it is a correctness bug.

FLAC__bitreader_limit_remaining() returns bits, but the picture
metadata parser was comparing it directly against byte lengths for
MIME type, description, and picture data fields. This meant fields
with lengths between (limit/8, limit] could bypass the check.

The actual read would still be caught by the downstream
FLAC__bitreader_read_byte_block_aligned_no_crc which correctly
converts bytes to bits before comparing, so this is not exploitable,
but it is a correctness bug.
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