Bug 1389229 (CVE-2016-8331) - CVE-2016-8331 libtiff: FAX IFD Entry Parsing Type Confusion
Summary: CVE-2016-8331 libtiff: FAX IFD Entry Parsing Type Confusion
Alias: CVE-2016-8331
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1389231 1389232 1389233
Blocks: 1389235
TreeView+ depends on / blocked
Reported: 2016-10-27 08:44 UTC by Andrej Nemec
Modified: 2021-02-17 03:06 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-01-17 08:46:20 UTC

Attachments (Terms of Use)

Description Andrej Nemec 2016-10-27 08:44:58 UTC
An exploitable remote code execution vulnerability exists in the handling of TIFF images in LibTIFF. A crafted TIFF document can lead to a type confusion vulnerability resulting in remote code execution. This vulnerability can be triggered via a TIFF file delivered to the application using LibTIFF’s tag extension functionality.

External References:


Comment 1 Andrej Nemec 2016-10-27 08:47:33 UTC
Created libtiff tracking bugs for this issue:

Affects: fedora-all [bug 1389231]

Comment 2 Andrej Nemec 2016-10-27 08:47:39 UTC
Created mingw-libtiff tracking bugs for this issue:

Affects: fedora-all [bug 1389232]
Affects: epel-7 [bug 1389233]

Comment 3 Huzaifa S. Sidhpurwala 2016-11-07 06:06:52 UTC

The flaw is possibly caused by expecting a double value on the argument list, va_arg and there is none. This results in a possible sizeof(double) OOB read/write. This may result in a crash, or a difficult to pull off code exec.

Comment 8 Nikola Forró 2017-01-17 08:34:30 UTC

The reproducer reads BadFaxLines tag like this:

uint32 *a;
TiffGetField(tiff, TIFFTAG_BADFAXLINES, &a);

Despite the documentation, which says:

Tag Name            Count   Types

the correct way how to read the tag is this:

uint32 count;
uint16 *values;
TIFFGetField(tiff, TIFFTAG_BADFAXLINES, &count, &values);

That is because TIFFTAG_BADFAXLINES is considered an anonymous custom tag, and as such is has to be read as count and array of values.

The reproducer does exactly what thumbnail utility is doing when it is processing BadFaxLines tag. However, processing this tag has been disabled in RHEL with patch for CVE-2016-3632. That means RHEL packages are not affected.

Note You need to log in before you can comment on or make changes to this bug.