{"id":"CVE-2020-5311","details":"libImaging/SgiRleDecode.c in Pillow before 6.2.2 has an SGI buffer overflow.","aliases":["BIT-pillow-2020-5311","GHSA-r7rm-8j6h-r933","PYSEC-2020-82"],"modified":"2026-07-08T12:43:49.083890Z","published":"2020-01-03T01:15:11.167Z","related":["SUSE-RU-2020:2161-1"],"database_specific":{"unresolved_ranges":[{"source":"CPE_STRING","extracted_events":[{"introduced":"18.04"},{"last_affected":"18.04"},{"introduced":"19.10"},{"last_affected":"19.10"}],"cpes":["cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:*:*:*:*","cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*"],"vendor_product":"canonical:ubuntu_linux"},{"source":"CPE_STRING","extracted_events":[{"introduced":"9.0"},{"last_affected":"9.0"},{"introduced":"10.0"},{"last_affected":"10.0"}],"cpes":["cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"],"vendor_product":"debian:debian_linux"},{"source":"CPE_STRING","extracted_events":[{"introduced":"30"},{"last_affected":"30"},{"introduced":"31"},{"last_affected":"31"}],"cpes":["cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*","cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*"],"vendor_product":"fedoraproject:fedora"}]},"references":[{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2MMU3WT2X64GS5WHDPKKC2WZA7UIIQ3A/"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3DUMIBUYGJRAVJCTFUWBRLVQKOUTVX5P/"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2020:0566"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2020:0580"},{"type":"ADVISORY","url":"https://pillow.readthedocs.io/en/stable/releasenotes/6.2.2.html"},{"type":"ADVISORY","url":"https://usn.ubuntu.com/4272-1/"},{"type":"ADVISORY","url":"https://www.debian.org/security/2020/dsa-4631"},{"type":"FIX","url":"https://github.com/python-pillow/Pillow/commit/a79b65c47c7dc6fe623aadf09aa6192fc54548f3"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/python-pillow/pillow","events":[{"introduced":"0"},{"fixed":"a45c8583ff90312a2fddc38567ed736cef4af563"},{"fixed":"a79b65c47c7dc6fe623aadf09aa6192fc54548f3"}],"database_specific":{"source":["CPE_RANGE","REFERENCES"],"extracted_events":[{"introduced":"0"},{"fixed":"6.2.2"}],"cpe":"cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*"}}],"versions":["6.2.1","6.2.0","6.1.0","6.0.0","5.4.0","5.3.0","5.2.0","5.1.0","5.0.0","4.3.0","4.2.0","4.1.0","4.0.0","4.0.0a","3.4.0","3.3.0","3.2.0","3.1.0","3.1.0-rc1","2.9.0","2.9.0.dev2","2.9.0.dev1","2.9.0.dev0","2.8.1","2.8.0","2.7.0","2.5.0","2.3.0","2.2.1","2.2.0","2.1.0","2.0.0","1.7.8","1.7.7","1.2","1.0"],"database_specific":{"vanir_signatures_modified":"2026-07-08T12:43:49Z","source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2020-5311.json","vanir_signatures":[{"digest":{"threshold":0.9,"line_hashes":["74394628443402872264910573382191555015","331322978970584824777287696594234124122","23182711350509848214109658018129134498","21295675298201514072661238004526791439","147362313223325050429672845411114095032","11728680069999553532564805891395609734","146542584084456442475866787063765149690","111995761264553157563801106692361300122","336894040779789205909693731782617387270","282092743345704169374304954216301115022","169513242581767477544127227679857517673","64785095045983690514758407603369230022","147362313223325050429672845411114095032","11728680069999553532564805891395609734","146542584084456442475866787063765149690","125630191536919897373952870166590578771","58373006746695298486896448352276165673","335858634260284363779854828498007781985","109186713654740590875643673206751540586","252524666320560104270511936646063661420","228363093971994857844065892422863375425","220845418040944005946317753051840329161","24059358200304628671709782237977515221","175644003446321522865613307084547865669","186816661014658657970488018787100125892","84551653920536917952441927246021476869","246616666101419533298827601867129363327","284404479206762129323202108270234175513","116356111928500685543966321177907648373"]},"source":"https://github.com/python-pillow/pillow/commit/a79b65c47c7dc6fe623aadf09aa6192fc54548f3","id":"CVE-2020-5311-655a3b71","signature_version":"v1","signature_type":"Line","target":{"file":"src/libImaging/SgiRleDecode.c"},"deprecated":false},{"digest":{"function_hash":"23537580919283434488848292199174173919","length":503},"source":"https://github.com/python-pillow/pillow/commit/a79b65c47c7dc6fe623aadf09aa6192fc54548f3","id":"CVE-2020-5311-7b789c14","signature_version":"v1","signature_type":"Function","target":{"function":"expandrow2","file":"src/libImaging/SgiRleDecode.c"},"deprecated":false},{"digest":{"function_hash":"189928262583536917268053492207105390628","length":441},"source":"https://github.com/python-pillow/pillow/commit/a79b65c47c7dc6fe623aadf09aa6192fc54548f3","id":"CVE-2020-5311-df88ec3e","signature_version":"v1","signature_type":"Function","target":{"function":"expandrow","file":"src/libImaging/SgiRleDecode.c"},"deprecated":false},{"digest":{"function_hash":"48429839654790430206881399079807026749","length":2942},"source":"https://github.com/python-pillow/pillow/commit/a79b65c47c7dc6fe623aadf09aa6192fc54548f3","id":"CVE-2020-5311-e7784fba","signature_version":"v1","signature_type":"Function","target":{"function":"ImagingSgiRleDecode","file":"src/libImaging/SgiRleDecode.c"},"deprecated":false}]}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}