PyPI: pillow

CVE-2026-42308

Safety vulnerability ID: SFTY-20260504-37305

Affected versions of the Pillow package are vulnerable to Integer Overflow due to unchecked accumulation of glyph advance values while tracking the current rendering position during font processing. The `font` module fails to properly handle large glyph advance values, causing the running position counter to wrap around because the arithmetic is performed in a fixed-width integer type. A remote attacker who can supply a crafted font file to a target using Pillow's font rendering can trigger the overflow, leading to incorrect memory calculations and potential memory corruption.

Created at: Jun 8, 2026Updated at: Jun 8, 2026

Overview

Pillow has an integer overflow when processing fonts

Advisory

pillow – Integer Overflow or Wraparound

Affected Package

Affecting pillow package, versions
<12.2.0

Also affects

---

How to Fix

Upgrade
pillow
to
12.2.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more