summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2025-32911_CVE-2025-32913-1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2025-32911_CVE-2025-32913-1.patch')
-rw-r--r--meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2025-32911_CVE-2025-32913-1.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2025-32911_CVE-2025-32913-1.patch b/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2025-32911_CVE-2025-32913-1.patch
new file mode 100644
index 0000000000..4e1d8212f5
--- /dev/null
+++ b/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2025-32911_CVE-2025-32913-1.patch
@@ -0,0 +1,72 @@
1From 7b4ef0e004ece3a308ccfaa714c284f4c96ade34 Mon Sep 17 00:00:00 2001
2From: Patrick Griffis <pgriffis@igalia.com>
3Date: Fri, 27 Dec 2024 17:53:50 -0600
4Subject: [PATCH] soup_message_headers_get_content_disposition: Fix NULL deref
5
6Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/7b4ef0e004ece3a308ccfaa714c284f4c96ade34]
7CVE: CVE-2025-32911 CVE-2025-32913 #Dependency Patch
8Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
9---
10 libsoup/soup-message-headers.c | 13 +++++++++----
11 tests/header-parsing-test.c | 14 ++++++++++++++
12 2 files changed, 23 insertions(+), 4 deletions(-)
13
14diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c
15index 56cc1e9d..04f4c302 100644
16--- a/libsoup/soup-message-headers.c
17+++ b/libsoup/soup-message-headers.c
18@@ -1660,10 +1660,15 @@ soup_message_headers_get_content_disposition (SoupMessageHeaders *hdrs,
19 */
20 if (params && g_hash_table_lookup_extended (*params, "filename",
21 &orig_key, &orig_value)) {
22- char *filename = strrchr (orig_value, '/');
23-
24- if (filename)
25- g_hash_table_insert (*params, g_strdup (orig_key), filename + 1);
26+ if (orig_value) {
27+ char *filename = strrchr (orig_value, '/');
28+
29+ if (filename)
30+ g_hash_table_insert (*params, g_strdup (orig_key), filename + 1);
31+ } else {
32+ /* filename with no value isn't valid. */
33+ g_hash_table_remove (*params, "filename");
34+ }
35 }
36 return TRUE;
37 }
38diff --git a/tests/header-parsing-test.c b/tests/header-parsing-test.c
39index 5e423d2b..d0b360c8 100644
40--- a/tests/header-parsing-test.c
41+++ b/tests/header-parsing-test.c
42@@ -1039,6 +1039,7 @@ do_param_list_tests (void)
43 #define RFC5987_TEST_HEADER_FALLBACK "attachment; filename*=Unknown''t%FF%FF%FFst.txt; filename=\"test.txt\""
44 #define RFC5987_TEST_HEADER_NO_TYPE "filename=\"test.txt\""
45 #define RFC5987_TEST_HEADER_NO_TYPE_2 "filename=\"test.txt\"; foo=bar"
46+#define RFC5987_TEST_HEADER_EMPTY_FILENAME ";filename"
47
48 static void
49 do_content_disposition_tests (void)
50@@ -1139,6 +1140,19 @@ do_content_disposition_tests (void)
51 g_assert_cmpstr (parameter2, ==, "bar");
52 g_hash_table_destroy (params);
53
54+ /* Empty filename */
55+ soup_message_headers_clear (hdrs);
56+ soup_message_headers_append (hdrs, "Content-Disposition",
57+ RFC5987_TEST_HEADER_EMPTY_FILENAME);
58+ if (!soup_message_headers_get_content_disposition (hdrs,
59+ &disposition,
60+ &params)) {
61+ soup_test_assert (FALSE, "empty filename decoding FAILED");
62+ return;
63+ }
64+ g_assert_false (g_hash_table_contains (params, "filename"));
65+ g_hash_table_destroy (params);
66+
67 soup_message_headers_unref (hdrs);
68
69 /* Ensure that soup-multipart always quotes filename */
70--
71GitLab
72