---
id: CVE-2026-112401
title: 'Pillow: Quadratic GIF comment concatenation allows DoS in Image.open()'
summary: >-
  Pillow is a Python imaging library. From 5.4.0 until 13.0.0, Pillow performs
  quadratic copying while parsing GIF comments. GifImageFile._seek() repeatedly
  appends immutable bytes for comment sub-blocks and multiple comment
  extensions, an…
severity: medium
cvss: 6.9
cvssVector: 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N'
cvssSource: cna
cwe:
  - CWE-407
vendor: python-pillow
product: Pillow
affected:
  - 'Pillow >= 5.4.0, < 13.0.0'
published: '2026-10-19'
updated: '2026-10-19'
sourceUpdated: '2026-10-19T21:15:21.484Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-112401'
references:
  - url: >-
      https://github.com/python-pillow/Pillow/security/advisories/GHSA-74r2-7ff9-mjj2
    label: >-
      https://github.com/python-pillow/Pillow/security/advisories/GHSA-74r2-7ff9-mjj2
  - url: >-
      https://github.com/python-pillow/Pillow/commit/68a3fe957d8a4d552e8c69d96066d749f0614c7e
    label: >-
      https://github.com/python-pillow/Pillow/commit/68a3fe957d8a4d552e8c69d96066d749f0614c7e
  - url: 'https://github.com/python-pillow/Pillow/releases/tag/13.0.0'
    label: 'https://github.com/python-pillow/Pillow/releases/tag/13.0.0'
tags:
  - cve.org
ingestedAt: '2026-10-19T21:43:56.127Z'
---

## Overview

Pillow is a Python imaging library. From 5.4.0 until 13.0.0, Pillow performs quadratic copying while parsing GIF comments. GifImageFile._seek() repeatedly appends immutable bytes for comment sub-blocks and multiple comment extensions, and frame zero is parsed during Image.open(). An attacker can submit a small-dimension GIF containing many comment extensions to any application that opens the file. This can consume excessive CPU and deny service before the application can inspect the image. This issue is fixed in version 13.0.0.

## Affected

- `Pillow >= 5.4.0, < 13.0.0`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
