Out-of-bounds Write Affecting pillow package, versions [,13.0.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.5% (43rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-PILLOW-21431000
  • published22 Oct 2026
  • disclosed21 Oct 2026
  • creditNicholas Carlini

Introduced: 21 Oct 2026

NewCVE-2026-96778  (opens in a new tab)
CWE-787  (opens in a new tab)

How to fix?

Upgrade pillow to version 13.0.0 or higher.

Overview

Affected versions of this package are vulnerable to Out-of-bounds Write via the JPEG COM marker encoding path in JpegEncode.c, when a JPEG image carrying an oversized comment in its im.info metadata is re-encoded. The comment length is not validated before being written as a COM marker, allowing a comment that exceeds the maximum marker size to overflow the output buffer. An attacker who can supply a JPEG file with an excessively long embedded comment can trigger this condition, leading to memory corruption with potential for arbitrary code execution.

CVSS Base Scores

version 4.0
version 3.1