Menu

#348 heap-buffer-overflow in coders/pdb.c:949:26

v1.0_(example)
closed-fixed
None
5
2016-03-19
2016-02-14
moshe
No

This bug was found while fuzzing graphicsmagick with afl-fuzz

Tested on hg changeset 14720:3b1f1e0c1098

Command: gm convert id:000014,sig:06,src:000033,op:flip1,pos:143 /dev/null

=================================================================
==7146==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb60625c0 at pc 0x87ef2f2 bp 0xbfcf2288 sp 0xbfcf2280
READ of size 128 at 0xb60625c0 thread T0
#0 0x87ef2f1 in WritePDBImage /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/coders/pdb.c:949:26
#1 0x824e050 in WriteImage /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/constitute.c:2208
#2 0x824fb98 in WriteImages /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/constitute.c:2351
#3 0x8144026 in ConvertImageCommand /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:6087
#4 0x8165066 in MagickCommand /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:8862
#5 0x81ed0dc in GMCommandSingle /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:17338
#6 0x81ea204 in GMCommand /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:17391
#7 0x80d4a76 in main /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/utilities/gm.c:61
#8 0xb753fa82 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
#9 0x80d4904 in _start (/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/utilities/gm+0x80d4904)

0xb60625c0 is located 0 bytes to the right of 256-byte region [0xb60624c0,0xb60625c0)
allocated by thread T0 here:
#0 0x80bd531 in __interceptor_malloc (/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/utilities/gm+0x80bd531)
#1 0x839bb38 in MagickMalloc /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/memory.c:156
#2 0x824e050 in WriteImage /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/constitute.c:2208
#3 0x824fb98 in WriteImages /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/constitute.c:2351

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/coders/pdb.c:949 WritePDBImage
Shadow bytes around the buggy address:
0x36c0c460: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c0c470: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c0c480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c0c490: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
0x36c0c4a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x36c0c4b0: 00 00 00 00 00 00 00 00[fa]fa fa fa fa fa fa fa
0x36c0c4c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c0c4d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c0c4e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c0c4f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x36c0c500: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
ASan internal: fe
==7146==ABORTING

1 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2016-02-14
    • Description has changed:

    Diff:

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

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

    Bob Friesenhahn - 2016-03-19

    Fixed by Mercurial changeset 14735:1a49a67d43f1.

     

Log in to post a comment.

MongoDB Logo MongoDB