Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. Pillow
  4. ›
  5. CVE-2022-30595

CVE-2022-30595: Buffer over-flow in Pillow

May 26, 2022 (updated November 26, 2024)

When reading a TGA file with RLE packets that cross scan lines, Pillow reads the information past the end of the first line without deducting that from the length of the remaining file data. This vulnerability was introduced in Pillow 9.1.0, and can cause a heap buffer overflow.

Opening an image with a zero or negative height has been found to bypass a decompression bomb check. This will now raise a SyntaxError instead, in turn raising a PIL.UnidentifiedImageError.

References

  • github.com/advisories/GHSA-hr8g-f6r6-mr22
  • github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2022-43145.yaml
  • github.com/python-pillow/Pillow
  • github.com/python-pillow/Pillow/blob/main/src/libImaging/TgaRleDecode.c
  • github.com/python-pillow/Pillow/commit/c846cc881ebe34e3518412c2e3636433d9947280
  • nvd.nist.gov/vuln/detail/CVE-2022-30595
  • pillow.readthedocs.io/en/stable/releasenotes/9.1.1.html

Code Behaviors & Features

Detect and mitigate CVE-2022-30595 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 9.1.0 before 9.1.1, version 9.1.0

Fixed versions

  • 9.1.1

Solution

Upgrade to version 9.1.1 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

Source file

pypi/Pillow/CVE-2022-30595.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:42 +0000.