Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-112893 Overview
CVE-2026-112893 is a memory corruption vulnerability in Pillow, the widely used Python imaging library. The flaw affects versions 10.0.0 through 12.x and is fixed in version 13.0.0. During FreeType rendering with an active stroker, Pillow can free an invalid glyph pointer if FT_Load_Glyph fails. The cleanup path calls FT_Done_Glyph on an uninitialized or stale glyph variable, classified as a Use of Uninitialized Variable weakness [CWE-457]. An attacker who supplies a malformed font to an application that draws text with a nonzero stroke width can corrupt memory or crash the process.
Critical Impact
Processing untrusted font files in Pillow applications that render stroked text can trigger memory corruption or denial of service through an uninitialized glyph pointer.
Affected Products
- Python Pillow versions 10.0.0 through 12.x
- Applications embedding Pillow for text rendering with stroke width
- Python services accepting user-supplied TrueType or OpenType font files
Discovery Timeline
- 2026-10-19 - CVE-2026-112893 published to NVD
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-112893
Vulnerability Analysis
The vulnerability resides in src/_imagingft.c, which handles FreeType glyph rendering inside Pillow. When Pillow renders text with a nonzero stroke width, it creates a FreeType stroker and loads each glyph through FT_Load_Glyph. If that call fails for a crafted font, control transfers to a cleanup block that invokes FT_Done_Glyph on the local glyph variable. Because that variable was never initialized, FT_Done_Glyph operates on arbitrary stack contents. The resulting free of an attacker-influenced pointer can corrupt heap metadata or crash the Python process, depending on stack layout and allocator state.
Root Cause
The root cause is a missing initialization of the FT_Glyph glyph local variable before the error-handling path can access it. On the failing branch, glyph holds indeterminate data rather than a valid glyph pointer. The patch assigns NULL at declaration, allowing FT_Done_Glyph to safely handle the null case during cleanup.
Attack Vector
Exploitation requires an application that uses Pillow's ImageDraw text APIs with a stroke_width greater than zero, and that loads a font supplied by an attacker. The attacker submits a malformed TrueType or OpenType font that forces FT_Load_Glyph to fail. Any web service, document converter, thumbnail generator, or image pipeline that accepts user-controlled fonts over the network is reachable without authentication or user interaction.
int x_min, y_max; /* text offset in 26.6 precision */
int load_flags; /* FreeType load_flags parameter */
int error;
- FT_Glyph glyph;
+ FT_Glyph glyph = NULL;
FT_GlyphSlot glyph_slot;
FT_Bitmap bitmap;
FT_Bitmap bitmap_converted; /* initialized lazily, for non-8bpp fonts */
Source: GitHub Pillow Commit a7416de. The one-line patch initializes the glyph pointer to NULL so that the cleanup path cannot free uninitialized memory.
Detection Methods for CVE-2026-112893
Indicators of Compromise
- Unexpected crashes or segmentation faults in Python processes that render text with Pillow
- Glibc double-free or malloc assertion messages originating from processes invoking _imagingft
- Inbound uploads of unusual or malformed TrueType and OpenType font files to image-processing endpoints
Detection Strategies
- Inventory Python environments for installed Pillow versions less than 13.0.0 using pip show Pillow or SBOM data
- Audit application code for calls to ImageDraw.text or ImageDraw.multiline_text that pass a nonzero stroke_width with user-supplied fonts
- Monitor runtime logs for FreeType error returns correlated with worker process restarts
Monitoring Recommendations
- Alert on repeated crash signatures in image-processing services and font-rendering workers
- Capture and retain font files submitted to public endpoints for later triage and threat intelligence correlation
- Enable core dumps on image-processing hosts to confirm whether crashes trace back to FT_Done_Glyph
How to Mitigate CVE-2026-112893
Immediate Actions Required
- Upgrade Pillow to version 13.0.0 or later across all Python environments
- Rebuild and redeploy container images that pin Pillow to vulnerable 10.x, 11.x, or 12.x releases
- Restrict upload paths that accept arbitrary font files until the upgrade is complete
Patch Information
The fix is included in Pillow 13.0.0 via commit a7416de7f3a43128179d2cf68df3240ea8dafe13. See the GitHub Pillow Release 13.0.0 notes and GitHub Security Advisory GHSA-j4m9-6w36-pw47 for release and advisory details.
Workarounds
- Set stroke_width=0 on all ImageDraw text calls until Pillow can be upgraded
- Reject user-supplied fonts and restrict rendering to a vetted set of trusted font files
- Validate font files with a parser or allow-list before passing them to Pillow
# Upgrade Pillow to the patched release
pip install --upgrade "Pillow>=13.0.0"
# Verify the installed version
python -c "import PIL; print(PIL.__version__)"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

