After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777500 - (CVE-2017-5841) avidemux: gst_avi_demux_parse_ncdt heap out of bounds read
(CVE-2017-5841)
avidemux: gst_avi_demux_parse_ncdt heap out of bounds read
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other Linux
: Normal normal
: 1.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-19 17:45 UTC by Hanno Böck
Modified: 2017-02-14 06:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
avidemux: Fix various out of bounds reads when parsing ncdt tags (1.65 KB, patch)
2017-01-20 05:58 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Hanno Böck 2017-01-19 17:45:48 UTC
This file causes a heap oob read in the current gstreamer git code:
https://samples.mplayerhq.hu/ffmpeg-bugs/trac/ticket3279/DSC_0131.AVI

asan stack trace:
==14052==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62500002cec2 at pc 0x7fd5ad70215f bp 0x7fd5ad44b410 sp 0x7fd5ad44b408
READ of size 4 at 0x62500002cec2 thread T2 (avidemux0:sink)
    #0 0x7fd5ad70215e in __gst_fast_read32 /usr/include/gstreamer-1.0/gst/gstutils.h:122:10
    #1 0x7fd5ad70215e in gst_avi_demux_parse_ncdt /f/gstreamer/gst-plugins-good/gst/avi/gstavidemux.c:3889
    #2 0x7fd5ad6ee49e in gst_avi_demux_stream_header_pull /f/gstreamer/gst-plugins-good/gst/avi/gstavidemux.c:4244:13
    #3 0x7fd5ad6e6786 in gst_avi_demux_loop /f/gstreamer/gst-plugins-good/gst/avi/gstavidemux.c:5687:13
    #4 0x7fd5ba9d0883 in gst_task_func /f/gstreamer/gstreamer/gst/gsttask.c:334:5
    #5 0x7fd5b9bcdb2d in g_thread_pool_thread_proxy /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthreadpool.c:307
    #6 0x7fd5b9bcd154 in g_thread_proxy /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthread.c:784
    #7 0x7fd5b964b453 in start_thread (/lib64/libpthread.so.0+0x7453)
    #8 0x7fd5b917b5dc in clone (/lib64/libc.so.6+0xe75dc)

0x62500002cec5 is located 0 bytes to the right of 9669-byte region [0x62500002a900,0x62500002cec5)
allocated by thread T2 (avidemux0:sink) here:
    #0 0x4cbbb8 in malloc (/usr/bin/gst-discoverer-1.0+0x4cbbb8)
    #1 0x7fd5b9bab768 in g_malloc /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gmem.c:94
    #2 0x7fd5b9bc34d2 in g_slice_alloc /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gslice.c:1025
    #3 0x7fd5ba7ec26c in _sysmem_new_block /f/gstreamer/gstreamer/gst/gstallocator.c:416:9
    #4 0x7fd5ba7ec26c in default_alloc /f/gstreamer/gstreamer/gst/gstallocator.c:515
    #5 0x7fd5ba7ea9a2 in gst_allocator_alloc /f/gstreamer/gstreamer/gst/gstallocator.c:313:11
    #6 0x7fd5ba81153c in gst_buffer_new_allocate /f/gstreamer/gstreamer/gst/gstbuffer.c:838:11
    #7 0x7fd5bae9d68c in gst_base_src_default_alloc /f/gstreamer/gstreamer/libs/gst/base/gstbasesrc.c:1439:15
    #8 0x7fd5bae9d076 in gst_base_src_default_create /f/gstreamer/gstreamer/libs/gst/base/gstbasesrc.c:1477:11
    #9 0x7fd5baea4233 in gst_base_src_get_range /f/gstreamer/gstreamer/libs/gst/base/gstbasesrc.c:2465:9
    #10 0x7fd5bae9fbb7 in gst_base_src_getrange /f/gstreamer/gstreamer/libs/gst/base/gstbasesrc.c:2633:9
    #11 0x7fd5ba90ce51 in gst_pad_get_range_unchecked /f/gstreamer/gstreamer/gst/gstpad.c:4665:9
    #12 0x7fd5ba90f64b in gst_pad_pull_range /f/gstreamer/gstreamer/gst/gstpad.c:4906:9
    #13 0x7fd5ba8b3c2a in gst_proxy_pad_getrange_default /f/gstreamer/gstreamer/gst/gstghostpad.c:184:9
    #14 0x7fd5ba90ce51 in gst_pad_get_range_unchecked /f/gstreamer/gstreamer/gst/gstpad.c:4665:9
    #15 0x7fd5ba90f64b in gst_pad_pull_range /f/gstreamer/gstreamer/gst/gstpad.c:4906:9
    #16 0x7fd5ba90ce51 in gst_pad_get_range_unchecked /f/gstreamer/gstreamer/gst/gstpad.c:4665:9
    #17 0x7fd5ba90f64b in gst_pad_pull_range /f/gstreamer/gstreamer/gst/gstpad.c:4906:9
    #18 0x7fd5ad46a8b5 in gst_riff_read_chunk /f/gstreamer/gst-plugins-base/gst-libs/gst/riff/riff-read.c:92:14
    #19 0x7fd5ad6ee137 in gst_avi_demux_stream_header_pull /f/gstreamer/gst-plugins-good/gst/avi/gstavidemux.c:4229:17
    #20 0x7fd5ad6e6786 in gst_avi_demux_loop /f/gstreamer/gst-plugins-good/gst/avi/gstavidemux.c:5687:13
    #21 0x7fd5ba9d0883 in gst_task_func /f/gstreamer/gstreamer/gst/gsttask.c:334:5
    #22 0x7fd5b9bcdb2d in g_thread_pool_thread_proxy /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthreadpool.c:307
    #23 0x7fd5b9bcd154 in g_thread_proxy /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthread.c:784
    #24 0x7fd5b964b453 in start_thread (/lib64/libpthread.so.0+0x7453)
    #25 0x7fd5b917b5dc in clone (/lib64/libc.so.6+0xe75dc)

Thread T2 (avidemux0:sink) created by T1 (typefind:sink) here:
    #0 0x42df2d in __interceptor_pthread_create (/usr/bin/gst-discoverer-1.0+0x42df2d)
    #1 0x7fd5b9bea1bf in g_system_thread_new /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthread-posix.c:1170

Thread T1 (typefind:sink) created by T0 here:
    #0 0x42df2d in __interceptor_pthread_create (/usr/bin/gst-discoverer-1.0+0x42df2d)
    #1 0x7fd5b9bea1bf in g_system_thread_new /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthread-posix.c:1170

SUMMARY: AddressSanitizer: heap-buffer-overflow /usr/include/gstreamer-1.0/gst/gstutils.h:122:10 in __gst_fast_read32
Comment 1 Sebastian Dröge (slomo) 2017-01-20 05:58:59 UTC
Created attachment 343859 [details] [review]
avidemux: Fix various out of bounds reads when parsing ncdt tags
Comment 2 Sebastian Dröge (slomo) 2017-01-20 10:42:37 UTC
Attachment 343859 [details] pushed as 32d9f3c - avidemux: Fix various out of bounds reads when parsing ncdt tags