diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2025-06-18 10:59:41 +0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-06-25 08:11:57 -0700 |
| commit | 467cc324399501ec6e3c14c28ff72ec97bcc6ae5 (patch) | |
| tree | a12b5907aecf5ae7f73476de45cb98526c336552 /meta/recipes-support | |
| parent | 16168960c4881b3eeae9def8c15dbe4dab0b143e (diff) | |
| download | poky-467cc324399501ec6e3c14c28ff72ec97bcc6ae5.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: 5a6af5bcbe45184e7ac0535549c25cbe64113ba7)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-support')
| -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.2.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.2.bb b/meta/recipes-support/libsoup/libsoup-2.4_2.74.2.bb index 61ebebeacd..11552df80a 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 | |||
| @@ -37,6 +37,7 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ | |||
| 37 | file://CVE-2025-32050.patch \ | 37 | file://CVE-2025-32050.patch \ |
| 38 | file://CVE-2025-32052.patch \ | 38 | file://CVE-2025-32052.patch \ |
| 39 | file://CVE-2025-32053.patch \ | 39 | file://CVE-2025-32053.patch \ |
| 40 | file://CVE-2025-4969.patch \ | ||
| 40 | " | 41 | " |
| 41 | SRC_URI[sha256sum] = "f0a427656e5fe19e1df71c107e88dfa1b2e673c25c547b7823b6018b40d01159" | 42 | SRC_URI[sha256sum] = "f0a427656e5fe19e1df71c107e88dfa1b2e673c25c547b7823b6018b40d01159" |
| 42 | 43 | ||
