VYPR
High severityNVD Advisory· Published May 25, 2022· Updated Aug 3, 2024

CVE-2022-30595

CVE-2022-30595

Description

libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Heap buffer overflow in Pillow 9.1.0's TGA RLE decoder allows denial of service or potential code execution via crafted TGA file.

Vulnerability

A heap buffer overflow vulnerability exists in libImaging/TgaRleDecode.c in Pillow 9.1.0. The flaw occurs when processing invalid TGA image files that use run-length encoding (RLE). The decoder does not properly validate the size of the decoded data against the allocated buffer, leading to a write past the end of the heap buffer. This affects Pillow versions 9.1.0 and earlier [1][2].

Exploitation

An attacker can exploit this vulnerability by supplying a specially crafted TGA image file to an application that uses Pillow to decode it. No authentication or special privileges are required if the application processes user-uploaded images. The attacker crafts a TGA file with malformed RLE data that causes the decoder to write beyond the allocated buffer during decompression [1][2].

Impact

Successful exploitation can lead to heap corruption, potentially resulting in a denial of service (application crash) or arbitrary code execution in the context of the Python process. The exact impact depends on how the application uses Pillow and the memory layout at the time of the overflow [1][3].

Mitigation

The vulnerability is fixed in Pillow 9.1.1, released on 2022-05-25. Users should upgrade to Pillow 9.1.1 or later. No workaround is available for affected versions. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog [1][3].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
PillowPyPI
>= 9.1.0, < 9.1.19.1.1

Affected products

3
  • Pillow/Pillowdescription
  • osv-coords2 versions
    >= 9.1.0, < 9.1.1+ 1 more
    • (no CPE)range: >= 9.1.0, < 9.1.1
    • (no CPE)range: >= 9.1.0, < 9.1.1

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

6

News mentions

0

No linked articles in our index yet.