Public bug reported:
imagemagick 8:6.9.12.98+dfsg1-5.2build2 on Ubuntu 24.04 (noble)
coders/tiff.c in 6.9.12.98 has the IPTC type check inverted: when
TIFFTAG_RICHTIFFIPTC is stored as a byte array (as Adobe Photoshop 2026
writes it) in a big-endian TIFF, ReadTIFFImage calls
TIFFSwabArrayOfLong(profile, length) with the byte length as the number
of 32-bit words, overwriting 3x the buffer size. Heap corruption
follows; the process aborts later with "double free or corruption" or
"corrupted double-linked list", also inside PHP via php-imagick.
Upstream fix: ImageMagick6 commit
057e5c0a3babcb3278c52f6927cc4e0479132b62 ("Apply fix for heap buffer
overflow that was already fixed in ImageMagick 7 (#290)", 2023-11-24,
included from 6.9.13-1). The noble package carries no patch for this -
https://github.com/ImageMagick/ImageMagick6/commit/057e5c0a3babcb3278c52f6927cc4e0479132b62
Reproducer (no special file needed):
convert -size 300x300 xc:gray -depth 8 -type TrueColor -compress lzw -endian
MSB t.tif
exiftool -overwrite_original -IPTC:CodedCharacterSet=UTF8
-IPTC:ApplicationRecordVersion=0 t.tif
identify t.tif # -> double free or corruption (out), SIGABRT
Same file with -endian LSB works. Valgrind: "Invalid write of size 4 at
TIFFSwabArrayOfLong, by coders/tiff.so".
Impact: every TIFF exported by Photoshop 2026 crashes any
ImageMagick-6-based consumer (identify, convert, php-imagick).
** Affects: imagemagick (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2173982
Title:
Heap buffer overflow reading IPTC from big-endian TIFF (fixed upstream
in 6.9.13-1)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/2173982/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs