ImageIO, the infamous iOS Zero Click Attack Vector.
ImageIO is Apple’s Framework that handles image parsing, which exposes 0click attack surface
Months after reading this blog post from Google Project Zero about fuzzing ImageIO, I used LLDB to examine the testHeader functions, it turned out there are three new testHeader functions for different file formats.
such as KTX2 and WebP and ETC, so because they were fairly new I thought maybe they have not been fuzzed by Project Zero.
KTX2 is a relatively new specification introduced after the Project Zero fuzzing efforts. Arguably, its source code is also new. Further information about KTX2 can be found in its specification document here: khronos.org.
Although WebP has not been fuzzed by Project Zero, it is fuzzed with Google OSS-Fuzz. So I decided not to compete with Google’s fuzzer in this regard.
Another important issue I noticed was that in the Project Zero’s blog, ImageIO was using OpenEXR, but in my test, ImageIO was using Apple’s closed-source new implementation of EXR in libAppleEXR.dylib. Therefore, I decided to fuzz these two file formats, EXR and KTX2.
the Samuel Groß has modifed Honggfuzz to have a binary Coverage-guided fuzzing. but I ported Project Zero’s harness to Jackalope fuzzer (awesome project thanks to Ivan Fratric), also I used initWithData method of NSImage and in-memory fuzzing option of Jackalope to make the fuzzing faster.
I managed to find lots of KTX2 sample files in the following pages: