Bug 1789535 (CVE-2020-5311) - CVE-2020-5311 python-pillow: out-of-bounds write in expandrow in libImaging/SgiRleDecode.c
Summary: CVE-2020-5311 python-pillow: out-of-bounds write in expandrow in libImaging/S...
Alias: CVE-2020-5311
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1789541 1789542 1799358 1799360 1799361
Blocks: 1789544
TreeView+ depends on / blocked
Reported: 2020-01-09 18:52 UTC by Pedro Sampaio
Modified: 2021-02-16 20:47 UTC (History)
19 users (show)

Fixed In Version: python-pillow 6.2.2
Doc Type: If docs needed, set a value
Doc Text:
An out-of-bounds write flaw was discovered in python-pillow in the way SGI RLE images are decoded. An application that uses python-pillow to decode untrusted images may be vulnerable to this flaw, which can allow an attacker to crash the application or potentially execute code on the system.
Clone Of:
Last Closed: 2020-02-21 03:49:44 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:0566 0 None None None 2020-02-20 22:16:51 UTC
Red Hat Product Errata RHSA-2020:0580 0 None None None 2020-02-24 12:56:45 UTC
Red Hat Product Errata RHSA-2021:0420 0 None None None 2021-02-04 16:14:21 UTC

Description Pedro Sampaio 2020-01-09 18:52:24 UTC
libImaging/SgiRleDecode.c in Pillow before 6.2.2 has an SGI buffer overflow.

Upstream patch:




Comment 1 Pedro Sampaio 2020-01-09 19:04:19 UTC
Created python-pillow tracking bugs for this issue:

Affects: fedora-all [bug 1789541]

Created python3-pillow tracking bugs for this issue:

Affects: epel-7 [bug 1789542]

Comment 2 Jason Shepherd 2020-01-10 02:23:56 UTC
While Red Hat Quay includes the python-pillow it's not used, therefore this issue is rated moderate for Red Hat Quay.

Comment 5 Riccardo Schirone 2020-02-06 14:45:56 UTC

This issue did not affect the versions of python-pillow and python-imaging as shipped with Red Hat Enterprise Linux 6, and 7 as they did not include the SGI RLE image decoder, where the flaw lies.

Comment 6 Riccardo Schirone 2020-02-06 14:54:48 UTC
Function expandrow() is called by ImagingSgiRleDecode() in SgiRleDecode.c to load and decode an input image. While reading compressed rows of the input image, expandrow() does not consider the image size, thus it is possible to overwrite past the end of the output buffer. This flaw could be used by an attacker to overwrite heap metadata and potentially execute code.

Comment 8 errata-xmlrpc 2020-02-20 22:16:49 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.0 Update Services for SAP Solutions

Via RHSA-2020:0566 https://access.redhat.com/errata/RHSA-2020:0566

Comment 9 Product Security DevOps Team 2020-02-21 03:49:44 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


Comment 10 errata-xmlrpc 2020-02-24 12:56:43 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2020:0580 https://access.redhat.com/errata/RHSA-2020:0580

Comment 11 errata-xmlrpc 2021-02-04 16:14:19 UTC
This issue has been addressed in the following products:

  Red Hat Quay 3

Via RHSA-2021:0420 https://access.redhat.com/errata/RHSA-2021:0420

Note You need to log in before you can comment on or make changes to this bug.