镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

A heap-buffer-overflow at Pillow/src/libImaging/Unpack.c:467:50 in unpackP4L #8706

Closed as duplicate

Description

@Wakotu

Hello, a heap-buffer-overflow reported by ASAN when I fuzz Pillow with google/atheris.

Environment

  • Pillow version: 7.1.2
  • Python version: Python 3.8.10
  • OS version: Ubuntu 20.04.6 LTS

Output

fuzz driver:

import atheris
import io
import sys

with atheris.instrument_imports():
    from PIL import Image

def fuzz_image(data):
    try:
        # Attempt to open the image from the fuzzed data
        image = Image.open(io.BytesIO(data))
        image.load()  # Trigger image processing
    except Exception as e:
        # Handle exceptions (e.g., print or log)
        pass

def main():
    atheris.Setup(sys.argv, fuzz_image)
    atheris.Fuzz()

if __name__ == "__main__":
    main()

error log:
error.log

trigger input:
trigger.txt

Steps to Reproduce

Pull the docker image and run it to a container.

docker pull vueko0/pillow_crash:v1
docker run --rm vueko0/pillow_crash:v1

Enter the container and run following commands:

cd ~/Pillow/
./crash.sh

Activity

  1. changed the title [-]A heap-buffer-overflow at /root/Pillow/src/libImaging/Unpack.c:467:50 in unpackP4L[/-] [+]A heap-buffer-overflow at Pillow/src/libImaging/Unpack.c:467:50 in unpackP4L[/+] on Jan 19, 2025
  2. hugovk commented on Jan 19, 2025

    @hugovk
    Member

    Pillow 7.1.2 was released in April 2020: https://pypi.org/project/pillow/7.1.2/

    Also Python 3.8 is no longer supported.

    Can you reproduce with the latest Pillow 11.1.0 on Python 3.9 or later?

    And for next time, please follow our security policy regarding security issues:

    https://github.com/python-pillow/Pillow/blob/main/.github/SECURITY.md

  3. Wakotu commented on Jan 19, 2025

    @Wakotu
    Author

    Ok, I would try later.

  4. radarhere commented on Jan 19, 2025

    @radarhere
    Member

    I would conclude this has found https://nvd.nist.gov/vuln/detail/cve-2020-35653, which was fixed by #5174 in Pillow 8.1.0

    This problem is actually mentioned in the atheris repository itself - https://github.com/google/atheris/blob/master/hall_of_fame.md

  5. Wakotu commented on Jan 19, 2025

    @Wakotu
    Author

    Thanks for your work.

  6. hugovk commented on Jan 20, 2025

    @hugovk
    Member

    (Reclosing as duplicate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions