PyPI: pillow

CVE-2026-112893

Safety vulnerability ID: SFTY-20261021-31867

Affected versions of the Pillow package are vulnerable to Use of Uninitialized Variable due to the FreeType glyph rendering code failing to initialize the `glyph` pointer before use. In `src/_imagingft.c`, the `glyph` variable declared at line 848 is not set to NULL, and the measurement loop can jump to the `glyph_error` cleanup label before `glyph` is ever assigned a valid value; additionally, in the render loop the pointer is not reset to NULL after each call to `FT_Done_Glyph`, leaving a stale reference that is freed again whenever a stroker is active. An attacker can exploit this by supplying a malformed font file (via `ImageFont.truetype`) containing a glyph with an invalid contour count that forces `FT_Load_Glyph` to fail, causing Pillow to call `FT_Done_Glyph` on an uninitialized or stale pointer when rendering text with a non-zero `stroke_width`, resulting in an invalid or double free that can crash the application or potentially be leveraged for further memory corruption.

Created at: Oct 22, 2026Updated at: Oct 22, 2026

Overview

Pillow: Invalid free in FreeType glyph rendering when a stroker is active

Advisory

pillow – Use of Uninitialized Variable

Affected Package

Affecting pillow package, versions>= 10.0.0, < 13.0.0

Also affects

---

How to Fix

Upgradepillowto13.0.0or 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