Skip to content

fix 32-bit overflow in ICC CICP tag-count bounds check#234

Open
rootvector2 wants to merge 1 commit into
google:mainfrom
rootvector2:cicp-tagcount-overflow
Open

fix 32-bit overflow in ICC CICP tag-count bounds check#234
rootvector2 wants to merge 1 commit into
google:mainfrom
rootvector2:cicp-tagcount-overflow

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

12 * tag_count in FindCICPTag is computed in 32-bit, so a crafted ICC profile with tag_count=0x40000000 wraps 132 + 12 * tag_count back to 132 and slips past the length guard. The loop then reads icc_data[132 + 12*i] past the end of the profile. tag_count comes from offset 128 of the embedded profile, which is attacker-controlled when transcoding an image. Widen the multiply to 64-bit.

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