Bug 1306681 (CVE-2013-7447) - CVE-2013-7447 gtk2, gtk3: Integer overflow in image handling
Summary: CVE-2013-7447 gtk2, gtk3: Integer overflow in image handling
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2013-7447
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: 1306682 1306683
Blocks: 1306685
TreeView+ depends on / blocked
 
Reported: 2016-02-11 15:04 UTC by Adam Mariš
Modified: 2019-09-29 13:44 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-03-14 06:21:57 UTC
Embargoed:


Attachments (Terms of Use)

Description Adam Mariš 2016-02-11 15:04:25 UTC
An integer overflow vulnerability in gtk+2.0 and gtk+3.0 in image handling was found when supplying large pixbufs to gdk_cairo_set_source_pixbuf, gdkcairo tries to allocate an immense number of bytes.

Upstream patch:

https://git.gnome.org/browse/gtk+/commit?id=894b1ae76a32720f4bb3d39cf460402e3ce331d6

CVE request:

http://seclists.org/oss-sec/2016/q1/302

Comment 1 Adam Mariš 2016-02-11 15:06:42 UTC
Created gtk2 tracking bugs for this issue:

Affects: fedora-all [bug 1306682]

Comment 2 Adam Mariš 2016-02-11 15:06:47 UTC
Created gtk3 tracking bugs for this issue:

Affects: fedora-all [bug 1306683]

Comment 3 Huzaifa S. Sidhpurwala 2016-03-14 06:08:00 UTC
This is basically a DoS flaw when opening a crafted image. When g_malloc() is asked to malloc huge amount of memory, and it is unable to do it, it crashes with a g_error() amount similar to:

(eog:18754): GLib-ERROR **: /build/buildd/glib2.0-2.36.0/./glib/gmem.c:165: failed to allocate 18446744071914584320 bytes

Also it looks like gtk3 is not affected by this flaw, since the code there is completely different. 

In gdk_cairo_set_source_pixbuf() rather than doing:

cairo_pixels = g_malloc (height * cairo_stride); and creating a "surface" after that by using cairo_image_surface_create_for_data() what gtk3 does is that it uses the cairo function cairo_surface_create_similar_image() to create the surface.

cairo_surface_create_similar_image() uses pixman_image_create() which calculates the size of the buffer needed to hold the image. 

pixman_image_create() handles it correctly by using the following code:

 pixels = FbPixelsCreate (width, height, format->depth);
     if (pixels == NULL)
 	return NULL;


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