CVE-2019-19911

7.5 HIGH

📋 TL;DR

CVE-2019-19911 is a denial-of-service vulnerability in Pillow's FpxImagePlugin that occurs when processing specially crafted FPX images. The vulnerability causes memory exhaustion by attempting to allocate excessive memory based on unvalidated input, leading to process termination via OOM killer on Linux or memory errors on Windows. Anyone using Pillow to process untrusted FPX images is affected.

💻 Affected Systems

Products:
  • Pillow (Python Imaging Library fork)
Versions: All versions before 6.2.2
Operating Systems: All platforms running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability manifests differently: Windows 32-bit Python shows OverflowError/MemoryError, Linux 64-bit Python triggers OOM killer. Requires FPX image processing.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service disruption through process termination, potentially affecting availability of applications that process user-uploaded images.

🟠

Likely Case

Denial of service affecting individual processes or services that handle FPX image uploads, requiring restart.

🟢

If Mitigated

Minimal impact if proper input validation and memory limits are in place, or if FPX format support is disabled.

🌐 Internet-Facing: MEDIUM - Exploitable via image upload functionality, but requires specific FPX format which is less common than other image formats.
🏢 Internal Only: LOW - Requires processing of malicious FPX images, which is unlikely in most internal workflows.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Simple to exploit by crafting malicious FPX images. Public proof-of-concept exists in vulnerability reports.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.2.2 and later

Vendor Advisory: https://pillow.readthedocs.io/en/stable/releasenotes/6.2.2.html

Restart Required: Yes

Instructions:

1. Update Pillow: pip install --upgrade pillow>=6.2.2
2. Restart all Python processes using Pillow
3. Verify no older versions remain in your environment

🔧 Temporary Workarounds

Disable FPX support

all

Remove or disable FPX image format support in Pillow configuration

Modify code to avoid using FpxImagePlugin or set environment variable to disable

Implement input validation

all

Validate image metadata before processing, reject images with suspicious band counts

🧯 If You Can't Patch

  • Implement strict file upload validation to reject FPX format images
  • Run vulnerable services with memory limits and automatic restart policies

🔍 How to Verify

Check if Vulnerable:

Check Pillow version: python -c "import PIL; print(PIL.__version__)" and compare to 6.2.2

Check Version:

python -c "import PIL; print('Pillow version:', PIL.__version__)"

Verify Fix Applied:

Confirm version is 6.2.2 or higher and test with known malicious FPX image sample

📡 Detection & Monitoring

Log Indicators:

  • Process termination logs
  • Out of memory errors
  • Python tracebacks showing OverflowError in FpxImagePlugin

Network Indicators:

  • Multiple FPX image uploads to vulnerable endpoints

SIEM Query:

Process termination events where process name contains 'python' and exit code indicates memory error

🔗 References

📤 Share & Export