{"action":"created","issue":{"url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/872","repository_url":"https://api.github.com/repos/ImageMagick/ImageMagick","labels_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/872/labels{/name}","comments_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/872/comments","events_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/872/events","html_url":"https://github.com/ImageMagick/ImageMagick/issues/872","id":275591517,"number":872,"title":"heap-buffer-overflow in Magick_png_read_raw_profile","user":{"login":"henices","id":929715,"avatar_url":"https://avatars3.githubusercontent.com/u/929715?v=4","gravatar_id":"","url":"https://api.github.com/users/henices","html_url":"https://github.com/henices","followers_url":"https://api.github.com/users/henices/followers","following_url":"https://api.github.com/users/henices/following{/other_user}","gists_url":"https://api.github.com/users/henices/gists{/gist_id}","starred_url":"https://api.github.com/users/henices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henices/subscriptions","organizations_url":"https://api.github.com/users/henices/orgs","repos_url":"https://api.github.com/users/henices/repos","events_url":"https://api.github.com/users/henices/events{/privacy}","received_events_url":"https://api.github.com/users/henices/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-11-21T05:39:48Z","updated_at":"2017-11-22T15:05:23Z","closed_at":null,"author_association":"NONE","body":"$ convert -version\r\nVersion: ImageMagick 7.0.7-12 Q16 x86_64 2017-11-21 http://www.imagemagick.org\r\nCopyright: © 1999-2017 ImageMagick Studio LLC\r\nLicense: http://www.imagemagick.org/script/license.php\r\nFeatures: Cipher DPC HDRI OpenMP \r\nDelegates (built-in): bzlib fontconfig freetype jng jpeg pangocairo png x xml zlib\r\n\r\ncommit: 6645a122ee83105008e8447f92555e4a9e307ecf  compile at ubuntu 14.04 x86_64\r\n\r\nTrigger Command:  **convert Magick_png_read_raw_profile-heap-overflow /dev/null**\r\n\r\n```\r\n==25042== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60060001dd58 at pc 0x7f27e3c6f8a7 bp 0x7fff78c5f4c0 sp 0x7fff78c5f4b8\r\nREAD of size 1 at 0x60060001dd58 thread T0\r\n    #0 0x7f27e3c6f8a6 in Magick_png_read_raw_profile /home/henices/ImageMagick/coders/png.c:1804\r\n    #1 0x7f27e3c7982f in ReadOnePNGImage /home/henices/ImageMagick/coders/png.c:3855\r\n    #2 0x7f27e3c7ac76 in ReadPNGImage /home/henices/ImageMagick/coders/png.c:4236\r\n    #3 0x7f27e361f721 in ReadImage /home/henices/ImageMagick/MagickCore/constitute.c:497\r\n    #4 0x7f27e3621d87 in ReadImages /home/henices/ImageMagick/MagickCore/constitute.c:866\r\n    #5 0x7f27e2e3b79b in ConvertImageCommand /home/henices/ImageMagick/MagickWand/convert.c:641\r\n    #6 0x7f27e2fdea10 in MagickCommandGenesis /home/henices/ImageMagick/MagickWand/mogrify.c:183\r\n    #7 0x40164c in MagickMain /home/henices/ImageMagick/utilities/magick.c:149\r\n    #8 0x4017e1 in main /home/henices/ImageMagick/utilities/magick.c:180\r\n    #9 0x7f27e2761f44 in __libc_start_main /build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:287\r\n    #10 0x401198 in _start (/usr/local/bin/magick+0x401198)\r\n0x60060001dd58 is located 0 bytes to the right of 24-byte region [0x60060001dd40,0x60060001dd58)\r\nallocated by thread T0 here:\r\n    #0 0x7f27e42ba41a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.0+0x1541a)\r\n    #1 0x7f27e3800279 in AcquireMagickMemory /home/henices/ImageMagick/MagickCore/memory.c:464\r\n    #2 0x7f27e3c6f389 in Magick_png_malloc /home/henices/ImageMagick/coders/png.c:1756\r\n    #3 0x7f27e1ec5fff in png_malloc (/lib/x86_64-linux-gnu/libpng12.so.0+0x1afff)\r\nSUMMARY: AddressSanitizer: heap-buffer-overflow /home/henices/ImageMagick/coders/png.c:1804 Magick_png_read_raw_profile\r\nShadow bytes around the buggy address:\r\n  0x0c013fffbb50: 00 00 fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa\r\n  0x0c013fffbb60: 00 00 00 02 fa fa 00 00 03 fa fa fa 00 00 00 00\r\n  0x0c013fffbb70: fa fa 00 00 04 fa fa fa 00 00 00 00 fa fa 00 00\r\n  0x0c013fffbb80: 03 fa fa fa 00 00 00 00 fa fa 00 00 06 fa fa fa\r\n  0x0c013fffbb90: 00 00 00 00 fa fa 00 00 00 fa fa fa 00 00 00 00\r\n=>0x0c013fffbba0: fa fa 00 00 00 01 fa fa 00 00 00[fa]fa fa fd fd\r\n  0x0c013fffbbb0: fd fd fa fa fd fd fd fa fa fa 00 00 00 00 fa fa\r\n  0x0c013fffbbc0: 00 00 06 fa fa fa 00 00 00 00 fa fa 00 00 06 fa\r\n  0x0c013fffbbd0: fa fa 00 00 00 00 fa fa 00 00 05 fa fa fa 00 00\r\n  0x0c013fffbbe0: 00 00 fa fa 00 00 04 fa fa fa 00 00 00 00 fa fa\r\n  0x0c013fffbbf0: 00 00 00 07 fa fa 00 00 00 03 fa fa 00 00 00 00\r\nShadow byte legend (one shadow byte represents 8 application bytes):\r\n  Addressable:           00\r\n  Partially addressable: 01 02 03 04 05 06 07 \r\n  Heap left redzone:     fa\r\n  Heap righ redzone:     fb\r\n  Freed Heap region:     fd\r\n  Stack left redzone:    f1\r\n  Stack mid redzone:     f2\r\n  Stack right redzone:   f3\r\n  Stack partial redzone: f4\r\n  Stack after return:    f5\r\n  Stack use after scope: f8\r\n  Global redzone:        f9\r\n  Global init order:     f6\r\n  Poisoned by user:      f7\r\n  ASan internal:         fe\r\n==25042== ABORTING\r\n```\r\n\r\ntestcase:\r\nhttps://github.com/henices/pocs/raw/master/Magick_png_read_raw_profile-heap-overflow"},"comment":{"url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/comments/346377032","html_url":"https://github.com/ImageMagick/ImageMagick/issues/872#issuecomment-346377032","issue_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/872","id":346377032,"user":{"login":"urban-warrior","id":12486802,"avatar_url":"https://avatars0.githubusercontent.com/u/12486802?v=4","gravatar_id":"","url":"https://api.github.com/users/urban-warrior","html_url":"https://github.com/urban-warrior","followers_url":"https://api.github.com/users/urban-warrior/followers","following_url":"https://api.github.com/users/urban-warrior/following{/other_user}","gists_url":"https://api.github.com/users/urban-warrior/gists{/gist_id}","starred_url":"https://api.github.com/users/urban-warrior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urban-warrior/subscriptions","organizations_url":"https://api.github.com/users/urban-warrior/orgs","repos_url":"https://api.github.com/users/urban-warrior/repos","events_url":"https://api.github.com/users/urban-warrior/events{/privacy}","received_events_url":"https://api.github.com/users/urban-warrior/received_events","type":"User","site_admin":false},"created_at":"2017-11-22T15:05:23Z","updated_at":"2017-11-22T15:05:23Z","author_association":"CONTRIBUTOR","body":"Thanks for the problem report.  We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today.  The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow. \r\n"}}
{"actor":{"display_login":"urban-warrior"}}