CVE-2016-4009 Pillow Integer overflow in ImagingResampleHorizontal
Remote attackers can trigger a heap-based buffer overflow via negative size values, potentially leading to code execution or denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2016-4009?
CVE-2016-4009 is a critical vulnerability in Python Pillow, published on 13 Apr 2016. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote attackers to have unspecified impact via negative values of the new size, which triggers a heap-based buffer overflow.
Weakness: CWE-119
Which versions are affected by CVE-2016-4009?
3 open source packages ship an affected version, including pillow. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pillow PyPI | All versions | 3.1.1 |
pillow PyPI | All versions | 3.1.1 |
pillow PyPI | All versions | 3.1.1 |
Products include Python Pillow.
How do I fix CVE-2016-4009?
Upgrade pillow to 3.1.1 or later.
Is CVE-2016-4009 being exploited?
There is no known exploitation of CVE-2016-4009 in the wild and no public exploit code.
Other vulnerabilities in Python Pillow
- CVE-2014-3007 Pillow command injection
- CVE-2026-96639 Pillow multi-frame loaders can reuse stale native image storage after mode transitions
- CVE-2022-30595 Buffer over-flow in Pillow
- CVE-2021-25289 Out of bounds write in Pillow
- CVE-2026-112393 Pillow: Heap buffer overflow in _tiffWriteProc when saving TIFF to BytesIO
Sources
Also known as DEBIAN-CVE-2016-4009, GHSA-hvr8-466p-75rh, PYSEC-2016-7.