# CVE-2021-25289: Out of bounds write 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): 2.03%, higher than 81% of CVEs (2026-12-01)
- Published: 2021-03-19T03:29:48.000Z
- Modified: 2026-09-08T08:48:18.491Z
- Also known as: GHSA-57h3-9rgr-c24m, BIT-PILLOW-2021-25289, PYSEC-2021-35
- Weaknesses: CWE-787
- Assigned by: mitre

## Description

An issue was discovered in Pillow before 8.1.1. TiffDecode has a heap-based buffer overflow when decoding crafted YCbCr files because of certain interpretation conflicts with LibTIFF in RGBA mode. NOTE: this issue exists because of an incomplete fix for CVE-2020-35654.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- pillow (PyPI): before 8.1.1
- python pillow: before 8.1.1
- pillow (Bitnami): before 8.1.1

## 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/8.1.1.html> (advisory, release-notes, vendor-advisory, web)
- <https://security.gentoo.org/glsa/202107-33> (advisory, third-party-advisory, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-25289> (advisory, web)
- <https://github.com/python-pillow/Pillow/commit/3fee28eb9479bf7d59e0fa08068f9cc4a6e2f04c> (web)
- <https://github.com/python-pillow/Pillow/commit/cbfdde7b1f2295059a20a539ee9960f0bec7b299> (web)
- <https://github.com/advisories/GHSA-57h3-9rgr-c24m> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2021-35.yaml> (web)
- <https://github.com/python-pillow/Pillow> (web)

## Sources

- CVE List: [CVE-2021-25289](https://www.cve.org/CVERecord?id=CVE-2021-25289), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-57h3-9rgr-c24m](https://github.com/advisories/GHSA-57h3-9rgr-c24m), CC-BY-4.0, modified 2024-10-08
- NVD: [CVE-2021-25289](https://nvd.nist.gov/vuln/detail/CVE-2021-25289), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-35](https://osv.dev/vulnerability/PYSEC-2021-35), CC-BY-4.0, modified 2023-12-06
- Bitnami Vulnerability Database: [BIT-PILLOW-2021-25289](https://osv.dev/vulnerability/BIT-PILLOW-2021-25289), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-25289 · Whole record: https://cve.day/CVE-2021-25289.json · Rebuilt by cve.day 2026-11-25T22:58:00.341Z
