Cloudanix VulnDB

CVE-2016-2533

Medium · 6.5

CVSS

6.5

EPSS

4.0%

Published

Apr 13, 2016

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A malicious image file can crash systems that use outdated image-processing software.

Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw is a buffer overflow in the PhotoCD image decoding path, specifically the ImagingPcdDecode function in PcdDecode.c in Pillow versions before 3.1.1 and legacy Python Imaging Library (PIL) 1.1.7 and earlier. When a crafted PhotoCD file is parsed, the decoder can corrupt process memory and crash the application. The published impact is availability loss; confidentiality and integrity impact are not established for this issue. The CVSS vector requires user or application interaction because exploitation occurs when a vulnerable application processes the malicious image file.

Why it matters to the business

Applications, batch jobs, web services, media pipelines, or document-processing workflows that accept or transform image files can be crashed by a specially crafted PhotoCD image, causing service disruption, failed uploads, job backlogs, or degraded customer-facing functionality. This is an older vulnerability with no CISA KEV listing, no known ransomware association, and low-to-moderate EPSS, but it remains relevant where legacy Pillow/PIL or affected downstream packages are still present in long-lived systems or container images.

How an attack unfolds

An attacker creates a malformed PhotoCD image designed to trigger the vulnerable decoder. They then deliver it to a system that uses Pillow/PIL for image parsing, such as an upload form, email/document ingestion workflow, thumbnail generator, content management system, or automated media conversion service. When the application attempts to open or decode the file, control reaches ImagingPcdDecode in the vulnerable library. The decoder writes beyond the intended buffer, corrupting memory and typically terminating the process. In a web or worker service, this may kill the request handler, worker process, or batch job; repeated submissions can create a denial-of-service condition.

How to fix it

Upgrade Pillow to version 3.1.1 or later wherever it is used. Legacy PIL should be removed or replaced with a maintained Pillow release, because PIL 1.1.7 and earlier are no longer suitable for security-sensitive use. Rebuild application containers and redeploy services so the fixed library is actually present at runtime. For the supplied Alpine package records, ensure libcroco on Alpine v3.10 and v3.11 is updated to 0.6.13-r1 or later if that package is present in the affected image or host package set. As compensating controls, restrict accepted image formats, reject PhotoCD files if not required, scan uploads before processing, isolate image-processing workers, enforce process memory limits, and run parsers in low-privilege sandboxes.

How to confirm the fix worked

Confirm the runtime library versions, not only source manifests. For Python environments, check installed packages with commands such as `pip show Pillow`, `pip freeze`, or environment-specific software composition analysis tooling, and verify Pillow is 3.1.1 or later and legacy PIL is absent. For Alpine-based images or hosts that include the listed package records, check `apk info -v libcroco` and verify version 0.6.13-r1 or later. Rebuild and rescan container images, virtual environments, and deployment artifacts after patching. Review application configuration to confirm PhotoCD handling is disabled or blocked if the format is not business-required. In a test environment, validate that malformed or unsupported PhotoCD inputs are rejected safely and do not crash the image-processing process.

Typical attack path

  1. Identify an application or workflow that accepts user-supplied image files or processes images from untrusted sources.
  2. Prepare a crafted PhotoCD file that exercises the vulnerable Pillow/PIL PhotoCD decoding code path.
  3. Submit the file through an upload endpoint, email attachment, shared folder, API, or other ingestion mechanism.
  4. Wait for the application, worker, or image conversion service to parse the PhotoCD file.
  5. Trigger memory corruption in the decoder, causing the process to crash or become unstable.
  6. Repeat delivery to cause persistent service disruption if automatic restart or retry mechanisms are in place.

How to detect it

Look for evidence that untrusted PhotoCD files were processed shortly before application crashes. Useful sources include web and API access logs, upload service logs, object storage audit logs, mail gateway logs, image-processing worker logs, container restart events, systemd or supervisor logs, kernel crash messages, core dump records, and application error tracking. Correlate uploads or file-processing events involving `.pcd` or PhotoCD files with segmentation faults, worker exits, container restarts, or Python image library exceptions. In Linux environments, review `/var/log/syslog`, `/var/log/messages`, `journalctl`, container runtime logs, Kubernetes pod restart history, and coredump metadata for crashes in Python, web worker, thumbnailer, or conversion processes. If core dumps are available, inspect stack traces for Pillow/PIL PhotoCD decoder symbols such as `ImagingPcdDecode` or `PcdDecode.c`. Because there are no widely established public exploitation indicators for this issue, detection should focus on suspicious file submissions followed by parser crashes or repeated denial-of-service patterns.

  • .pcd
  • PhotoCD
  • ImagingPcdDecode
  • PcdDecode.c
  • PIL.PcdImagePlugin
  • PcdImagePlugin.py
  • Segmentation fault
  • segfault
  • core dumped
  • Fatal Python error
  • worker exited unexpectedly
  • container restarted
  • CrashLoopBackOff
  • Pillow
  • Python Imaging Library

What your security team should do

  • Inventory applications, containers, and batch jobs that use Pillow, PIL, or distro-packaged image parsing libraries to process untrusted files.
  • Prioritize remediation for internet-facing upload services, automated media processing pipelines, email/document ingestion systems, and multi-tenant workloads.
  • Upgrade Pillow to 3.1.1 or later and remove legacy PIL from all supported environments.
  • For Alpine v3.10 and v3.11 package sets containing libcroco, update to 0.6.13-r1 or later where applicable.
  • If PhotoCD support is unnecessary, block `.pcd` files and PhotoCD content at upload, API gateway, mail gateway, or preprocessing layers.
  • Run image-processing workloads with least privilege, resource limits, crash isolation, and automatic quarantine of files that cause parser failures.
  • Search historical logs and crash telemetry for image-processing crashes correlated with PhotoCD uploads or files from untrusted users.
  • Add regression tests and dependency scanning policies to prevent reintroduction of obsolete PIL or vulnerable Pillow versions.

The record

Buffer overflow in the ImagingPcdDecode function in PcdDecode.c in Pillow before 3.1.1 and Python Imaging Library (PIL) 1.1.7 and earlier allows remote attackers to cause a denial of service (crash) via a crafted PhotoCD file.

Affected packages

Ecosystem Package Introduced Fixed
PyPI pillow 0 3.1.1
Debian:11 pillow 0 3.1.1-1
Debian:12 pillow 0 3.1.1-1
Debian:13 pillow 0 3.1.1-1
Debian:14 pillow 0 3.1.1-1
Debian:6.0 python-imaging 0 1.1.7-2+deb6u2
Debian:8 pillow 0 2.6.1-2+deb8u2
SUSE:Enterprise Storage 4 python-Pillow 0 2.8.1-4.9.1
SUSE:Enterprise Storage 5 python-Pillow 0 2.8.1-3.6.1
SUSE:OpenStack Cloud 7 python-Pillow 0 2.8.1-4.9.1
Ubuntu:14.04:LTS pillow 0 2.3.0-1ubuntu3.2
Ubuntu:16.04:LTS pillow 0 3.1.1-1
pypi PIL 0.0.0a No fix

Related vulnerabilities