I'm an experienced Security Researcher and System Software Engineer, primarily skilled in Rust, C and Assembly.
This one's private :3
This one's private :3
I've found what I belive to be a security vulnerability in the fitz TIFF parser. By providing a specially modified TIFF file (such as the one attached), such that tiff->bitspersample == 16 && tiff->order == TII but where tiff->imagelength * tiff->stride < tiff->imagewidth * tiff->imagelength * tiff->samplesperpixel, an attacker can overwrite an arbitary amount of data off the end of a heap allocated buffer. In source/fitz/load-tiff.c, tiff_decode_samples, line 1322, a buffer is allocated with size (tiff->imagelength * tiff->stride) On line 1377, this buffer is passed to tiff_swap_byte_order, with parameter n = tiff->imagewidth * tiff->imagelength * tiff->samplesperpixel Because these two values can differ, tiff_swap_byte_order will both read uninitialised heap memory and write out of bounds into this buffer by an arbitary amount Additionally, I belive a similar bug is present on line 1385, when calling tiff_scale_lab_samples. I believe the fix would be to use the existing allocation size as the parameter to tiff_swap_byte_order rather than recomputing it.
Native
Beginner