*** This bug is a security vulnerability ***

Public security bug reported:

This bug was found while fuzzing graphicsmagick with afl-fuzz

Tested on hg changeset 14720:3b1f1e0c1098

Command: gm convert id:000078,sig:06,src:000122,op:arith8,pos:11,val:+5
/dev/null

=================================================================
==12927==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb3e066a6 at 
pc 0x88e176f bp 0xbf870d68 sp 0xbf870d60
WRITE of size 1 at 0xb3e066a6 thread T0
    #0 0x88e176e in ReadRLEImage 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/coders/rle.c:524
    #1 0x8244d62 in ReadImage 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/constitute.c:1607
    #2 0x812c3ac in ConvertImageCommand 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:4348
    #3 0x8165066 in MagickCommand 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:8862
    #4 0x81ed0dc in GMCommandSingle 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:17338
    #5 0x81ea204 in GMCommand 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/command.c:17391
    #6 0x80d4a76 in main 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/utilities/gm.c:61
    #7 0xb74a3a82 in __libc_start_main 
/build/buildd/eglibc-2.19/csu/libc-start.c:287
    #8 0x80d4904 in _start 
(/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/utilities/gm+0x80d4904)

0xb3e066a6 is located 6 bytes to the right of 25760-byte region 
[0xb3e00200,0xb3e066a0)
allocated by thread T0 here:
    #0 0x80bd531 in __interceptor_malloc 
(/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/utilities/gm+0x80bd531)
    #1 0x839c9f4 in MagickMalloc 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/memory.c:156
    #2 0x839c9f4 in MagickMallocArray 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/magick/memory.c:347

SUMMARY: AddressSanitizer: heap-buffer-overflow 
/home/user/Desktop/graphicsmagick_fuzz_results/graphicsmagick/coders/rle.c:524 
ReadRLEImage
Shadow bytes around the buggy address:
  0x367c0c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x367c0c90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x367c0ca0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x367c0cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x367c0cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x367c0cd0: 00 00 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa
  0x367c0ce0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x367c0cf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x367c0d00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x367c0d10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x367c0d20: 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
==12927==ABORTING

** Affects: graphicsmagick (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1537860

Title:
  out-of-bounds write in coders/rle.c:524

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/graphicsmagick/+bug/1537860/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to