Menu

#371 out-of-bounds read in coders/rle.c:633:39

v1.0_(example)
closed-fixed
None
5
2016-03-26
2016-03-21
moshe
No

This bug was found while fuzzing graphicsmagick with afl-fuzz

Tested on hg changeset 44ed8318ba6a+

Command: gm convert id:000206,sig:06,src:004994+002107,op:splice,rep:128 /dev/null

=================================================================
==18615==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb6100434 at pc 0x08501a63 bp 0xbf815d18 sp 0xbf815d10
READ of size 1 at 0xb6100434 thread T0
#0 0x8501a62 in ReadRLEImage /home/user/Desktop/graphicsmagick/coders/rle.c:633:39
#1 0x81f84b4 in ReadImage /home/user/Desktop/graphicsmagick/magick/constitute.c:1607:14
#2 0x816fbca in ConvertImageCommand /home/user/Desktop/graphicsmagick/magick/command.c:4348:22
#3 0x8187f6b in MagickCommand /home/user/Desktop/graphicsmagick/magick/command.c:8862:27
#4 0x81cd999 in GMCommandSingle /home/user/Desktop/graphicsmagick/magick/command.c:17338:10
#5 0x81cc6ae in GMCommand /home/user/Desktop/graphicsmagick/magick/command.c:17391:16
#6 0x8139511 in main /home/user/Desktop/graphicsmagick/utilities/gm.c:61:10
#7 0xb748f73d in __libc_start_main /build/glibc-tVsQx_/glibc-2.21/csu/libc-start.c:289
#8 0x807fd9b in _start (/home/user/Desktop/graphicsmagick/utilities/gm+0x807fd9b)

0xb6100434 is located 0 bytes to the right of 4-byte region [0xb6100430,0xb6100434)
allocated by thread T0 here:
#0 0x8117a29 in malloc (/home/user/Desktop/graphicsmagick/utilities/gm+0x8117a29)
#1 0x827ef84 in MagickMalloc /home/user/Desktop/graphicsmagick/magick/memory.c:156:11
#2 0x827ef84 in MagickMallocArray /home/user/Desktop/graphicsmagick/magick/memory.c:347

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/user/Desktop/graphicsmagick/coders/rle.c:633 ReadRLEImage
Shadow bytes around the buggy address:
0x36c20030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c20040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c20050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c20060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c20070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x36c20080: fa fa 00 fa fa fa[04]fa fa fa 00 02 fa fa 00 fa
0x36c20090: fa fa fd fd fa fa fd fa fa fa fd fd fa fa fd fa
0x36c200a0: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fd
0x36c200b0: fa fa fd fa fa fa fd fa fa fa 00 06 fa fa 00 02
0x36c200c0: fa fa fd fd fa fa 00 04 fa fa fd fd fa fa 00 04
0x36c200d0: fa fa 00 04 fa fa 00 04 fa fa 00 04 fa fa 00 04
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==18615==ABORTING

1 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2016-03-24
    • Description has changed:

    Diff:

    
    
    • status: --> open
    • Group: --> v1.0_(example)
    • Priority: --> 5
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-03-24
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-03-26
    • status: open --> closed-fixed
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-03-26

    This problem is fixed by Mercurial changeset 14750:0a5b75e019b6

     

Log in to post a comment.