HIGH 7.5

CVE-2026-54060: Pillow Font Memory Exhaustion (CVSS 7.5)

Pillow, a widely-used Python library for image manipulation, contains a vulnerability in how it processes font files. When converting fonts to bitmap format, the library can be tricked into allocating excessive memory without proper safety checks, causing the application to consume resources uncontrollably and crash. This affects Pillow versions before 12.3.0. An attacker can exploit this by providing a specially crafted font file to any application using Pillow, requiring no special privileges or user interaction.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-789
Affected products
1 configuration(s)
Published / Modified
2026-07-06 / 2026-07-07

NVD description (verbatim)

Pillow is a Python imaging library. Prior to 12.3.0, PIL/FontFile.py FontFile.compile() assembled per-glyph images into a combined bitmap with Image.new("1", (xsize, ysize)) without calling Image._decompression_bomb_check(), allowing a font to trigger excessive allocation during conversion or saving. This issue is fixed in version 12.3.0.

4 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-54060 is a resource exhaustion vulnerability in Pillow's FontFile.compile() function. During font-to-bitmap conversion, the function calls Image.new("1", (xsize, ysize)) to assemble per-glyph images into a combined bitmap without invoking Image._decompression_bomb_check(). This check is the library's built-in defense against decompression bombs and excessive memory allocation. A malicious font file can specify extremely large xsize or ysize dimensions, causing Image.new() to allocate excessive memory. The vulnerability exists in PIL/FontFile.py and is mapped to CWE-789 (uncontrolled memory allocation). Pillow version 12.3.0 fixes the issue by ensuring decompression bomb checks are performed before memory allocation.

Business impact

For organizations using Pillow in production—particularly those processing untrusted font files or running automated image/document conversion pipelines—this vulnerability introduces a denial-of-service (DoS) risk. Applications could crash or become unresponsive when processing adversarial fonts, disrupting services dependent on image rendering, PDF generation, or font handling. Web services, design automation tools, and document processors are especially vulnerable if they accept user-supplied fonts without validation.

Affected systems

Pillow versions prior to 12.3.0 are affected. This includes all 11.x releases and earlier 12.x versions. The vulnerability affects any application or service built with vulnerable Pillow versions, regardless of underlying OS (Linux, Windows, macOS) or deployment model (cloud, on-premise, containerized). Organizations should audit their Python environments and dependency lock files to identify Pillow usage.

Exploitability

This vulnerability is readily exploitable. The CVSS 3.1 score of 7.5 (HIGH) reflects an attack vector of Network, low attack complexity, no privilege requirement, and no user interaction needed. An attacker merely needs to provide a malformed font file to an application using Pillow—via email attachment, upload form, API parameter, or any other input mechanism. No special knowledge or tools are required; a crafted font file can be generated with basic image library functions. The vulnerability is not currently listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, but its simplicity and network accessibility make active exploitation likely as awareness spreads.

Remediation

Upgrade Pillow to version 12.3.0 or later. This is the primary and definitive remediation. Organizations should prioritize this upgrade given the HIGH severity rating and ease of exploitation. Before upgrading, test the new version in a staging environment to ensure compatibility with dependent applications and workflows.

Patch guidance

Apply Pillow 12.3.0 or any later patch release. Verify the upgrade by confirming the installed version: run `pip show Pillow` and confirm the version is 12.3.0 or higher. Update package management files (requirements.txt, poetry.lock, setup.py, etc.) to enforce the minimum version. For containerized deployments, rebuild images with the patched version and redeploy. For lock-file-based workflows, regenerate lock files to pull in the patched dependency. Test image and font processing workflows post-upgrade to validate functionality. No configuration changes or workarounds are necessary.

Detection guidance

Monitor for Pillow versions below 12.3.0 across your Python environments using Software Composition Analysis (SCA) tools, dependency scanning, or manual inventory. Search package indexes and runtime environments (pip freeze, pip list, Docker image scanning) for Pillow <12.3.0. Implement policy to alert on outdated Pillow versions. Monitor application logs for memory exhaustion errors, out-of-memory exceptions, or crashes during image/font processing—these may indicate exploitation attempts. In runtime security, watch for abnormal memory allocation spikes in Python processes handling image or font data. Network-based detection is difficult since the payload is an embedded font file; focus on supply chain and inventory controls.

Why prioritize this

This vulnerability warrants immediate attention despite not yet appearing in active exploitation records. The HIGH CVSS score (7.5), network-based attack vector, zero authentication requirement, and absence of user interaction make it attractive for both opportunistic and targeted attacks. Pillow's prevalence in image processing, document generation, and web services means numerous organizations are exposed. The fix is straightforward and low-risk, making rapid patching feasible.

Risk score, explained

The CVSS 3.1 score of 7.5 reflects a denial-of-service impact on availability with no effect on confidentiality or integrity. The attack vector is network-accessible, attack complexity is low, and no privileges or user interaction are required. This scoring accurately represents the practical risk: an unauthenticated remote attacker can crash or hang Pillow-dependent services by submitting a single malicious font file. The score appropriately elevates urgency given the ease of weaponization and broad potential impact.

Frequently asked questions

Can this be exploited without network access?

No, but 'network access' in this context means the attacker can send data to the vulnerable application—not necessarily that they must be on the internet. A local process receiving untrusted font files from a mounted share, API endpoint, or local import is still at risk. However, the vulnerability does not require physical machine access or local code execution privileges.

Does this affect Pillow installed via pip, conda, or other package managers?

Yes. Regardless of how Pillow is installed, any version prior to 12.3.0 is vulnerable. Check your installation method and upgrade it using the same method (pip, conda, etc.). If you use a requirements file or lock file, update the pinned version and reinstall.

What if we reject user-uploaded fonts at the application level?

Input validation can reduce risk, but it is not a reliable substitute for patching. A malicious font is difficult to detect through format inspection alone, and you may not have visibility into all font-handling code paths in your dependencies. Upgrade to 12.3.0 to enforce proper bounds checking at the library level.

Is there a CVSS temporal or environmental score adjustment we should apply?

The base CVSS is 7.5. No temporal factors (exploitability, remediation level, report confidence) are officially published for this CVE yet. Your organization's environmental score may be lower if Pillow is not used in your critical services, or higher if untrusted fonts are routinely processed. Tailor your remediation timeline accordingly, but prioritize patching across the board.

This analysis is provided for informational purposes and reflects publicly available information as of the publication date. SEC.co makes no warranty regarding the completeness or accuracy of third-party vendor advisories or patch availability. Organizations are responsible for validating patch applicability to their specific environments and for conducting thorough testing before deployment. The absence of a CVE from CISA's KEV catalog does not imply reduced risk. Always consult the official Pillow security advisory and your vendor's guidance before making remediation decisions. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).