diff options
| author | Vijay Anusuri <vanusuri@mvista.com> | 2025-05-22 15:30:26 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-05-28 08:46:32 -0700 |
| commit | d8278fd9f9982eeaa8c3cf600898b992bd577e28 (patch) | |
| tree | 67f7013b58cd1ef39d402300de841dd91b77739f | |
| parent | 21bb9c063bef364e203cc048c434cce55469b631 (diff) | |
| download | poky-d8278fd9f9982eeaa8c3cf600898b992bd577e28.tar.gz | |
libsoup-2.4: Fix CVE-2025-32911 & CVE-2025-32913
Upstream-Status: Backport from
https://gitlab.gnome.org/GNOME/libsoup/-/commit/7b4ef0e004ece3a308ccfaa714c284f4c96ade34
& https://gitlab.gnome.org/GNOME/libsoup/-/commit/f4a761fb66512fff59798765e8ac5b9e57dceef0
(From OE-Core rev: ff1896b14347c7b4a166716338d3822da97be2e4)
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
3 files changed, 118 insertions, 0 deletions
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-32911_CVE-2025-32913-1.patch b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-32911_CVE-2025-32913-1.patch new file mode 100644 index 0000000000..4652635294 --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-32911_CVE-2025-32913-1.patch | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | From 7b4ef0e004ece3a308ccfaa714c284f4c96ade34 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Patrick Griffis <pgriffis@igalia.com> | ||
| 3 | Date: Fri, 27 Dec 2024 17:53:50 -0600 | ||
| 4 | Subject: [PATCH] soup_message_headers_get_content_disposition: Fix NULL deref | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/7b4ef0e004ece3a308ccfaa714c284f4c96ade34] | ||
| 7 | CVE: CVE-2025-32911 CVE-2025-32913 #Dependency Patch | ||
| 8 | Signed-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 | |||
| 14 | diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c | ||
| 15 | index 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 | } | ||
| 38 | diff --git a/tests/header-parsing-test.c b/tests/header-parsing-test.c | ||
| 39 | index 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 | + ¶ms)) { | ||
| 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_free (hdrs); | ||
| 68 | |||
| 69 | /* Ensure that soup-multipart always quotes filename */ | ||
| 70 | -- | ||
| 71 | GitLab | ||
| 72 | |||
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-32911_CVE-2025-32913-2.patch b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-32911_CVE-2025-32913-2.patch new file mode 100644 index 0000000000..5d9f33c736 --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-32911_CVE-2025-32913-2.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | From f4a761fb66512fff59798765e8ac5b9e57dceef0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Patrick Griffis <pgriffis@igalia.com> | ||
| 3 | Date: Fri, 27 Dec 2024 18:00:39 -0600 | ||
| 4 | Subject: [PATCH] soup_message_headers_get_content_disposition: strdup | ||
| 5 | truncated filenames | ||
| 6 | |||
| 7 | This table frees the strings it contains. | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/f4a761fb66512fff59798765e8ac5b9e57dceef0] | ||
| 10 | CVE: CVE-2025-32911 CVE-2025-32913 | ||
| 11 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 12 | --- | ||
| 13 | libsoup/soup-message-headers.c | 2 +- | ||
| 14 | tests/header-parsing-test.c | 1 + | ||
| 15 | 2 files changed, 2 insertions(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c | ||
| 18 | index 04f4c302..ee7a3cb1 100644 | ||
| 19 | --- a/libsoup/soup-message-headers.c | ||
| 20 | +++ b/libsoup/soup-message-headers.c | ||
| 21 | @@ -1664,7 +1664,7 @@ soup_message_headers_get_content_disposition (SoupMessageHeaders *hdrs, | ||
| 22 | char *filename = strrchr (orig_value, '/'); | ||
| 23 | |||
| 24 | if (filename) | ||
| 25 | - g_hash_table_insert (*params, g_strdup (orig_key), filename + 1); | ||
| 26 | + g_hash_table_insert (*params, g_strdup (orig_key), g_strdup (filename + 1)); | ||
| 27 | } else { | ||
| 28 | /* filename with no value isn't valid. */ | ||
| 29 | g_hash_table_remove (*params, "filename"); | ||
| 30 | diff --git a/tests/header-parsing-test.c b/tests/header-parsing-test.c | ||
| 31 | index d0b360c8..07ea2866 100644 | ||
| 32 | --- a/tests/header-parsing-test.c | ||
| 33 | +++ b/tests/header-parsing-test.c | ||
| 34 | @@ -1150,6 +1150,7 @@ do_content_disposition_tests (void) | ||
| 35 | soup_test_assert (FALSE, "empty filename decoding FAILED"); | ||
| 36 | return; | ||
| 37 | } | ||
| 38 | + g_free (disposition); | ||
| 39 | g_assert_false (g_hash_table_contains (params, "filename")); | ||
| 40 | g_hash_table_destroy (params); | ||
| 41 | |||
| 42 | -- | ||
| 43 | GitLab | ||
| 44 | |||
diff --git a/meta/recipes-support/libsoup/libsoup-2.4_2.74.2.bb b/meta/recipes-support/libsoup/libsoup-2.4_2.74.2.bb index 517a8e4539..4e7667402b 100644 --- a/meta/recipes-support/libsoup/libsoup-2.4_2.74.2.bb +++ b/meta/recipes-support/libsoup/libsoup-2.4_2.74.2.bb | |||
| @@ -26,6 +26,8 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ | |||
| 26 | file://CVE-2025-32910-1.patch \ | 26 | file://CVE-2025-32910-1.patch \ |
| 27 | file://CVE-2025-32910-2.patch \ | 27 | file://CVE-2025-32910-2.patch \ |
| 28 | file://CVE-2025-32910-3.patch \ | 28 | file://CVE-2025-32910-3.patch \ |
| 29 | file://CVE-2025-32911_CVE-2025-32913-1.patch \ | ||
| 30 | file://CVE-2025-32911_CVE-2025-32913-2.patch \ | ||
| 29 | " | 31 | " |
| 30 | SRC_URI[sha256sum] = "f0a427656e5fe19e1df71c107e88dfa1b2e673c25c547b7823b6018b40d01159" | 32 | SRC_URI[sha256sum] = "f0a427656e5fe19e1df71c107e88dfa1b2e673c25c547b7823b6018b40d01159" |
| 31 | 33 | ||
