Bug 1265956 (CVE-2015-7802) - CVE-2015-7802 optipng: Buffer overflow in global memory
Summary: CVE-2015-7802 optipng: Buffer overflow in global memory
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2015-7802
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1265961 1265962 1265963
Blocks: 1265960
TreeView+ depends on / blocked
 
Reported: 2015-09-24 08:28 UTC by Adam Mariš
Modified: 2019-09-29 13:37 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-07 15:59:47 UTC


Attachments (Terms of Use)

Description Adam Mariš 2015-09-24 08:28:44 UTC
A buffer overflow vulnerability using specially crafted gif file in optipng 0.7.5 was found.

CVE request (includes crash report and reproducer):

http://seclists.org/oss-sec/2015/q3/632

Comment 1 Adam Mariš 2015-09-24 08:33:38 UTC
Created optipng tracking bugs for this issue:

Affects: fedora-all [bug 1265961]
Affects: epel-5 [bug 1265962]
Affects: epel-6 [bug 1265963]

Comment 2 Stefan Cornelius 2015-10-07 15:56:49 UTC
I believe this is a problem in LZWGetCode() in src/gifread/gifread.c

> if ((curbit + code_size) >= lastbit)
>    {
>        if (done)
>        {
>            if (curbit >= lastbit)
>                GIFError("GIF/LZW error: ran off the end of my bits");
>            return -1;
>        }
>	if        
>	buffer[0] = buffer[last_byte-2]; // out of bounds of last_byte = 0
>       buffer[1] = buffer[last_byte-1];
>
>        if ((count = GIFReadDataBlock(&buffer[2], stream)) == 0)
>            done = LZW_TRUE;
>
>        last_byte = 2 + count;
>        curbit = (curbit - lastbit) + 16;
>        lastbit = (2 + count) * 8;
>    }

If last_byte is 0, "buffer[0] = buffer[last_byte-2];" will effectively read 2 bytes before the real start of the "buffer" array. It's an out-of-bounds read of a global buffer, so I don't see any reason for concern here. It probably won't even cause a crash.


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