Bug 1265956 - (CVE-2015-7802) CVE-2015-7802 optipng: Buffer overflow in global memory
CVE-2015-7802 optipng: Buffer overflow in global memory
Status: CLOSED WONTFIX
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
impact=low,public=20150923,reported=2...
: Security
Depends On: 1265961 1265962 1265963
Blocks: 1265960
  Show dependency treegraph
 
Reported: 2015-09-24 04:28 EDT by Adam Mariš
Modified: 2016-04-21 07:45 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-07 11:59:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Adam Mariš 2015-09-24 04:28:44 EDT
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 04:33:38 EDT
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 11:56:49 EDT
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.