Heap-based buffer overflow in Pillow - #VU158881

 

Heap-based buffer overflow in Pillow - #VU158881

Published: November 3, 2026


Vulnerability identifier: #VU158881
CSH Severity: High
CVSS v4: 9.2 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: N/A
CWE-ID: CWE-122
Exploitation vector: Remote access
Exploit availability: No public exploit available

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.


Affected software

Pillow

Remediation

Install security update from vendor's website.

Pillow - update to 13.0.0

External References

Related Security Bulletins