Heap-based buffer overflow in Pillow - #VU158881
Published: November 3, 2026
Vulnerability details
The vulnerability allows a remote attacker to cause a denial of service and potentially execute arbitrary code.
The vulnerability exists due to a heap-based buffer overflow in the bundled OpenJPEG library's opj_j2k_read_sod function when decoding JPEG 2000 images through Pillow's Image.open() and im.load(). A remote attacker can supply a crafted codestream containing a valid TLM marker, TNsot values of zero, and TPsot values exceeding the allocated tile-part index bounds to overwrite heap memory, terminate the process, and potentially execute arbitrary code through corrupted callback pointers.