{"id":776,"date":"2016-10-20T09:42:14","date_gmt":"2016-10-20T07:42:14","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=776"},"modified":"2017-03-13T12:30:44","modified_gmt":"2017-03-13T10:30:44","slug":"jasper-null-pointer-dereference-in-jpc_tsfb_synthesize-jpc_tsfb-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2016\/10\/20\/jasper-null-pointer-dereference-in-jpc_tsfb_synthesize-jpc_tsfb-c\/","title":{"rendered":"jasper: NULL pointer dereference in jpc_tsfb_synthesize (jpc_tsfb.c)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"http:\/\/www.ece.uvic.ca\/~frodo\/jasper\/\">jasper<\/a> is an open-source initiative to provide a free software-based reference implementation of the codec specified in the JPEG-2000 Part-1 standard.<\/p>\n<p>Another round of fuzzing on an updated version (1.900.5) revealed another NULL pointer access<\/p>\n<p>The complete ASan output:<\/p>\n<pre><font size=\"2\"># imginfo -f $FILE\r\nwarning: trailing garbage in marker segment (14 bytes)\r\nwarning: not enough tile data (15 bytes)\r\nwarning: bad segmentation symbol\r\nwarning: bad segmentation symbol\r\nASAN:DEADLYSIGNAL\r\n=================================================================\r\n==7144==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f6d3c37d0b0 bp 0x7ffdc7407a90 sp 0x7ffdc7407a30 T0)\r\n    #0 0x7f6d3c37d0af in jpc_tsfb_synthesize \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/libjasper\/jpc\/jpc_tsfb.c:152:4\r\n    #1 0x7f6d3c2f5140 in jpc_dec_tiledecode \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/libjasper\/jpc\/jpc_dec.c:1068:3\r\n    #2 0x7f6d3c2e5c40 in jpc_dec_process_sod \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/libjasper\/jpc\/jpc_dec.c:623:7\r\n    #3 0x7f6d3c2ef294 in jpc_dec_decode \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/libjasper\/jpc\/jpc_dec.c:390:10\r\n    #4 0x7f6d3c2ef294 in jpc_decode \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/libjasper\/jpc\/jpc_dec.c:254\r\n    #5 0x7f6d3c2bd061 in jp2_decode \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/libjasper\/jp2\/jp2_dec.c:215:21\r\n    #6 0x7f6d3c24df39 in jas_image_decode \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/libjasper\/base\/jas_image.c:380:16\r\n    #7 0x4f1686 in main \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/appl\/imginfo.c:188:16\r\n    #8 0x7f6d3b35c61f in __libc_start_main \/var\/tmp\/portage\/sys-libs\/glibc-2.22-r4\/work\/glibc-2.22\/csu\/libc-start.c:289                                                                                                                                                        \r\n    #9 0x418e68 in _init (\/usr\/bin\/imginfo+0x418e68)                                                                                                                                                                                                                           \r\n\r\nAddressSanitizer can not provide additional info.                                                                                                                                                                                                                              \r\nSUMMARY: AddressSanitizer: SEGV \/tmp\/portage\/media-libs\/jasper-1.900.5\/work\/jasper-1.900.5\/src\/libjasper\/jpc\/jpc_tsfb.c:152:4 in jpc_tsfb_synthesize                                                                                                                           \r\n==7144==ABORTING\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n1.900.5<\/p>\n<p><strong>Fixed version:<\/strong><br \/>\n1.900.9<\/p>\n<p><strong>Commit fix:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/mdadams\/jasper\/commit\/2e82fa00466ae525339754bb3ab0a0474a31d4bd\">https:\/\/github.com\/mdadams\/jasper\/commit\/2e82fa00466ae525339754bb3ab0a0474a31d4bd<\/a><\/p>\n<p><strong>Credit:<\/strong><br \/>\nThis bug was discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>CVE:<\/strong><br \/>\nCVE-2016-10248<\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2016-10-19: bug discovered<br \/>\n2016-10-19: bug reported to upstream<br \/>\n2016-10-20: upstream released the patch and 1.900.9<br \/>\n2016-10-20: blog post about the issue<br \/>\n2017-03-12: CVE assigned<\/p>\n<p><strong>Note:<\/strong><br \/>\nThis bug was found with <a href=\"http:\/\/lcamtuf.coredump.cx\/afl\">American Fuzzy Lop<\/a>.<\/p>\n<p><strong>Permalink:<\/strong><\/p>\n<blockquote data-secret=\"tMj7Kns1tz\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2016\/10\/20\/jasper-null-pointer-dereference-in-jpc_tsfb_synthesize-jpc_tsfb-c\/\">jasper: NULL pointer dereference in jpc_tsfb_synthesize (jpc_tsfb.c)<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/blogs.gentoo.org\/ago\/2016\/10\/20\/jasper-null-pointer-dereference-in-jpc_tsfb_synthesize-jpc_tsfb-c\/embed\/#?secret=tMj7Kns1tz\" data-secret=\"tMj7Kns1tz\" width=\"600\" height=\"338\" title=\"&#8220;jasper: NULL pointer dereference in jpc_tsfb_synthesize (jpc_tsfb.c)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: jasper is an open-source initiative to provide a free software-based reference implementation of the codec specified in the JPEG-2000 Part-1 standard. Another round of fuzzing on an updated version (1.900.5) revealed another NULL pointer access The complete ASan output: &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2016\/10\/20\/jasper-null-pointer-dereference-in-jpc_tsfb_synthesize-jpc_tsfb-c\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":140,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[12,10],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2EaBc-cw","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/776"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/comments?post=776"}],"version-history":[{"count":3,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/776\/revisions"}],"predecessor-version":[{"id":1465,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/776\/revisions\/1465"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}