Vulnerabilities

Security fix · CVE-2026-112398

Pillow is a Python imaging library.

Published Oct 19, 2026 · catalog updated Oct 28, 2026 · Pillow is a Python

Last checked Oct 31, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2026-112398. EPSS is 0.70%. Act only if a listed version of Pillow is a Python is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (Pillow is a Python).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
Critical9.8
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.70%
Remediation
Version ranges on file
Affected products
Bitnami pillow · PyPI pillow · pip pillow · pypi pillow

### Credits **Researcher**: Alex Bouffard (mixbo@pebwalker.com) ### Summary A heap buffer overflow in Pillow's FlashPix (FPX) JPEG-tile decoder lets an attacker achieve arbitrary code execution by getting an application to open a single crafted file with . The file is recognized by content (the OLE2 magic), not by extension, so any service that opens or thumbnails untrusted uploads with the optional dependency installed is reachable with no user interaction. In the PoC below, opening one crafted file executes an attacker-chosen command on stock Pillow 12.2.0 (x86_64 Ubuntu 24.04, glibc 2.39). ### Details decodes FlashPix (FPX) files, which are OLE2/CFBF compound documents. auto-detects them from the OLE2 magic whenever the optional package is installed (Pillow's documented dependency for FPX/MIC support), regardless of the file's extension. For a JPEG-compressed subimage ( ), the plugin builds a decode tile and derives the pair from attacker-controlled FPX color IDs through the table ([ L25-L32](https://github.com/python-pillow/Pillow/blob/12.2.0/src/PIL/FpxImagePlugin.py#L25-L32)): The Imaging output buffer for the tile is sized for the rawmode (here = 2 bytes/pixel) ([ L223-L226](https://github.com/python-pillow/Pillow/blob/12.2.0/src/decode.c#L223-L226)): In the rawmode string is mapped to a libjpeg . Recognized modes ( , , , and so on) get a concrete colorspace, but and are not recognized, so control reaches the fallback branch ([ L219-L221](https://github.com/python-pillow/Pillow/blob/12.2.0/src/libImaging/JpegDecode.c#L219-L221)): Under , libjpeg performs no color conversion and emits bytes per pixel, taken from the embedded JPEG's SOF marker, which the attacker sets to 4. So writes bytes per row into a buffer allocated for only bytes ([ L252](https://github.com/python-pillow/Pillow/blob/12.2.0/src/libImaging/JpegDecode.c#L252)): This is a heap out-of-bounds write with attacker-controlled length (the image width, up to tens of thousands of pixels, so about byt

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • Bitnami pillow0 → 13.0.0
  • PyPI pillow0 → 13.0.0
  • pip pillow<= 12.3.0
  • pypi pillowversion unspecified

How to fix CVE-2026-112398

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-112398. EPSS is 0.70%. Act only if a listed version of Pillow is a Python is installed.

Which versions are affected?

Compare what you have installed with 0 → 13.0.0, <= 12.3.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-122: Heap-based Buffer Overflow; CWE-787: Out-of-bounds Write. EPSS 0.70%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Technology hubs

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Oct 19, 2026 · NIST NVD

    Detected

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow's FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_UNKNOWN with four components, causing ImagingJpegDecode to write four-component scanlines into the two-byte tile buffer.

  2. Oct 20, 2026 · NIST NVD

    Updated

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow's FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_UNKNOWN with four components, causing ImagingJpegDecode to write four-component scanlines into the two-byte tile buffer.

  3. Oct 23, 2026 · GitHub Advisory Database

    Updated

    ### Credits **Researcher**: Alex Bouffard (mixbo@pebwalker.com) ### Summary A heap buffer overflow in Pillow's FlashPix (FPX) JPEG-tile decoder lets an attacker achieve arbitrary code execution by getting an application to open a single crafted file with . The file is recognized by content (the OLE2 magic), not by extension, so any service that opens or thumbnails untrusted uploads with the option

  4. Oct 26, 2026 · PyPA Advisory Database

    Fix available

    pillow fixed in 13.0.0

  5. Oct 26, 2026 · PyPA Advisory Database

    Fix available

    pillow fixed in 13.0.0

  6. Oct 26, 2026 · PyPA Advisory Database

    Updated

    ### Credits **Researcher**: Alex Bouffard (mixbo@pebwalker.com) ### Summary A heap buffer overflow in Pillow's FlashPix (FPX) JPEG-tile decoder lets an attacker achieve arbitrary code execution by getting an application to open a single crafted file with . The file is recognized by content (the OLE2 magic), not by extension, so any service that opens or thumbnails untrusted uploads with the option

  7. Oct 28, 2026 · PyPA Advisory Database

    Updated

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow's FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_UNKNOWN with four components, causing ImagingJpegDecode to write four-component scanlines into the two-byte tile buffer.

Sources

  • CVE.orgVulnerability recordCVE-2026-112398

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-112398

    30-day exploitation probability 0.70%

    first.org
  • GitHub Advisory DatabasePackage advisoryGHSA-5x8w-8jj5-q52h

    GitHub Advisory Database record mirrored by OSV.

    github.com
  • GitLab Advisory DatabasePackage advisoryCVE-2026-112398

    A heap buffer overflow in Pillow's FlashPix (FPX) JPEG-tile decoder lets an attacker achieve arbitrary code execution by getting an application to open a single crafted file with Image.open(). The file is recognized by content (the OLE2 magic), not by extension, so any service that opens or thumbnails untrusted uploads with the optional olefile dependency installed is reachable with no user intera

    advisories.gitlab.com
  • NIST NVDVulnerability recordCVE-2026-112398

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow's FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_

    nvd.nist.gov
  • OpenSSF OSV / OSV ScannerPackage advisoryBIT-pillow-2026-112398

    Pillow: Heap buffer overflow in FlashPix (FPX) JPEG decoding leads to code execution

    osv.dev
  • PyPA Advisory DatabasePackage advisoryGHSA-5x8w-8jj5-q52h

    Pillow: Heap buffer overflow in FlashPix (FPX) JPEG decoding leads to code execution

    osv.dev
  • PyPA Advisory DatabasePackage advisoryPYSEC-2026-4330

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow's FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_

    osv.dev

References

Freshness

Last verified in this catalog Oct 31, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • FIRST EPSSOct 31, 2026
  • GitHub Advisory DatabaseOct 29, 2026
  • OpenSSF OSV / OSV ScannerOct 29, 2026
  • PyPA Advisory DatabaseOct 28, 2026
  • PyPA Advisory DatabaseOct 28, 2026
  • GitLab Advisory DatabaseOct 27, 2026
  • CVE.orgOct 21, 2026
  • NIST NVDOct 21, 2026