Bug 960319 - (CVE-2015-7555) VUL-0: CVE-2015-7555: giflib: Heap-based buffer overflow in giffix utility
(CVE-2015-7555)
VUL-0: CVE-2015-7555: giflib: Heap-based buffer overflow in giffix utility
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P3 - Medium : Normal
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/160017/
CVSSv2:RedHat:CVE-2015-7555:5.1:(AV:N...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-29 09:30 UTC by Victor Pereira
Modified: 2016-01-29 22:11 UTC (History)
3 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Pereira 2015-12-29 09:30:02 UTC
rh#1290785

A heap-based buffer overflow vulnerability was found in giffix utility of giflib when processing records of the type `IMAGE_DESC_RECORD_TYPE' due to the allocated size of `LineBuffer' equaling the value of the logical screen width, `GifFileIn->SWidth', while subsequently having `GifFileIn->Image.Width' bytes of data written to it.

Vulnerable code:

giflib-5.1.1/util/giffix.c #35..194:
| int main(int argc, char **argv)
| {
| [...]
| if ((LineBuffer = (GifRowType) malloc(GifFileIn->SWidth)) == NULL)
| GIF_EXIT("Failed to allocate memory required, aborted.");
|
| /* Scan the content of the GIF file and load the image(s) in: */
| do {
| [...]
| switch (RecordType) {
| case IMAGE_DESC_RECORD_TYPE:
| if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
| QuitGifError(GifFileIn, GifFileOut);
| [...]
| Width = GifFileIn->Image.Width;
| Height = GifFileIn->Image.Height;
| [...]
| /* Find the darkest color in color map to use as a filler. */
| ColorMap = (GifFileIn->Image.ColorMap ? GifFileIn->Image.ColorMap :
| GifFileIn->SColorMap);
| for (i = 0; i < ColorMap->ColorCount; i++) {
| j = ((int) ColorMap->Colors[i].Red) * 30 +
| ((int) ColorMap->Colors[i].Green) * 59 +
| ((int) ColorMap->Colors[i].Blue) * 11;
| if (j < ColorIntens) {
| ColorIntens = j;
| DarkestColor = i;
| }
| }
|
| /* Load the image, and dump it. */
| for (i = 0; i < Height; i++) {
| GifQprintf("\b\b\b\b%-4d", i);
| if (DGifGetLine(GifFileIn, LineBuffer, Width)
| == GIF_ERROR) break;
| if (EGifPutLine(GifFileOut, LineBuffer, Width)
| == GIF_ERROR) QuitGifError(GifFileIn, GifFileOut);
| }
|
| if (i < Height) {
| [...]
| /* Fill in with the darkest color in color map. */
| for (j = 0; j < Width; j++)
| LineBuffer[j] = DarkestColor;
| for (; i < Height; i++)
| if (EGifPutLine(GifFileOut, LineBuffer, Width)
| == GIF_ERROR) QuitGifError(GifFileIn, GifFileOut);
| }
| break;
| [...]
| }
| }
| while (RecordType != TERMINATE_RECORD_TYPE);
| [..]
| }

References:
https://bugzilla.redhat.com/show_bug.cgi?id=1290785
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-7555
http://seclists.org/oss-sec/2015/q4/548
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-7555
Comment 3 Swamp Workflow Management 2015-12-29 23:00:24 UTC
bugbot adjusting priority
Comment 4 SMASH SMASH 2016-01-05 09:35:54 UTC
An update workflow for this issue was started.

This issue was rated as "moderate".
Please submit fixed packages until "Jan. 19, 2016".

When done, reassign the bug to "security-team@suse.de".
/update/121225/.
Comment 5 SMASH SMASH 2016-01-05 09:37:29 UTC
An update workflow for this issue was started.

This issue was rated as "moderate".
Please submit fixed packages until "Jan. 19, 2016".

When done, reassign the bug to "security-team@suse.de".
/update/62407/.
Comment 8 Bernhard Wiedemann 2016-01-19 14:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (960319) was mentioned in
https://build.opensuse.org/request/show/354774 Factory / giflib
https://build.opensuse.org/request/show/354779 13.2 / giflib
https://build.opensuse.org/request/show/354781 13.1 / giflib
Comment 10 Andreas Stieger 2016-01-21 16:32:46 UTC
All submissions received, re-assigning to security team.
Comment 11 Swamp Workflow Management 2016-01-21 20:12:02 UTC
SUSE-SU-2016:0192-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 960319
CVE References: CVE-2015-7555
Sources used:
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    giflib-4.1.6-13.1
SUSE Linux Enterprise Software Development Kit 11-SP3 (src):    giflib-4.1.6-13.1
SUSE Linux Enterprise Server for VMWare 11-SP3 (src):    giflib-4.1.6-13.1
SUSE Linux Enterprise Server 11-SP4 (src):    giflib-4.1.6-13.1
SUSE Linux Enterprise Server 11-SP3 (src):    giflib-4.1.6-13.1
SUSE Linux Enterprise Desktop 11-SP4 (src):    giflib-4.1.6-13.1
SUSE Linux Enterprise Desktop 11-SP3 (src):    giflib-4.1.6-13.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    giflib-4.1.6-13.1
SUSE Linux Enterprise Debuginfo 11-SP3 (src):    giflib-4.1.6-13.1
Comment 12 Swamp Workflow Management 2016-01-22 14:13:17 UTC
openSUSE-SU-2016:0201-1: An update that solves one vulnerability and has one errata is now available.

Category: security (moderate)
Bug References: 949160,960319
CVE References: CVE-2015-7555
Sources used:
openSUSE 13.2 (src):    giflib-5.0.5-4.3.1
Comment 13 Swamp Workflow Management 2016-01-22 14:13:56 UTC
SUSE-SU-2016:0202-1: An update that solves one vulnerability and has one errata is now available.

Category: security (moderate)
Bug References: 949160,960319
CVE References: CVE-2015-7555
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP1 (src):    giflib-5.0.5-7.1
SUSE Linux Enterprise Software Development Kit 12 (src):    giflib-5.0.5-7.1
SUSE Linux Enterprise Server 12-SP1 (src):    giflib-5.0.5-7.1
SUSE Linux Enterprise Server 12 (src):    giflib-5.0.5-7.1
SUSE Linux Enterprise Desktop 12-SP1 (src):    giflib-5.0.5-7.1
SUSE Linux Enterprise Desktop 12 (src):    giflib-5.0.5-7.1
Comment 14 Swamp Workflow Management 2016-01-22 18:11:53 UTC
openSUSE-SU-2016:0207-1: An update that solves one vulnerability and has one errata is now available.

Category: security (important)
Bug References: 949160,960319
CVE References: CVE-2015-7555
Sources used:
openSUSE 13.1 (src):    giflib-5.0.5-2.3.1
Comment 15 Andreas Stieger 2016-01-29 18:22:03 UTC
done
Comment 16 Swamp Workflow Management 2016-01-29 22:11:56 UTC
openSUSE-SU-2016:0289-1: An update that solves one vulnerability and has one errata is now available.

Category: security (moderate)
Bug References: 949160,960319
CVE References: CVE-2015-7555
Sources used:
openSUSE Leap 42.1 (src):    giflib-5.0.5-7.1