Description
Pillow is a Python imaging library. Prior to 13.0.0, PILfont text-width accumulation in src/_imaging.c checks positive glyph advances against INT_MAX but does not check negative advances against INT_MIN. Repeating a signed 16-bit advance of -32768 can therefore execute a signed C integer overflow in xsize += dx, producing a large positive width from a negative mathematical result. Applications that use getlength(), getsize(), or derived layout, quota, serialization, or allocation calculations can experience logic-integrity errors or resource consumption, while the high-level mask path commonly retains a decompression-bomb check. This issue is fixed in version 13.0.0.
Published: 2026-10-21
Score: 6.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service or Logic Integrity Compromise
Action: Patch Now
AI Analysis

Impact

Pillow is a Python imaging library that calculates text widths by adding signed glyph advance values to a cumulative size. The implementation checks that a glyph’s advance is not greater than the maximum positive 32‑bit integer, but it fails to verify that a negative advance does not fall below the minimum negative 32‑bit integer. When an attacker repeatedly supplies the signed 16‑bit value –32768, the addition overflows, producing a large positive result from a negative mathematical value. This integer overflow can affect any Pillow API that reports text dimensions, such as getlength() or getsize(), and can be used to break layout, quota, or allocation logic, leading to resource exhaustion or incorrect behavior. The high‑level mask path in Pillow preserves a decompression‑bomb check, so the overflow is not mitigated there.

Affected Systems

Python software that depends on the Pillow imaging library, particularly versions prior to 13.0.0 of Pillow.

Risk and Exploitability

The vulnerability has a CVSS score of 6.5, indicating moderate severity. No EPSS score is available, and the issue is not currently listed in the CISA Known Exploited Vulnerabilities catalog. Because the flaw requires specific controlled glyph advances, an attacker must supply crafted image data that exercises the vulnerable code path. From the description, the most likely attack vector is through processing user‑supplied images; an attacker could embed a file that forces the overflow, then trigger an API that reads the corrupted width. If the vulnerability is exploited in a high‑traffic application, the resulting logic integrity error could lead to denial of service or corruption of downstream data structures.

Generated by OpenCVE AI on October 22, 2026 at 06:01 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Pillow library to version 13.0.0 or later, which removes the unchecked negative glyph advance.
  • Ensure that any downstream code validates image dimensions or limits allocated buffers before performing size calculations.
  • Apply strict input sanitization for image files, rejecting or restricting files that contain unusually large or negative advance values, to mitigate accidental exploitation.

Generated by OpenCVE AI on October 22, 2026 at 06:01 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-4rm8-3hmm-39fg Pillow: Reachable undefined behavior in native integer operations, potentially leading to denial of service or logic integrity compromise
History

Wed, 28 Oct 2026 02:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 27 Oct 2026 14:45:00 +0000

Type Values Removed Values Added
First Time appeared Python
Python pillow
CPEs cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*
Vendors & Products Python
Python pillow

Thu, 22 Oct 2026 12:30:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Moderate


Thu, 22 Oct 2026 04:45:00 +0000

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow

Wed, 21 Oct 2026 21:00:00 +0000

Type Values Removed Values Added
Description Pillow is a Python imaging library. Prior to 13.0.0, PILfont text-width accumulation in src/_imaging.c checks positive glyph advances against INT_MAX but does not check negative advances against INT_MIN. Repeating a signed 16-bit advance of -32768 can therefore execute a signed C integer overflow in xsize += dx, producing a large positive width from a negative mathematical result. Applications that use getlength(), getsize(), or derived layout, quota, serialization, or allocation calculations can experience logic-integrity errors or resource consumption, while the high-level mask path commonly retains a decompression-bomb check. This issue is fixed in version 13.0.0.
Title Pillow: Reachable undefined behavior in native integer operations, potentially leading to denial of service or logic integrity compromise
Weaknesses CWE-190
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H'}


Subscriptions

Python Pillow
Python-pillow Pillow
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-28T01:50:42.160Z

Reserved: 2026-09-23T14:35:50.130Z

Link: CVE-2026-96641

cve-icon Vulnrichment

Updated: 2026-10-28T01:50:34.397Z

cve-icon NVD

Status : Analyzed

Published: 2026-10-21T21:20:32.500

Modified: 2026-10-28T02:17:08.123

Link: CVE-2026-96641

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-21T20:51:24Z

Links: CVE-2026-96641 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-22T06:15:11Z

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound