x/image/tiff: corrupt or malicious paletted images parse successfully and later panic in (*Palleted).At #67624
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.23-20240419-RC02 cl/626470163 +7f76c00fc5 X:fieldtrack,boringcrypto linux/amd64
Output of
go env
in your module/workspace:What did you do?
Reproducer:
What did you see happen?
Running the above reproducer with a copy of https://github.com/pic4xiu/pocRep/blob/main/poc.tiff:
What did you expect to see?
I'd expect to see the parser return an error instead of leniently parsing and causing a panic when the user actually tries to use the resulting image.
Context: https://osv.dev/vulnerability/GHSA-q7pp-wcgr-pffx, based on disintegration/imaging#165. The actual issue is not in that library but in this TIFF parser.
I have a proposed fix that I will send a code review for shortly. (It just checks each index against the palette size before calling
img.SetColorIndex
.)The text was updated successfully, but these errors were encountered: