Bug 1257859 (CVE-2015-0852)

Summary: CVE-2015-0852 freeimage: integer overflow in PluginPCX.cpp
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bruno, carnil, hobbes1069, i, john
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 02:43:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1257860, 1257861, 1257862    
Bug Blocks:    

Description Martin Prpič 2015-08-28 09:30:50 UTC
The following flaw was reported in FreeImage:

Affected Version: <= 3.17.0
URL : http://freeimage.sourceforge.net/

Description :
An integer overflow issue in the FreeImage project was reported and fixed recently.

Upstream fix: Revision 1.18 
http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginPCX.cpp?view=log&pathrev=MAIN

Details:

The PluginPCX.cpp file(version 3.17.0) has:

371 unsigned width = header.window[2] - header.window[0] + 1;
372 unsigned height = header.window[3] - header.window[1] + 1;
373 unsigned bitcount = header.bpp * header.planes;

However, it's possible that header.window[2] < header.window[0], and also header.window[3] < header.window[1]. In this 
two cases, width and height can be overflowed. And this can lead further issue in the rest of the code. Take the 
following lines for example:

568 for (x = 0; x < width; x++) {
569 bits[x * 3 + FI_RGBA_RED] = pline[x];
570 }

The write operation on buffer bits can help an attacker to corrupt the heap.

Original report:
http://seclists.org/oss-sec/2015/q3/450

Comment 1 Martin Prpič 2015-08-28 09:31:22 UTC
Created freeimage tracking bugs for this issue:

Affects: fedora-all [bug 1257860]
Affects: epel-all [bug 1257862]

Comment 2 Martin Prpič 2015-08-28 09:31:24 UTC
Created mingw-freeimage tracking bugs for this issue:

Affects: fedora-all [bug 1257861]

Comment 3 Product Security DevOps Team 2019-06-08 02:43:22 UTC
This CVE Bugzilla entry is for community support informational purposes only as it does not affect a package in a commercially supported Red Hat product. Refer to the dependent bugs for status of those individual community products.