Cloudanix VulnDB

CVE-2026-42308

Medium · 5.5

CVSS

5.5

EPSS

0.2%

Published

May 9, 2026

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in a common Python image library can let a specially crafted font-related file or request crash parts of an application until the library is updated.

Exploitation
Local Privilege
Attacker needs
None
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Pillow versions prior to 12.2.0 contain an integer overflow condition in font/glyph position tracking. When processing font data where glyph advance values are excessively large, Pillow can overflow the integer used to track the current drawing position. Based on the disclosed impact and CVSS availability-only scoring, the expected consequence is a crash, failed image/font rendering operation, or denial of service in the process using Pillow, rather than confirmed code execution or data compromise.

Why it matters to the business

Applications, services, batch jobs, or user-facing features that use Pillow to render text or process images with attacker-supplied fonts or font-influenced content may become unstable or unavailable when malformed input is processed. The overall public exploitation likelihood is currently low given the low EPSS score, no known exploited-in-the-wild status, and no reported exploit maturity, but Pillow is widely used in Python ecosystems, so organizations should still patch affected dependencies during normal maintenance, especially for services that process untrusted uploaded files or generate images on demand.

How an attack unfolds

An attacker needs a path that causes an affected Pillow version to render or measure text using font data with abnormally large glyph advance values. The attacker supplies a crafted font file, crafted document, image-generation request, or other input that influences the font used by the application. When the vulnerable Pillow code iterates over glyphs and updates the current drawing position, the excessive advance values cause an integer overflow. The resulting corrupted position calculation can cause the operation or process to fail, producing a denial-of-service condition for the affected worker, job, or application component. There is no current indication from the provided data that this vulnerability is being exploited by named threat actors, ransomware campaigns, or broad public exploit tooling.

How to fix it

Upgrade Pillow to version 12.2.0 or later wherever it is used. If exact package metadata is managed through Python dependency files, update direct and transitive Pillow pins in requirements.txt, pyproject.toml, Poetry, Pipenv, Conda, container images, and build artifacts, then rebuild and redeploy affected applications. If immediate upgrade is not possible, reduce exposure by rejecting untrusted font files, disabling user-supplied font selection, sandboxing image-processing workloads, enforcing file type and size limits, isolating worker processes, and applying execution time and memory limits around image/font rendering tasks.

How to confirm the fix worked

Confirm that all runtime and build environments resolve Pillow to 12.2.0 or later using package inventory, software composition analysis, and direct checks such as `python -m pip show Pillow` or `python -c "import PIL; print(PIL.__version__)"`. Verify that container images, serverless packages, virtual environments, CI build caches, and offline bundles no longer include vulnerable Pillow versions. Exercise representative image/text rendering workflows after upgrade to confirm application compatibility. For exposure validation, identify any code paths that call Pillow text rendering, font loading, ImageDraw, ImageFont, or document/image conversion routines using untrusted input.

Typical attack path

  1. Identify an application, API, worker, or automation pipeline that uses Pillow versions earlier than 12.2.0 for text rendering, font handling, thumbnail generation, or image composition.
  2. Find an input path where font data or text-rendering parameters can be influenced, such as uploaded files, user-selected fonts, document conversion, image generation, or templated image creation.
  3. Submit crafted font-related input containing glyphs with extremely large advance values.
  4. Trigger Pillow to process the crafted input and update glyph drawing positions.
  5. Cause integer overflow during position tracking, leading to a crash, failed render, or denial of service in the affected process.

How to detect it

Look for evidence of attempted or successful denial of service around image/font processing workflows. Useful sources include application logs, web/API access logs, file-upload logs, worker queue logs, container or process supervisor restart events, crash dumps, Python exception traces, APM error telemetry, and endpoint telemetry for repeated process termination. Investigate spikes in requests or jobs involving font uploads, image generation, document conversion, or text rendering followed by Pillow/PIL exceptions, segmentation faults, worker exits, out-of-bounds/overflow errors, or container restarts. Because no public exploitation artifacts or threat actor tradecraft are indicated in the provided data, detection should focus on behavioral patterns: malformed or unusual font files, repeated failed render jobs, crashes immediately after processing untrusted media, and repeated attempts from the same IP, account, session, or upload source.

  • PIL
  • Pillow
  • ImageFont
  • ImageDraw
  • FreeTypeFont
  • font.getlength
  • font.getbbox
  • textlength
  • textbbox
  • integer overflow
  • OverflowError
  • Segmentation fault
  • SIGSEGV
  • core dumped
  • worker exited
  • container restarted
  • Process exited with code 139
  • PIL.__version__ < 12.2.0

What your security team should do

  • Inventory Python applications, containers, automation jobs, and data pipelines that include Pillow, prioritizing internet-facing services and systems that process uploaded or externally supplied files.
  • Upgrade affected deployments to Pillow 12.2.0 or later and rebuild dependent artifacts rather than only changing source dependency files.
  • Prioritize services that permit user-controlled fonts, document conversion, dynamic image generation, avatar/banner rendering, CAPTCHA generation, or templated media creation.
  • Add or verify sandboxing, resource limits, queue isolation, and worker restart controls for image-processing components to contain denial-of-service attempts.
  • Review application logs and crash telemetry for unexplained Pillow, PIL, ImageFont, FreeType, or text rendering failures since publication, especially where they correlate with uploaded files or repeated requests from the same source.
  • Add dependency scanning gates to prevent reintroduction of Pillow versions earlier than 12.2.0.

The record

Pillow is a Python imaging library. Prior to version 12.2.0, if a font advances for each glyph by an exceeding large amount, when Pillow keeps track of the current position, it may lead to an integer overflow. This issue has been patched in version 12.2.0.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities