diff options
| author | Changqing Li <changqing.li@windriver.com> | 2025-04-30 15:50:21 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-01 14:22:54 +0100 |
| commit | e5902fa07b5d4874533e5a87ebbe9d4b0e66c3c0 (patch) | |
| tree | d27c9c5164150c44367d75727bf3251422f442af /meta/recipes-support | |
| parent | 6a17b9f352e40dfa21e881b1f7ab47cda92f21cf (diff) | |
| download | poky-e5902fa07b5d4874533e5a87ebbe9d4b0e66c3c0.tar.gz | |
libsoup-2.4: fix CVE-2025-32911
CVE-2025-32911:
A use-after-free type vulnerability was found in libsoup, in the
soup_message_headers_get_content_disposition() function. This flaw
allows a malicious HTTP client to cause memory corruption in the libsoup
server.
Backport patches to fix it
[1] https://nvd.nist.gov/vuln/detail/CVE-2025-32911
[2] https://gitlab.gnome.org/GNOME/libsoup/-/issues/433
(From OE-Core rev: 839d93bbb1ca7a51b659b8cb9def9b354a99518f)
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
| -rw-r--r-- | meta/recipes-support/libsoup/libsoup-2.4/0001-CVE-2025-32911.patch | 74 | ||||
| -rw-r--r-- | meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb | 3 |
2 files changed, 76 insertions, 1 deletions
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/0001-CVE-2025-32911.patch b/meta/recipes-support/libsoup/libsoup-2.4/0001-CVE-2025-32911.patch new file mode 100644 index 0000000000..9ef0643837 --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/0001-CVE-2025-32911.patch | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | From 52c5859b82fe79f2c32d883e048d218e0d7f2182 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Changqing Li <changqing.li@windriver.com> | ||
| 3 | Date: Wed, 30 Apr 2025 14:59:55 +0800 | ||
| 4 | Subject: [PATCH] CVE-2025-32911 | ||
| 5 | |||
| 6 | CVE: CVE-2025-32911 | ||
| 7 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/422/commits] | ||
| 8 | |||
| 9 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 10 | --- | ||
| 11 | libsoup/soup-message-headers.c | 13 +++++++++---- | ||
| 12 | tests/header-parsing-test.c | 15 +++++++++++++++ | ||
| 13 | 2 files changed, 24 insertions(+), 4 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c | ||
| 16 | index 39ad14a..78b2455 100644 | ||
| 17 | --- a/libsoup/soup-message-headers.c | ||
| 18 | +++ b/libsoup/soup-message-headers.c | ||
| 19 | @@ -1454,10 +1454,15 @@ soup_message_headers_get_content_disposition (SoupMessageHeaders *hdrs, | ||
| 20 | */ | ||
| 21 | if (params && g_hash_table_lookup_extended (*params, "filename", | ||
| 22 | &orig_key, &orig_value)) { | ||
| 23 | - char *filename = strrchr (orig_value, '/'); | ||
| 24 | - | ||
| 25 | - if (filename) | ||
| 26 | - g_hash_table_insert (*params, g_strdup (orig_key), filename + 1); | ||
| 27 | + if (orig_value) { | ||
| 28 | + char *filename = strrchr (orig_value, '/'); | ||
| 29 | + | ||
| 30 | + if (filename) | ||
| 31 | + g_hash_table_insert (*params, g_strdup (orig_key), g_strdup(filename + 1)); | ||
| 32 | + } else { | ||
| 33 | + /* filename with no value isn't valid. */ | ||
| 34 | + g_hash_table_remove (*params, "filename"); | ||
| 35 | + } | ||
| 36 | } | ||
| 37 | return TRUE; | ||
| 38 | } | ||
| 39 | diff --git a/tests/header-parsing-test.c b/tests/header-parsing-test.c | ||
| 40 | index 946f118..752196e 100644 | ||
| 41 | --- a/tests/header-parsing-test.c | ||
| 42 | +++ b/tests/header-parsing-test.c | ||
| 43 | @@ -1034,6 +1034,7 @@ do_param_list_tests (void) | ||
| 44 | #define RFC5987_TEST_HEADER_FALLBACK "attachment; filename*=Unknown''t%FF%FF%FFst.txt; filename=\"test.txt\"" | ||
| 45 | #define RFC5987_TEST_HEADER_NO_TYPE "filename=\"test.txt\"" | ||
| 46 | #define RFC5987_TEST_HEADER_NO_TYPE_2 "filename=\"test.txt\"; foo=bar" | ||
| 47 | +#define RFC5987_TEST_HEADER_EMPTY_FILENAME ";filename" | ||
| 48 | |||
| 49 | static void | ||
| 50 | do_content_disposition_tests (void) | ||
| 51 | @@ -1133,6 +1134,20 @@ do_content_disposition_tests (void) | ||
| 52 | g_assert_cmpstr (filename, ==, RFC5987_TEST_FALLBACK_FILENAME); | ||
| 53 | parameter2 = g_hash_table_lookup (params, "foo"); | ||
| 54 | g_assert_cmpstr (parameter2, ==, "bar"); | ||
| 55 | + g_hash_table_destroy (params); | ||
| 56 | + | ||
| 57 | + /* Empty filename */ | ||
| 58 | + soup_message_headers_clear (hdrs); | ||
| 59 | + soup_message_headers_append (hdrs, "Content-Disposition", | ||
| 60 | + RFC5987_TEST_HEADER_EMPTY_FILENAME); | ||
| 61 | + if (!soup_message_headers_get_content_disposition (hdrs, | ||
| 62 | + &disposition, | ||
| 63 | + ¶ms)) { | ||
| 64 | + soup_test_assert (FALSE, "empty filename decoding FAILED"); | ||
| 65 | + return; | ||
| 66 | + } | ||
| 67 | + g_free (disposition); | ||
| 68 | + g_assert_false (g_hash_table_contains (params, "filename")); | ||
| 69 | g_hash_table_destroy (params); | ||
| 70 | |||
| 71 | soup_message_headers_free (hdrs); | ||
| 72 | -- | ||
| 73 | 2.34.1 | ||
| 74 | |||
diff --git a/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb b/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb index ee20530b64..25e0d7dcbc 100644 --- a/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb +++ b/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb | |||
| @@ -12,7 +12,8 @@ DEPENDS = "glib-2.0 glib-2.0-native libxml2 sqlite3 libpsl" | |||
| 12 | SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" | 12 | SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" |
| 13 | 13 | ||
| 14 | SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ | 14 | SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ |
| 15 | file://0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch" | 15 | file://0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch \ |
| 16 | file://0001-CVE-2025-32911.patch" | ||
| 16 | SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13" | 17 | SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13" |
| 17 | 18 | ||
| 18 | CVE_PRODUCT = "libsoup" | 19 | CVE_PRODUCT = "libsoup" |
