Skip to content
Memory corruption Disclosed report CVE-2015-4491

gdk-pixbuf heap overflow and DoS affecting Firefox

Gustavo Grieco Follow

Originally disclosed on Mozilla

  • Fixed in 27 days
  • Paid in 19 days
  • Disclosed after 27 days
Text
Created attachment 8633956
overflow-firefox.bmp.gz

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150629114848

Steps to reproduce:

I'm forwarding this bug because it clearly affects last versions of Firefox. This was reported to upstream here (https://bugzilla.gnome.org/show_bug.cgi?id=752297) and it is supposed to be fixed (i haven't tested the patch yet).
Requirements:

* Linux x86_64
* gdk-pixbuf 2.31 or newer (you can upgrade only this package in Ubuntu/Debian download and installing from here: https://packages.debian.org/sid/libgdk-pixbuf2.0-0 or http://packages.ubuntu.com/vivid/libgdk-pixbuf2.0-0). Older versions are more difficult to exploit, but the issue is still there.
* At least 10GB of real/virtual memory (a big swapfile will do the trick if you don't have enough physical memory).

Steps to reproduce:

1. Download and decompress firefox-overflow.bmp.gz  (it is compressed to avoid crashing my own browser!)
2. Try to open (ctrl+O) or attach firefox-overflow.bmp
3. Boom


Actual results:

Firefox crashes inside gdk-pixbuf code. Details:

Program received signal SIGSEGV, Segmentation fault.
make_filter_table (filter=0x7ffffffead10) at pixops.c:1294
1294	pixops.c: No such file or directory.
(gdb) info registers 
rax            0x0	0
rbx            0x2	2
rcx            0x0	0
rdx            0x0	0
rsi            0x7fffbae00000	140736328630272
rdi            0x7fffbcfc8d00	140736364055808
rbp            0x7ffffffead10	0x7ffffffead10
rsp            0x7ffffffeab20	0x7ffffffeab20
r8             0x2b0000	2818048
r9             0x0	0
r10            0x4000010	67108880
r11            0x7fffbeb5000c	140736392921100
r12            0x8	8
r13            0x1	1
r14            0x1000003	16777219
r15            0x7fffbc436c00	140736351923200
rip            0x7fffedf57239	0x7fffedf57239 <pixops_process+681>
eflags         0x10246	[ PF ZF IF RF ]
cs             0x33	51
ss             0x2b	43
ds             0x0	0
es             0x0	0
fs             0x0	0
gs             0x0	0
(gdb) x/i $rip
=> 0x7fffedf57239 <pixops_process+681>:	mov    %edx,(%rsi,%rax,4)

Here %rsi depens on the dimension of the malformed bmp.


Expected results:

Of course, Firefox shouldn't so easily be exploitable. Nevertheless, it is not clear how Firefox can prevent this kind of vulnerabilities in the future (unless your re-implement gdk-pixbuf functions)

The original report as published on Mozilla's Bugzilla, by Gustavo Grieco. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity memory corruption bug in Widget: Gtk. Mozilla made it public on 11 August 2015 as CVE-2015-4491.

About Memory corruption

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Gustavo Grieco

View all

4 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.