gstreamer/subprojects/gst-plugins-base/gst-libs/gst
Jeremy Cline 3ddb4c6f0e tagdemux: Fix crash when presented with malformed files
There's a race condition in gsttagdemux.c between typefinding and the
end-of-stream event. If TYPE_FIND_MAX_SIZE is exceeded,
demux->priv->collect is set to NULL and an error is returned. However,
the end-of-stream event causes one last attempt at typefinding to occur.

This leads to gst_tag_demux_trim_buffer() being called with the NULL
demux->priv->collect buffer which it attempts to dereference, resulting
in a segfault.

The malicious MP3 can be created by:

printf "\x49\x44\x33\x04\x00\x00\x00\x00\x00\x00%s", \
    "$(dd if=/dev/urandom bs=1K count=200)" > malicious.mp3

This creates a valid ID3 header which gets us as far as typefinding. The
crash can then be reproduced with the following pipeline:

gst-launch-1.0 -e filesrc location=malicious.mp3 ! queue ! decodebin ! audioconvert ! vorbisenc ! oggmux ! filesink location=malicious.ogg

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/967

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1620>
2022-02-01 19:04:40 +00:00
..
allocators gst-plugins-base: define G_LOG_DOMAIN for all libraries 2021-10-19 00:12:25 +00:00
app appsrc: log when segment changes 2021-11-09 16:19:05 +00:00
audio VideoInfo, AudioInfo: fix usage with python bindings 2022-01-27 08:36:46 +00:00
fft gst-plugins-base: define G_LOG_DOMAIN for all libraries 2021-10-19 00:12:25 +00:00
gl gstglutils: introspection annotations fixups 2022-01-12 12:11:47 +00:00
pbutils codec-utils: Mark various string return values as nullable 2022-01-19 11:05:26 +02:00
riff gst-plugins-base: define G_LOG_DOMAIN for all libraries 2021-10-19 00:12:25 +00:00
rtp rtphdrext: Return non-floating references from gst_rtp_header_extension_create_from_uri() 2022-01-27 14:43:41 +00:00
rtsp gst-plugins-base: define G_LOG_DOMAIN for all libraries 2021-10-19 00:12:25 +00:00
sdp Add FEC SDP message test 2022-01-19 16:05:11 +00:00
tag tagdemux: Fix crash when presented with malformed files 2022-02-01 19:04:40 +00:00
video VideoInfo, AudioInfo: fix usage with python bindings 2022-01-27 08:36:46 +00:00
gettext.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
glib-compat-private.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gst-i18n-app.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gst-i18n-plugin.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
meson.build sdp: Handle level-asymmetry-allowed for H264 streams 2021-12-12 10:59:00 -03:00