Skip to content

signed-integer-overflow (not used in any allocation/indexing) in jdarith.c #171

@Google-Autofuzz

Description

@Google-Autofuzz

Hello libjpeg-turbo team,

As part of our fuzzing efforts at Google, we have identified an issue affecting libjpeg-turbo (tested with revision master @ 3212005). To reproduce we are attaching a dockerfile to help compiling the project with the LLVM taking advantage of the sanitizers that it offers.

Attached is a dockerfile poc_and_docker_file.zip that can be used for reproduction. More information about how to use the dockerfile can be found here: https://docs.docker.com/engine/reference/builder/
TL;DR instructions:
mkdir libjpeg-turbo
cp Dockerfile /path/to/libjpeg-turbo
docker build --no-cache /path/to/libjpeg-turbo
docker run -it
(from another terminal, outside the container):
docker cp /path/to/attached/reproducer :/fuzzing/reproducer
https://docs.docker.com/engine/reference/commandline/cp/
(back inside the container) /fuzzing/repro.sh /fuzzing/reproducer

Alternatively, and depending on the bug, you could use gcc, valgrind or other instrumentation tools to aid in the investigation.

The sanitizer error that we encountered is here:

libjpeg-turbo/jdarith.c:567:32: runtime error: signed integer overflow: -2147474140 + -16384 cannot be represented in type 'int'

We will gladly work with you so you can successfully confirm and reproduce this issue. Do let us know if you have any feedback surrounding the documentation.

Once you have reproduced the issue, we’d appreciate to learn your expected timeline for an update to be released. With any fix, please attribute the report to “Google Autofuzz project”.

We are also pleased to inform you that your project is eligible for inclusion to the OSS-Fuzz project, which can provide additional continuous fuzzing, and encourage you to investigate integration options.

Don’t hesitate to let us know if you have any questions!

Google AutoFuzz Team

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions