summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-id3v2-Don-t-try-parsing-extended-header-if-not-enoug.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-id3v2-Don-t-try-parsing-extended-header-if-not-enoug.patch')
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-id3v2-Don-t-try-parsing-extended-header-if-not-enoug.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-id3v2-Don-t-try-parsing-extended-header-if-not-enoug.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-id3v2-Don-t-try-parsing-extended-header-if-not-enoug.patch
new file mode 100644
index 0000000000..4b514ff875
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-id3v2-Don-t-try-parsing-extended-header-if-not-enoug.patch
@@ -0,0 +1,64 @@
1From 537161868f36048571f400648ac7909f26c73d53 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
3Date: Thu, 26 Sep 2024 13:43:06 +0300
4Subject: [PATCH] id3v2: Don't try parsing extended header if not enough data
5 is available
6
7Thanks to Antonio Morales for finding and reporting the issue.
8
9Fixes GHSL-2024-235
10Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3842
11
12Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8033>
13
14CVE: CVE-2024-47542
15Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/537161868f36048571f400648ac7909f26c73d53]
16Signed-off-by: Peter Marko <peter.marko@siemens.com>
17---
18 gst-libs/gst/tag/id3v2.c | 11 ++++++++---
19 1 file changed, 8 insertions(+), 3 deletions(-)
20
21diff --git a/gst-libs/gst/tag/id3v2.c b/gst-libs/gst/tag/id3v2.c
22index 7db2cb7e12..70f975d133 100644
23--- a/gst-libs/gst/tag/id3v2.c
24+++ b/gst-libs/gst/tag/id3v2.c
25@@ -29,7 +29,7 @@
26
27 #define HANDLE_INVALID_SYNCSAFE
28
29-static gboolean id3v2_frames_to_tag_list (ID3TagsWorking * work, guint size);
30+static gboolean id3v2_frames_to_tag_list (ID3TagsWorking * work);
31
32 #ifndef GST_DISABLE_GST_DEBUG
33
34@@ -258,7 +258,7 @@ gst_tag_list_from_id3v2_tag (GstBuffer * buffer)
35 GST_MEMDUMP ("ID3v2 tag (un-unsyced)", uu_data, work.hdr.frame_data_size);
36 }
37
38- id3v2_frames_to_tag_list (&work, work.hdr.frame_data_size);
39+ id3v2_frames_to_tag_list (&work);
40
41 g_free (uu_data);
42
43@@ -440,12 +440,17 @@ id3v2_add_id3v2_frame_blob_to_taglist (ID3TagsWorking * work,
44 }
45
46 static gboolean
47-id3v2_frames_to_tag_list (ID3TagsWorking * work, guint size)
48+id3v2_frames_to_tag_list (ID3TagsWorking * work)
49 {
50 guint frame_hdr_size;
51
52 /* Extended header if present */
53 if (work->hdr.flags & ID3V2_HDR_FLAG_EXTHDR) {
54+ if (work->hdr.frame_data_size < 4) {
55+ GST_DEBUG ("Tag has no extended header data. Broken tag");
56+ return FALSE;
57+ }
58+
59 work->hdr.ext_hdr_size = id3v2_read_synch_uint (work->hdr.frame_data, 4);
60
61 /* In id3v2.4.x the header size is the size of the *whole*
62--
632.30.2
64