CVE-2026-112390
Infinite loop in Pillow (7.2.0‑13.0.0) when processing crafted MIC images.
- CVSS 8.2
- CWE-835
- Resource Management
- Remote
Pillow is a Python imaging library. From 7.2.0 until 13.0.0, Pillow can enter an infinite loop while determining the frame count of a MIC image. MicImageFile inherits TIFF frame traversal, but MicImageFile.tell reports the OLE stream index and its seek() resets TIFF frame state, so an embedded TIFF with at least three IFDs never advances. When an application with olefile installed reads n_frames or saves all frames from a crafted MIC file, the non-advancing traversal can hold a worker at full CPU indefinitely. This issue is fixed in version 13.0.0.
- CWE
- CWE-835
- CVSS base score
- 8.2
- Published
- 2026-10-19
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Timing Issues
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- Pillow
- Fixed by upgrading
- Yes
Solution
Upgrade Pillow to version 13.0.0 or later.
Vulnerable code sample
from PIL import Image
def count_frames(path):
# VULNERABLE: calling n_frames on a crafted MIC triggers infinite loop
img = Image.open(path)
return img.n_framesPatched code sample
from PIL import Image
def count_frames(path):
# FIX: avoid n_frames on MIC by iterating with ImageSequence which safely stops
img = Image.open(path)
try:
from PIL import ImageSequence
return sum(1 for _ in ImageSequence.Iterator(img))
except Exception:
# fallback for non‑MIC images
return img.n_framesPublished fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Do not change MicImageFile _n_frames or is_animated in TiffImageFile (#10142) (python-pillow/Pillow)
src/PIL/TiffImagePlugin.py · TiffImageFile._open,src/PIL/TiffImagePlugin.py · TiffImageFile._seek,src/PIL/TiffImagePlugin.py · TiffImageFile.__init__
Cite this entry
@misc{vaitp:cve2026112390,
title = {{Infinite loop in Pillow (7.2.0‑13.0.0) when processing crafted MIC images.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-112390},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-112390/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
