Cloudanix VulnDB

CVE-2026-42309

Medium · 5.5

CVSS

5.5

EPSS

0.2%

Published

May 9, 2026

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A widely used image-processing library can be crashed by malformed drawing coordinates, so affected applications should be updated to prevent service interruptions.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Buffer Overflow
Remediation
Upgrade
Effort
Medium
Patch risk
Medium

What it actually does

CVE-2026-42309 is a heap buffer overflow in Pillow versions 11.2.1 through 12.1.x. APIs that accept coordinate sequences, including ImagePath.Path, ImageDraw.ImageDraw.polygon, and ImageDraw.ImageDraw.line, incorrectly recursively unpack nested lists and can write beyond the allocated coordinate buffer. The primary demonstrated impact is process instability or denial of service in Python applications that pass attacker-controlled coordinate data into affected Pillow drawing/path APIs. The published CVSS vector indicates low availability impact and no confirmed confidentiality or integrity impact.

Why it matters to the business

Applications, services, data-processing jobs, or automation pipelines that use affected Pillow versions to process untrusted or semi-trusted image drawing coordinates may crash unexpectedly, causing failed image generation, interrupted batch processing, degraded service reliability, or denial of service. The current public exploitation signal is low: EPSS is 0.00133 with no 30-day increase, it is not in CISA KEV, is not associated with ransomware use, and no mature public exploit is reported. However, Pillow is widely used in Python ecosystems, so organizations should still patch during normal dependency maintenance, especially for internet-facing services or user-driven image workflows.

How an attack unfolds

An attacker must find an application path where input they control is transformed into coordinate lists passed to vulnerable Pillow APIs such as ImagePath.Path, ImageDraw.ImageDraw.polygon, or ImageDraw.ImageDraw.line. They then supply specially crafted nested list structures instead of a flat sequence of numeric coordinate pairs. In affected versions, Pillow recursively unpacks those nested lists beyond the buffer size allocated for coordinates, causing heap memory corruption. In realistic exploitation, this is most likely to crash the Python process, worker, or job handling the request, producing a denial-of-service condition. There is no currently reported evidence that this issue is being exploited in the wild or that reliable code execution has been demonstrated.

How to fix it

Upgrade Pillow to version 12.2.0 or later wherever it is installed. Pin the dependency explicitly in application manifests and rebuild containers, virtual environments, serverless packages, and offline job images that vendor Python dependencies. If immediate upgrade is not possible, validate all coordinate inputs before passing them to Pillow: require each coordinate to contain exactly two numeric values, reject nested lists, and impose reasonable size limits on coordinate arrays. Also isolate image-processing workloads with process supervision, memory limits, request timeouts, and worker restarts to reduce the impact of crashes.

How to confirm the fix worked

Confirm that all runtime environments use Pillow 12.2.0 or later. For Python environments, check with commands such as `python -m pip show Pillow`, `python -m pip freeze | grep -i '^Pillow=='`, or dependency scanners that inspect lockfiles, containers, and deployed artifacts. Review dependency manifests such as requirements.txt, pyproject.toml, poetry.lock, Pipfile.lock, conda environment files, and container SBOMs for Pillow versions from 11.2.1 up to but not including 12.2.0. Validate the fix functionally by exercising image drawing code with malformed nested coordinate lists and confirming the application rejects the input cleanly rather than crashing. For exposure validation, search code for use of `ImagePath.Path`, `ImageDraw.ImageDraw.polygon`, `ImageDraw.ImageDraw.line`, `ImageDraw.Draw(...).polygon`, and `ImageDraw.Draw(...).line` where coordinates originate from requests, files, queues, user content, or external integrations.

Typical attack path

  1. Identify an application, API, file-processing workflow, or image-rendering feature that uses Pillow 11.2.1 through before 12.2.0.
  2. Determine whether user-controlled data can influence coordinate inputs passed to ImagePath.Path, ImageDraw.ImageDraw.polygon, ImageDraw.ImageDraw.line, or similar coordinate-accepting Pillow APIs.
  3. Submit crafted nested list coordinate structures rather than valid two-number coordinate pairs.
  4. Trigger recursive coordinate unpacking in the vulnerable Pillow code path.
  5. Cause heap buffer overflow and crash or destabilize the Python process, worker, container, or batch job handling the input.
  6. Repeat requests if needed to create sustained denial of service or operational disruption.

How to detect it

There are no unique public indicators proving exploitation of this vulnerability. To assess whether exploitation may have occurred, review application logs, web/API gateway logs, job-runner logs, container orchestration events, and crash telemetry for crashes or restarts in Python services that use Pillow drawing/path functionality. Look for segmentation faults, heap corruption messages, abnormal worker exits, core dumps, repeated container restarts, and bursts of requests containing deeply nested array/list structures in fields used for drawing coordinates, polygons, paths, annotations, or line rendering. Correlate crashes with inbound requests, uploaded files, message-queue payloads, or API calls that introduced nested coordinate arrays. If core dumps are available, inspect whether the crashing stack references Pillow, PIL, ImageDraw, ImagePath, or coordinate parsing paths. Absence of such artifacts does not prove non-exploitation, because a crash may leave only generic process-failure evidence.

What your security team should do

  • Prioritize upgrading Pillow to 12.2.0 or later in all applications that process externally supplied images, drawings, annotations, vector-like data, or coordinate payloads.
  • Inventory Python applications, containers, notebooks, serverless functions, and batch jobs for Pillow versions 11.2.1 through 12.1.x.
  • Add dependency scanning or SBOM checks to CI/CD to block newly built artifacts that include vulnerable Pillow versions.
  • Ask engineering teams to validate coordinate inputs before calling Pillow drawing/path APIs, especially where input is derived from users, files, messages, or third-party services.
  • Monitor application and platform logs for Python worker crashes, segmentation faults, heap corruption errors, repeated restarts, and request patterns involving malformed coordinate payloads.
  • Use runtime containment for image-processing services, including worker isolation, memory limits, timeouts, rate limits, and automatic restart policies.
  • Because EPSS is low, KEV status is false, and no mature exploit is reported, handle this as a routine but broad dependency patch unless the affected workflow is internet-facing or business-critical, in which case accelerate remediation.

The record

Pillow is a Python imaging library. From version 11.2.1 to before version 12.2.0, passing nested lists as coordinates to APIs that accept coordinates such as ImagePath.Path, ImageDraw.ImageDraw.polygon and ImageDraw.ImageDraw.line could cause a heap buffer overflow, as nested lists were recursively unpacked beyond the allocated buffer. Coordinate lists are now validated to contain exactly two numeric coordinates. This issue has been patched in version 12.2.0.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities