Skip to main content

Pillow CVE-2026-42308

| EUVDEUVD-2026-28900 MEDIUM
Integer Overflow or Wraparound (CWE-190)
2026-05-04 https://github.com/python-pillow/Pillow GHSA-wjx4-4jcj-g98j
5.1
CVSS 4.0 · Vendor: https://github.com/python-pillow/Pillow
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Attacker crafts malicious font file
  2. Delivery
    Provides font to vulnerable application
  3. Exploit
    Application loads font via Pillow
  4. Install
    Pillow accumulates glyph advance values
  5. C2
    Integer overflow in position tracking
  6. Execute
    Memory corruption or crash
  7. Impact
    Denial of service or code execution

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The vulnerability requires that the target application uses Pillow to process or render fonts supplied by or influenced by an attacker. Specifically, the application must call Pillow's font rendering functions (such as ImageDraw.text() or ImageFont methods) with a maliciously crafted font file containing glyphs with excessively large advance values. The overflow occurs during the glyph position accumulation step, which happens automatically during any font rendering operation. No special Pillow configuration or non-default settings are required-the vulnerable code path is active in all standard rendering operations. However, exploitation is limited to applications that accept fonts from untrusted sources; applications that use only built-in or pre-validated fonts are not at risk.

Impact

Risk is moderate to high despite absent CVSS scoring. The attack vector is network-accessible (remote attacker can provide a malicious font file), attack complexity is low (requires only a crafted font, not special conditions), and privileges required are none (any application using Pillow can be targeted). However, exploitation requires the victim application to actively process or render the malicious font, limiting the attack surface. EPSS and KEV status are not provided, so active exploitation cannot be confirmed. The integer overflow can lead to memory corruption, denial of service, or potentially arbitrary code execution depending on how overflowed position values are used in subsequent rendering operations. The fix exists and is released (version 12.2.0), reducing urgency for patched deployments but creating risk for outdated installations. Applications that process user-supplied fonts (image processing APIs, font rendering services, PDF generators using Pillow) face elevated risk.

Exploit ScenarioDerived

An attacker crafts a malicious TrueType font file with a glyph whose advance value is set to a very large integer (e.g., 0x7FFFFFFF on 32-bit systems). This font is then provided to a web service that uses Pillow to render text or generate images from user input-such as a dynamic image generator, document converter, or font preview tool. When the application attempts to render text using this font, Pillow's position-tracking logic accumulates the oversized advance value, triggering an integer overflow that corrupts the heap or stack, leading to a crash (denial of service) or potentially code execution if memory is carefully controlled by the attacker.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 04, 2026

Integer overflow in Pillow's font glyph processing allows remote code execution or denial of service when handling maliciously crafted fonts with extremely large glyph advance values. Pillow versions before 12.2.0 are affected. The vulnerability is triggered during font rendering operations where position tracking accumulates glyph advances without proper bounds checking, leading to wraparound arithmetic that can corrupt memory or crash the interpreter.

RemediationAI

Upgrade Pillow to version 12.2.0 or later immediately. This is the vendor-released patch that resolves the integer overflow. Run 'pip install --upgrade pillow>=12.2.0' to update existing installations. For applications that cannot upgrade immediately, implement input validation to reject fonts with unusually large glyph advance values before passing them to Pillow's rendering functions. Additionally, restrict font file sources to trusted origins and disable automatic font processing for untrusted user inputs. If using Pillow in a containerized environment, rebuild container images with the patched version and redeploy. Monitor application logs for font processing errors or crashes that may indicate exploitation attempts.

Affected VersionsENISA

Pillow < 12.2.0

Affected Packages

pypi pillow fix: 12.2.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Pillow is a Python Imaging Library that processes fonts and renders text. When rendering glyphs from a TrueType or OpenType font, the library tracks the current horizontal position by accumulating the advance width of each glyph. The vulnerability exists in this position-tracking logic: if a single glyph's advance value is extremely large (close to or exceeding the maximum value of a signed integer), adding it to the current position causes an integer overflow. On systems using 32-bit integers, this overflow wraps the position to a negative or small positive value, corrupting subsequent memory writes or reads during glyph rendering. The root cause is improper input validation and lack of bounds checking before arithmetic operations on font metrics (CWE-190: Integer Overflow or Wraparound).

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/python-pillow/Pillow) PRIMARY 5.1 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
SUSE 5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Red Hat 6.2 MEDIUM

Primary rating from Vendor (https://github.com/python-pillow/Pillow).

CVSS VectorVendor: https://github.com/python-pillow/Pillow

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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 has been fixed.

Threat Intelligence Overview

EPSS Score
0.0%
Top 97% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy