pillow@6.0.0 vulnerabilities

Python Imaging Library (Fork)

Direct Vulnerabilities

Known vulnerabilities in the pillow package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • H
Buffer Overflow

Affected versions of this package are vulnerable to Buffer Overflow via the strcpy function in _imagingcms.c, due to two calls that were able to copy too much data into fixed length strings.

How to fix Buffer Overflow?

Upgrade pillow to version 10.3.0 or higher.

[,10.3.0)
  • H
Denial of Service (DoS)

Affected versions of this package are vulnerable to Denial of Service (DoS) when using arbitrary strings as text input and the number of characters passed into PIL.ImageFont.ImageFont.getmask() is over a certain limit. This can lead to a system crash.

How to fix Denial of Service (DoS)?

Upgrade pillow to version 10.2.0 or higher.

[,10.2.0)
  • H
Denial of Service (DoS)

Affected versions of this package are vulnerable to Denial of Service (DoS) if the size of individual glyphs extends beyond the bitmap image, when using PIL.ImageFont.ImageFont function. Exploiting this vulnerability could lead to a system crash.

How to fix Denial of Service (DoS)?

Upgrade pillow to version 10.2.0 or higher.

[,10.2.0)
  • H
Eval Injection

Affected versions of this package are vulnerable to Eval Injection via the PIL.ImageMath.eval function when an attacker has control over the keys passed to the environment argument.

How to fix Eval Injection?

Upgrade pillow to version 10.2.0 or higher.

[,10.2.0)
  • H
Uncontrolled Resource Consumption ('Resource Exhaustion')

Affected versions of this package are vulnerable to Uncontrolled Resource Consumption ('Resource Exhaustion') when the ImageFont truetype in an ImageDraw instance operates on a long text argument. An attacker can cause the service to crash by processing a task that uncontrollably allocates memory.

How to fix Uncontrolled Resource Consumption ('Resource Exhaustion')?

Upgrade pillow to version 10.0.0 or higher.

[,10.0.0)
  • C
Heap-based Buffer Overflow

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Heap-based Buffer Overflow when the ReadHuffmanCodes() function is used. An attacker can craft a special WebP lossless file that triggers the ReadHuffmanCodes() function to allocate the HuffmanCode buffer with a size that comes from an array of precomputed sizes: kTableSize. The color_cache_bits value defines which size to use. The kTableSize array only takes into account sizes for 8-bit first-level table lookups but not second-level table lookups. libwebp allows codes that are up to 15-bit (MAX_ALLOWED_CODE_LENGTH). When BuildHuffmanTable() attempts to fill the second-level tables it may write data out-of-bounds. The OOB write to the undersized array happens in ReplicateValue.

Notes:

This is only exploitable if the color_cache_bits value defines which size to use.

This vulnerability was also published on libwebp CVE-2023-5129

Changelog:

2023-09-12: Initial advisory publication

2023-09-27: Advisory details updated, including CVSS, references

2023-09-27: CVE-2023-5129 rejected as a duplicate of CVE-2023-4863

2023-09-28: Research and addition of additional affected libraries

2024-01-28: Additional fix information

How to fix Heap-based Buffer Overflow?

Upgrade Pillow to version 10.0.1 or higher.

[,10.0.1)
  • M
Denial of Service (DoS)

Affected versions of this package are vulnerable to Denial of Service (DoS) due to a missing GIF decompression bomb check.

How to fix Denial of Service (DoS)?

Upgrade pillow to version 9.2.0 or higher.

[,9.2.0)
  • M
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS) due to a missing GIF decompression bomb check.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 9.2.0 or higher.

[,9.2.0)
  • M
Improper Input Validation

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Improper Input Validation. When the path to the temporary directory on Linux or macOS contained a space, this would break removal of the temporary image file after im.show() (and related actions), and potentially remove an unrelated file.

How to fix Improper Input Validation?

Upgrade Pillow to version 9.0.1 or higher.

[,9.0.1)
  • M
Buffer Over-read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Buffer Over-read via the path_getbbox method in path.c during initialization of ImagePath.Path.

How to fix Buffer Over-read?

Upgrade Pillow to version 9.0.0 or higher.

[,9.0.0)
  • M
Improper Initialization

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Improper Initialization of ImagePath.Path in path_getbbox at path.c.

How to fix Improper Initialization?

Upgrade Pillow to version 9.0.0 or higher.

[,9.0.0)
  • C
Arbitrary Code Execution

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Arbitrary Code Execution via PIL.ImageMath.eval which allows evaluation of arbitrary expressions, such as ones that use the Python exec method.

How to fix Arbitrary Code Execution?

Upgrade Pillow to version 9.0.0 or higher.

[,9.0.0)
  • M
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). The JpegImagePlugin may append an EOF marker to the end of a truncated file, so that the last segment of the data will still be processed by the decoder. If the EOF marker is not detected as such, this can lead to an infinite loop where JpegImagePlugin keeps trying to end the file.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 9.0.0 or higher.

[,9.0.0)
  • H
Regular Expression Denial of Service (ReDoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb function.

How to fix Regular Expression Denial of Service (ReDoS)?

Upgrade Pillow to version 8.3.2 or higher.

[5.2.0,8.3.2)
  • M
Buffer Overflow

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Buffer Overflow. It allowed parameters passed into a convert function to trigger buffer overflow in Convert.c.

How to fix Buffer Overflow?

Upgrade Pillow to version 8.3.0 or higher.

[1.0,8.3.0)
  • H
Out-of-bounds Read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Read. A out-of-bounds read in exists in J2kDecode in j2ku_gray_i.

How to fix Out-of-bounds Read?

Upgrade Pillow to version 8.2.0 or higher.

[2.4.0,8.2.0)
  • H
Out-of-bounds Read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Read. A out-of-bounds read in exists in J2kDecode in j2ku_graya_la.

How to fix Out-of-bounds Read?

Upgrade Pillow to version 8.2.0 or higher.

[2.4.0,8.2.0)
  • H
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). Improper checks in BlpImagePlugin may result in the decoder running over empty data.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 8.2.0 or higher.

[,8.2.0)
  • H
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). This is due to improper checks in FliDecode that may result in an infinite loop.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 8.2.0 or higher.

[,8.2.0)
  • H
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). The readline in EPS use an accidentally quadratic method of accumulating lines while looking for a line ending. A malicious EPS file can use this to perform a DoS in the open phase, before an image is accepted for opening.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 8.2.0 or higher.

[,8.2.0)
  • H
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). Improper checks in PSDImagePlugin may result in a DoS when calling Image.open.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 8.2.0 or higher.

[,8.2.0)
  • H
Heap-based Buffer Overflow

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Heap-based Buffer Overflow insufficent fix for CVE-2020-35654 due to incorrect error checking in TiffDecode.c.

How to fix Heap-based Buffer Overflow?

Upgrade Pillow to version 8.1.1 or higher.

[,8.1.1)
  • H
Insufficient Validation

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Insufficient Validation. In TiffDecode.c, there is a negative-offset memcpy with an invalid size.

How to fix Insufficient Validation?

Upgrade Pillow to version 8.1.1 or higher.

[,8.1.1)
  • H
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). This can happen in the BLP container format where the reported size of the contained image is not properly checked. These images can cause arbitrarily large memory allocations.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 8.1.2 or higher.

[,8.1.2)
  • H
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). This can happen in the ICNS container format where the reported size of the contained image is not properly checked. These images can cause arbitrarily large memory allocations.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 8.1.2 or higher.

[,8.1.2)
  • H
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). This can happen in the ICO container format where the reported size of the contained image is not properly checked. These images can cause arbitrarily large memory allocations.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 8.1.2 or higher.

[,8.1.2)
  • H
Out-of-bounds Read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Read due to invalid tile boundaries lead.

How to fix Out-of-bounds Read?

Upgrade Pillow to version 8.1.1 or higher.

[,8.1.1)
  • H
Regular Expression Denial of Service (ReDoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via next_object_id.

How to fix Regular Expression Denial of Service (ReDoS)?

Upgrade Pillow to version 8.1.1 or higher.

[0,8.1.1)
  • M
Out-of-bounds Write

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Write via OOB Write in TiffDecode.c when reading corrupt YCbCr files. This happens because of certain interpretation conflicts with LibTIFF in RGBA mode.

How to fix Out-of-bounds Write?

Upgrade Pillow to version 8.1.0 or higher.

[6.0.0,8.1.0)
  • H
Out-of-bounds Read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Read. There is a 4 byte read overflow in SGIRleDecode.c, where the code is not correctly checking the offsets and length tables.

How to fix Out-of-bounds Read?

Upgrade Pillow to version 8.1.0 or higher.

[4.3.0,8.1.0)
  • H
Out-of-bounds Read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Read. The PCX image decoder uses the reported image stride to calculate the row buffer, rather than calculating it from the image size.

How to fix Out-of-bounds Read?

Upgrade Pillow to version 8.1.0 or higher.

[,8.1.0)
  • M
Buffer Overflow

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Buffer Overflow. Two Buffer Overflows exist in libImaging/TiffDecode.c.

How to fix Buffer Overflow?

Upgrade Pillow to version 7.1.0 or higher.

[,7.1.0)
  • M
Out-of-bounds Read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Read. In libImaging/SgiRleDecode.c a number of out-of-bounds reads exist in the parsing of SGI image files.

How to fix Out-of-bounds Read?

Upgrade Pillow to version 7.1.0 or higher.

[0,7.1.0)
  • M
Out-of-bounds Read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Read. In libImaging/Jpeg2KDecode.c there are multiple out-of-bounds reads via a crafted JP2 file.

How to fix Out-of-bounds Read?

Upgrade Pillow to version 7.1.0 or higher.

[0,7.1.0)
  • M
Out-of-bounds Read

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-bounds Read. In libImaging/PcxDecode.c, an out-of-bounds read can occur when reading PCX files where state->shuffle is instructed to read beyond state->buffer.

How to fix Out-of-bounds Read?

Upgrade Pillow to version 7.1.0 or higher.

[,7.1.0)
  • M
Out-of-Bounds

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Out-of-Bounds. Multiple out-of-bounds reads exist in libImaging/FliDecode.c.

How to fix Out-of-Bounds?

Upgrade Pillow to version 7.1.0 or higher.

[,7.1.0)
  • H
Integer Overflow

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Integer Overflow in libImaging/TiffDecode.c when decoding TIFF files.

How to fix Integer Overflow?

Upgrade Pillow to version 6.2.2 or higher.

[,6.2.2)
  • H
Buffer Overflow

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Buffer Overflow in libImaging/SgiRleDecode.c.

How to fix Buffer Overflow?

Upgrade Pillow to version 6.2.2 or higher.

[,6.2.2)
  • H
Buffer Overflow

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Buffer Overflow in libImaging/PcxDecode.c.

How to fix Buffer Overflow?

Upgrade Pillow to version 6.2.2 or higher.

[,6.2.2)
  • H
Buffer Overflow

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Buffer Overflow. in libImaging/FliDecode.c.

How to fix Buffer Overflow?

Upgrade Pillow to version 6.2.2 or higher.

[,6.2.2)
  • M
Denial of Service (DoS)

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Denial of Service (DoS). FpxImagePlugin.py calls the range function on an unvalidated 32-bit integer if the number of bands is large. On Windows running 32-bit Python, this results in an OverflowError or MemoryError due to the 2 GB limit. However, on Linux running 64-bit Python this results in the process being terminated by the OOM killer.

How to fix Denial of Service (DoS)?

Upgrade Pillow to version 6.2.2 or higher.

[,6.2.2)
  • M
Allocation of Resources Without Limits or Throttling

Pillow is a PIL (Python Imaging Library) fork.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling. When reading specially crafted invalid image files, the library can either allocate very large amounts of memory or take an extremely long period of time to process the image.

How to fix Allocation of Resources Without Limits or Throttling?

Upgrade Pillow to version 6.2.0 or higher.

[,6.2.0)