# CVE-2020-5311: Buffer Copy without Checking Size of Input in Pillow

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 3.69%, higher than 89% of CVEs (2026-12-01)
- Published: 2020-01-03T00:52:42.000Z
- Modified: 2026-09-08T08:48:24.737Z
- Also known as: GHSA-r7rm-8j6h-r933, BIT-PILLOW-2020-5311, PYSEC-2020-82
- Weaknesses: CWE-120
- Assigned by: mitre

## Description

libImaging/SgiRleDecode.c in Pillow before 6.2.2 has an SGI buffer overflow.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- pillow (PyPI): before 6.2.2; before a79b65c47c7dc6fe623aadf09aa6192fc54548f3
- python pillow: before 6.2.2
- canonical ubuntu_linux: 18.04; 19.10
- debian debian_linux: 9.0; 10.0
- fedoraproject fedora: 30; 31
- pillow (Bitnami): before 6.2.2

## Every score

- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:4.0 Critical `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://pillow.readthedocs.io/en/stable/releasenotes/6.2.2.html> (advisory, release-notes, third-party-advisory, web)
- <https://github.com/python-pillow/Pillow/commit/a79b65c47c7dc6fe623aadf09aa6192fc54548f3> (advisory, fix, patch, third-party-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2MMU3WT2X64GS5WHDPKKC2WZA7UIIQ3A/> (vendor-advisory, web)
- <https://usn.ubuntu.com/4272-1/> (advisory, third-party-advisory, vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2020:0566> (advisory, third-party-advisory, vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3DUMIBUYGJRAVJCTFUWBRLVQKOUTVX5P/> (vendor-advisory, web)
- <https://www.debian.org/security/2020/dsa-4631> (advisory, third-party-advisory, vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2020:0580> (advisory, third-party-advisory, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2020-5311> (advisory, web)
- <https://github.com/advisories/GHSA-r7rm-8j6h-r933> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2020-82.yaml> (web)
- <https://github.com/python-pillow/Pillow> (package)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2MMU3WT2X64GS5WHDPKKC2WZA7UIIQ3A> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3DUMIBUYGJRAVJCTFUWBRLVQKOUTVX5P> (web)
- <https://usn.ubuntu.com/4272-1> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2MMU3WT2X64GS5WHDPKKC2WZA7UIIQ3A/> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3DUMIBUYGJRAVJCTFUWBRLVQKOUTVX5P/> (web)

## Sources

- CVE List: [CVE-2020-5311](https://www.cve.org/CVERecord?id=CVE-2020-5311), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-r7rm-8j6h-r933](https://github.com/advisories/GHSA-r7rm-8j6h-r933), CC-BY-4.0, modified 2024-10-08
- NVD: [CVE-2020-5311](https://nvd.nist.gov/vuln/detail/CVE-2020-5311), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2020-82](https://osv.dev/vulnerability/PYSEC-2020-82), CC-BY-4.0, modified 2023-12-06
- Bitnami Vulnerability Database: [BIT-PILLOW-2020-5311](https://osv.dev/vulnerability/BIT-PILLOW-2020-5311), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2020-5311 · Whole record: https://cve.day/CVE-2020-5311.json · Rebuilt by cve.day 2026-11-25T22:57:50.480Z
