Buffer Overflow Vulnerability in Pillow (CVE-2020-5311)

py3-pillow Updated 02 Oct 2025

Summary

03/01/2020
N/A
Yes i
Critical
9.8

CVE-2020-5311: libImaging/SgiRleDecode.c in Pillow before 6.2.2 has an SGI buffer overflow. Affects py3-pillow across 2 version ranges.

< 6.2.2-r0 < a79b65c47c7dc6fe623aadf09aa6192fc54548f3

Fixed in 6.2.2-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Pillow is an open-source Python imaging library that provides support for opening, manipulating, and saving many different image file formats. It is widely used in various applications for image processing and manipulation. However, Pillow versions before 6.2.2 are vulnerable to a buffer overflow in the SGI RLE decoding functionality.

Vulnerability Detail

The vulnerability (CVE-2020-5311) originates from a buffer overflow in the libImaging/SgiRleDecode.c file of the Pillow library. This buffer overflow can be exploited by an attacker to execute arbitrary code or cause a denial-of-service condition. The vulnerability has a CVSS v3 score of 9.8, indicating its high severity. It affects all versions of Pillow prior to 6.2.2.

How To Fix

Minimum fixed version

6.2.2-r0

This is the first release that contains the fix.

sudo apk add --upgrade py3-pillow

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is crucial to update to the fixed version of Pillow to mitigate the risk of exploitation.

Conclusion

In conclusion, the buffer overflow vulnerability (CVE-2020-5311) in Pillow can lead to arbitrary code execution or denial-of-service attacks. It is crucial to update to version 6.2.2 or later to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for py3-pillow →

Share this vulnerability

FAQ

Pillow is a popular Python imaging library used for image processing and manipulation.

The vulnerability allows an attacker to execute arbitrary code or cause a denial-of-service condition.

To fix this vulnerability, update Pillow to version 6.2.2 or later.

No, there is no known workaround for this vulnerability.

The CVSS v3 score of this vulnerability is 9.8, indicating its high severity.

Related vulnerabilities

Recent vulnerabilities recorded for py3-pillow.

How To Fix

Minimum fixed version

6.2.2-r0

This is the first release that contains the fix.

sudo apk add --upgrade py3-pillow

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback