diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2025-05-28 11:42:30 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-06-05 08:41:15 -0700 |
| commit | d56536a6185c532c618348aa1e13a8688106af03 (patch) | |
| tree | e56ff91738684a4d940dbbeb4b8d2ea3125a3c99 /meta | |
| parent | edc0010d0dba7e1ea620df805d1c76212662b104 (diff) | |
| download | poky-d56536a6185c532c618348aa1e13a8688106af03.tar.gz | |
libsoup-2.4: Fix CVE-2025-4969
Upstream-Status: Backport from https://gitlab.gnome.org/GNOME/libsoup/-/commit/07b94e27afafebf31ef3cd868866a1e383750086
(From OE-Core rev: 565ce534e6061913978c7e42dac6b2ff34169b85)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-4969.patch | 76 | ||||
| -rw-r--r-- | meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb | 1 |
2 files changed, 77 insertions, 0 deletions
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-4969.patch b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-4969.patch new file mode 100644 index 0000000000..d45b2a2cb0 --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2025-4969.patch | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | From 07b94e27afafebf31ef3cd868866a1e383750086 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Milan Crha <mcrha@redhat.com> | ||
| 3 | Date: Mon, 19 May 2025 17:48:27 +0200 | ||
| 4 | Subject: [PATCH] soup-multipart: Verify array bounds before accessing its | ||
| 5 | members | ||
| 6 | |||
| 7 | The boundary could be at a place which, calculated, pointed | ||
| 8 | before the beginning of the array. Check the bounds, to avoid | ||
| 9 | read out of the array bounds. | ||
| 10 | |||
| 11 | Closes https://gitlab.gnome.org/GNOME/libsoup/-/issues/447 | ||
| 12 | |||
| 13 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/07b94e27afafebf31ef3cd868866a1e383750086] | ||
| 14 | CVE: CVE-2025-4969 | ||
| 15 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 16 | --- | ||
| 17 | libsoup/soup-multipart.c | 2 +- | ||
| 18 | tests/multipart-test.c | 22 ++++++++++++++++++++++ | ||
| 19 | 2 files changed, 23 insertions(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/libsoup/soup-multipart.c b/libsoup/soup-multipart.c | ||
| 22 | index dd93973..b3611db 100644 | ||
| 23 | --- a/libsoup/soup-multipart.c | ||
| 24 | +++ b/libsoup/soup-multipart.c | ||
| 25 | @@ -108,7 +108,7 @@ find_boundary (const char *start, const char *end, | ||
| 26 | continue; | ||
| 27 | |||
| 28 | /* Check that it's at start of line */ | ||
| 29 | - if (!(b == start || (b[-1] == '\n' && b[-2] == '\r'))) | ||
| 30 | + if (!(b == start || (b - start >= 2 && b[-1] == '\n' && b[-2] == '\r'))) | ||
| 31 | continue; | ||
| 32 | |||
| 33 | /* Check for "--" or "\r\n" after boundary */ | ||
| 34 | diff --git a/tests/multipart-test.c b/tests/multipart-test.c | ||
| 35 | index 834b181..980eb68 100644 | ||
| 36 | --- a/tests/multipart-test.c | ||
| 37 | +++ b/tests/multipart-test.c | ||
| 38 | @@ -562,6 +562,27 @@ test_multipart_bounds_bad (void) | ||
| 39 | g_bytes_unref (bytes); | ||
| 40 | } | ||
| 41 | |||
| 42 | +static void | ||
| 43 | +test_multipart_bounds_bad_2 (void) | ||
| 44 | +{ | ||
| 45 | + SoupMultipart *multipart; | ||
| 46 | + SoupMessageHeaders *headers; | ||
| 47 | + GBytes *bytes; | ||
| 48 | + const char *raw_data = "\n--123\r\nline\r\n--123--\r"; | ||
| 49 | + | ||
| 50 | + headers = soup_message_headers_new (SOUP_MESSAGE_HEADERS_MULTIPART); | ||
| 51 | + soup_message_headers_append (headers, "Content-Type", "multipart/mixed; boundary=\"123\""); | ||
| 52 | + | ||
| 53 | + bytes = g_bytes_new (raw_data, strlen (raw_data)); | ||
| 54 | + | ||
| 55 | + multipart = soup_multipart_new_from_message (headers, bytes); | ||
| 56 | + g_assert_nonnull (multipart); | ||
| 57 | + | ||
| 58 | + soup_multipart_free (multipart); | ||
| 59 | + soup_message_headers_free (headers); | ||
| 60 | + g_bytes_unref (bytes); | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | int | ||
| 64 | main (int argc, char **argv) | ||
| 65 | { | ||
| 66 | @@ -593,6 +614,7 @@ main (int argc, char **argv) | ||
| 67 | g_test_add_data_func ("/multipart/async-small-reads", GINT_TO_POINTER (ASYNC_MULTIPART_SMALL_READS), test_multipart); | ||
| 68 | g_test_add_func ("/multipart/bounds-good", test_multipart_bounds_good); | ||
| 69 | g_test_add_func ("/multipart/bounds-bad", test_multipart_bounds_bad); | ||
| 70 | + g_test_add_func ("/multipart/bounds-bad-2", test_multipart_bounds_bad_2); | ||
| 71 | |||
| 72 | ret = g_test_run (); | ||
| 73 | |||
| 74 | -- | ||
| 75 | 2.49.0 | ||
| 76 | |||
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 b986e2eea2..df97a68b9c 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 | |||
| @@ -31,6 +31,7 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ | |||
| 31 | file://CVE-2025-32912-1.patch \ | 31 | file://CVE-2025-32912-1.patch \ |
| 32 | file://CVE-2025-32912-2.patch \ | 32 | file://CVE-2025-32912-2.patch \ |
| 33 | file://CVE-2025-32914.patch \ | 33 | file://CVE-2025-32914.patch \ |
| 34 | file://CVE-2025-4969.patch \ | ||
| 34 | " | 35 | " |
| 35 | SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13" | 36 | SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13" |
| 36 | 37 | ||
