Menu

#351 heap-buffer-overflow in coders/psd.c:142

v1.0_(example)
closed-fixed
None
5
2016-03-20
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:000036,sig:06,src:000117,op:int32,pos:832,val:be:+1 /dev/null

=================================================================
==7283==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb3c0377c at pc 0x88b3a69 bp 0xbf93fc08 sp 0xbf93fc00
READ of size 4 at 0xb3c0377c thread T0
#0 0x88b3a68 in DecodeImage /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/coders/psd.c:142
#1 0x88a40db in ReadPSDImage /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/coders/psd.c:1390
#2 0x8244d62 in ReadImage /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/constitute.c:1607
#3 0x812c3ac in ConvertImageCommand /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:4348
#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 0xb74fda82 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)

0xb3c0377c is located 4 bytes to the left of 1024-byte region [0xb3c03780,0xb3c03b80)
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

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/coders/psd.c:142 DecodeImage
Shadow bytes around the buggy address:
0x36780690: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x367806a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x367806b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x367806c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x367806d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x367806e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa[fa]
0x367806f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x36780700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x36780710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x36780720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x36780730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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
==7283==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-20
    • status: open --> closed-fixed
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-03-20

    Fixed by Mercurial changeset 14740:498ec58ad79c

     

Log in to post a comment.

MongoDB Logo MongoDB