CVE-2026-96641
Medium · 6.5CVSS
6.5
EPSS
0.3%
Published
Oct 21, 2026
CISA due date
—
Cloudanix analysis
A flaw in a popular Python image library can let specially crafted text cause incorrect size calculations that may crash or slow down programs using the library.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Signed integer overflow in PILfont text-width accumulation (xsize += dx) in src/_imaging.c allows a large positive width value to be computed from repeated negative glyph advances, bypassing size checks intended for positive advances only.
Why it matters to the business
Applications performing text measurement or layout with untrusted fonts or content may encounter incorrect allocation sizes, logic errors in quota or serialization logic, or excessive resource use, potentially leading to degraded service or application instability.
How an attack unfolds
An attacker supplies a font or text layout containing repeated negative 16-bit advances of -32768 to trigger repeated addition that overflows a signed 32-bit integer, resulting in a large positive width; downstream code using getlength, getsize, or derived calculations then operates on the malformed size while decompression-bomb protections on mask paths remain ineffective against this vector.
How to fix it
Upgrade Pillow to version 13.0.0 or later. Where immediate upgrade is not possible, restrict untrusted font or text input to measurement APIs and apply input sanitization or size limits before calling getlength or getsize.
How to confirm the fix worked
Confirm Pillow version 13.0.0 or newer is installed via pip show or package metadata; re-run unit tests covering negative glyph advances and verify that overflow no longer produces unexpectedly large positive widths.
Typical attack path
- Identify an application endpoint or API that accepts user-controlled fonts, text strings, or layout parameters and invokes Pillow text measurement functions.
- Craft input containing glyphs with repeated signed 16-bit negative advances of -32768.
- Trigger repeated accumulation in xsize += dx to produce integer overflow and large positive width.
- Observe or leverage resulting logic-integrity errors or resource consumption in allocation, quota, or layout calculations.
How to detect it
Review application logs for unusually large computed text widths or allocation requests originating from Pillow text functions; monitor for process crashes or high CPU/memory usage correlated with font or text processing.
What your security team should do
- Prioritize upgrade to Pillow 13.0.0 across all environments within the next 30 days given public disclosure.
- Inventory Python applications and libraries that depend on Pillow text layout functions and schedule patching.
- Implement temporary input validation or sandboxing for any public-facing text rendering endpoints until upgrades complete.
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-119340 Tesseract is an open source OCR engine. CWE-190
- CVE-2026-61694 go-xrpl is a Go implementation of the XRP Ledger protocol. CWE-190
- CVE-2026-119729 A flaw was found in GStreamer. CWE-190
- CVE-2026-119719 Blender before 4.5.15 and 5.x before 5.2.3 contains a heap buffer overflow vulnerability… CWE-190
- CVE-2026-119718 Blender before 4.5.15 and 5.x before 5.2.3 contains a heap buffer overflow vulnerability… CWE-190
- CVE-2026-104064 Scribus before 1.6.7 contains an integer overflow vulnerability in the… CWE-190
- CVE-2026-116366 An issue has been discovered in ClickHouse Server that, under certain conditions, could… CWE-190
- CVE-2026-114691 A flaw was found in the libstdc++ component of GCC. CWE-190