CVE-2016-4009 · mitre
CVE-2016-4009
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.
Published 2016-04-13, last changed 2026-06-17. Weakness: CWE-119.
How to fix
Upgrade to a fixed version: pillow 3.1.1 (PyPI). For the version that clears every advisory for your installed version, ask an agent for get_remediation.
Where the flaw is in the code
Fixed in python-pillow/Pillow by 4e0d9b0b97, pull request #1714. Functions changed by the fix: ImagingResampleHorizontal, _resize. Regression tests: Tests/test_image_resample.py. Confidence: verified (a record names this commit as the fix, and it changed these functions).
Timeline
| 2016-04-13 | Published |
| 2016-04-13 | Package advisory PYSEC-2016-7 |
| 2018-07-24 | Package advisory GHSA-hvr8-466p-75rh |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 7.87% |
| 2026-12-01 | Code-level analysis added |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-hvr8-466p-75rh | pillow (PyPI) | 3.1.1 |
| PYSEC-2016-7 | pillow (PyPI) | 3.1.1 |
Also known as: GHSA-hvr8-466p-75rh, PYSEC-2016-7
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2026-128067 | 2026-11-13 | 8.4 | Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size |
| CVE-2026-128066 | 2026-11-13 | 8.7 | Pillow: Memory DoS in TIFF and EXIF IFD parsing via overlapping tag data |
| CVE-2026-112902 | 2026-11-05 | 9.1 | Pillow: Memory disclosure and segfault in libtiff encoder via crafted TIFF tags |
| CVE-2026-112899 | 2026-11-05 | 5.3 | Pillow: EPS load(scale) lets Ghostscript render past the decompression bomb limit |
| CVE-2026-114501 | 2026-10-21 | 5.3 | Pillow: Arrow export leaks stale heap memory when PILLOW_ALIGNMENT > 1 |
| CVE-2026-96778 | 2026-10-21 | 8.8 | Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer |
| CVE-2026-96644 | 2026-10-21 | 8.1 | Pillow: Heap over-read in WMF/EMF rendering via 16-bit dimension truncation (Windows builds) |
| CVE-2026-96643 | 2026-10-21 | 6.5 | Pillow: PNG eXIf chunk makes EXIF parsing run in quadratic time |
Add it to your agent
One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.
claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp
Then ask for triage_cve CVE-2016-4009, or call /api/v1/vulnerabilities/CVE-2016-4009. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.