libsoup-2.4: fix CVE-2026-1539
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/5 libsoup-2.4: fix CVE-2026-1539
Backport fix for CVE-2026-1539 from meta-oe to OE-core. Update CVE patch to restore the auth-redirect proxy validation unit test from the upstream libsoup3 patch.
(From meta-oe rev: 07d67228162018f5f619dce7183f85e79293378d)
---
Changes since v1:
- Resolved malformed patch lines
.../libsoup/libsoup-2.4/CVE-2026-1539.patch | 104 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 1 + 2 files changed, 105 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patch
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patch new file +104 -0
@@ -0,0 +1,104 @@ +From 285faea567e1e2a95226201175dbf745a64a2439 Mon Sep 17 00:00:00 2001 +From: Changqing Li <[email protected]> +Date: Fri, 20 Mar 2026 15:04:22 +0800 +Subject: [PATCH 4/4] Also remove Proxy-Authorization header on cross origin + redirect + +Closes #489 + +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/98c1285d9d78662c38bf14b4a128af01ccfdb446] +CVE: CVE-2026-1539 + +Signed-off-by: Changqing Li <[email protected]> + +Backport the auth-redirect proxy validation unit tests from the upstream +libsoup3 patch + +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-session.c | 1 + + tests/httpd.conf.in | 1 + + tests/proxy-test.c | 36 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 38 insertions(+) + +diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c +index fadd5cd2..4cad0946 100644 +--- a/libsoup/soup-session.c ++++ b/libsoup/soup-session.c +@@ -1192,6 +1192,7 @@ soup_session_redirect_message (SoupSession *session, SoupMessage *msg) + /* Strip all credentials on cross-origin redirect. */ + if (!soup_uri_host_equal (soup_message_get_uri (msg), new_uri)) { + soup_message_headers_remove (msg->request_headers, "Authorization"); ++ soup_message_headers_remove (msg->request_headers, "Proxy-Authorization"); + soup_message_set_auth (msg, NULL); + } + +diff --git a/tests/httpd.conf.in b/tests/httpd.conf.in +index 93fb7ff4..e190b6f7 100644 +--- a/tests/httpd.conf.in ++++ b/tests/httpd.conf.in +@@ -37,6 +37,7 @@ DirectoryIndex index.txt + TypesConfig /dev/null + AddType application/x-httpd-php .php + Redirect permanent /redirected /index.txt ++Redirect permanent /Basic/realm1/redirected https://127.0.0.1:47525/index.txt + + # Proxy #1: unauthenticated + Listen 127.0.0.1:47526 +diff --git a/tests/proxy-test.c b/tests/proxy-test.c +index 1d68aa05..105a02a6 100644 +--- a/tests/proxy-test.c ++++ b/tests/proxy-test.c +@@ -322,6 +322,41 @@ do_proxy_redirect_test (void) + soup_test_session_abort_unref (session); + } + ++static void proxy_auth_redirect_message_restarted (SoupMessage *msg) ++{ ++ if (msg->status_code != SOUP_STATUS_MOVED_PERMANENTLY) ++ return; ++ ++ g_assert_null (soup_message_headers_get_one (msg->request_headers, "Proxy-Authorization")); ++} ++ ++static void ++do_proxy_auth_redirect_test (void) ++{ ++ SoupSession *session; ++ SoupMessage *msg; ++ char *url; ++ ++ SOUP_TEST_SKIP_IF_NO_APACHE; ++ SOUP_TEST_SKIP_IF_NO_TLS; ++ ++ session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC, ++ SOUP_SESSION_PROXY_RESOLVER, proxy_resolvers[AUTH_PROXY], ++ NULL); ++ ++ url = g_strconcat (HTTP_SERVER, "/Basic/realm1/redirected", NULL); ++ msg = soup_message_new (SOUP_METHOD_GET, url); ++ g_signal_connect (session, "authenticate", G_CALLBACK (authenticate), NULL); ++ g_signal_connect (msg, "restarted", G_CALLBACK (proxy_auth_redirect_message_restarted), NULL); ++ ++ soup_session_send_message (session, msg); ++ soup_test_assert_message_status (msg, SOUP_STATUS_OK); ++ ++ g_free (url); ++ g_object_unref (msg); ++ soup_test_session_abort_unref (session); ++} ++ + static void + do_proxy_auth_request (const char *url, SoupSession *session, gboolean do_read) + { +@@ -433,6 +468,7 @@ main (int argc, char **argv) + + g_test_add_data_func ("/proxy/fragment", base_uri, do_proxy_fragment_test); + g_test_add_func ("/proxy/redirect", do_proxy_redirect_test); ++ g_test_add_func ("/proxy/auth-redirect", do_proxy_auth_redirect_test); + g_test_add_func ("/proxy/auth-cache", do_proxy_auth_cache_test); + + ret = g_test_run (); +-- +2.55.0 +
meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb +1 -0
@@ -41,6 +41,7 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ file://CVE-2025-4476.patch \ file://CVE-2025-2784.patch \ file://CVE-2025-4945.patch \ + file://CVE-2026-1539.patch \ " SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13"
Signature · 1 line
2.55.0
PATCH v2 2/5 libsoup-2.4: fix CVE-2026-1801
Backport fix for CVE-2026-1801 from meta-oe to OE-core. Update CVE patch to restore the chunked server validation unit test from the upstream libsoup3 patch (b9a1c0663ff8ab6e79715db4b35b54f560416ddd).
(From meta-oe rev: 07d67228162018f5f619dce7183f85e79293378d)
---
Changes since v1:
- Resolved malformed patch lines
.../libsoup/libsoup-2.4/CVE-2026-1801.patch | 217 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 1 + 2 files changed, 218 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch new file +217 -0
@@ -0,0 +1,217 @@ +From f9c933e258e9ef2f221cca6395f8092a1c4b93dd Mon Sep 17 00:00:00 2001 +From: Changqing Li <[email protected]> +Date: Thu, 19 Mar 2026 17:10:36 +0800 +Subject: [PATCH 2/4] Fix CVE-2026-1801 + +This patch merges 3 upstream patches + +Chery-pick the first two patches to make the context is the same as the +third patch that fix CVE-2026-1801 + +Upstream-Status: Backport +[https://gitlab.gnome.org/GNOME/libsoup/-/commit/1e32b5e123aa1689505472bdbfcbd897eac41977, +https://gitlab.gnome.org/GNOME/libsoup/-/commit/8a2e15c88512ae4517d2c2c887d39299725b22da, +https://gitlab.gnome.org/GNOME/libsoup/-/commit/b9a1c0663ff8ab6e79715db4b35b54f560416ddd] +CVE: CVE-2026-1801 + +Signed-off-by: Changqing Li <[email protected]> + +Backport the chunked server validation unit test from the upstream +libsoup3 patch (b9a1c0663ff8ab6e79715db4b35b54f560416ddd). + +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-body-input-stream.c | 66 +++++++++++++++++++------------ + tests/server-test.c | 67 ++++++++++++++++++++++++++++++++ + 2 files changed, 108 insertions(+), 25 deletions(-) + +diff --git a/libsoup/soup-body-input-stream.c b/libsoup/soup-body-input-stream.c +index 6b95884..25d9312 100644 +--- a/libsoup/soup-body-input-stream.c ++++ b/libsoup/soup-body-input-stream.c +@@ -159,15 +159,18 @@ soup_body_input_stream_read_chunked (SoupBodyInputStream *bistream, + again: + switch (bistream->priv->chunked_state) { + case SOUP_BODY_INPUT_STREAM_STATE_CHUNK_SIZE: +- nread = soup_filter_input_stream_read_line ( +- fstream, metabuf, sizeof (metabuf), blocking, +- &got_line, cancellable, error); +- if (nread <= 0) ++ nread = soup_filter_input_stream_read_until ( ++ fstream, metabuf, sizeof (metabuf), ++ "\r\n", 2, blocking, TRUE, ++ &got_line, cancellable, error); ++ if (nread < 0) + return nread; +- if (!got_line) { +- g_set_error_literal (error, G_IO_ERROR, +- G_IO_ERROR_PARTIAL_INPUT, +- _("Connection terminated unexpectedly")); ++ if (nread == 0 || !got_line) { ++ if (error && *error == NULL) { ++ g_set_error_literal (error, G_IO_ERROR, ++ G_IO_ERROR_PARTIAL_INPUT, ++ ("Connection terminated unexpectedly")); ++ } + return -1; + } + +@@ -180,9 +183,9 @@ again: + + case SOUP_BODY_INPUT_STREAM_STATE_CHUNK: + nread = soup_body_input_stream_read_raw ( +- bistream, buffer, +- MIN (count, bistream->priv->read_length), +- blocking, cancellable, error); ++ bistream, buffer, ++ MIN (count, bistream->priv->read_length), ++ blocking, cancellable, error); + if (nread > 0) { + bistream->priv->read_length -= nread; + if (bistream->priv->read_length == 0) +@@ -191,16 +194,19 @@ again: + return nread; + + case SOUP_BODY_INPUT_STREAM_STATE_CHUNK_END: +- nread = soup_filter_input_stream_read_line ( +- SOUP_FILTER_INPUT_STREAM (bistream->priv->base_stream), +- metabuf, sizeof (metabuf), blocking, +- &got_line, cancellable, error); +- if (nread <= 0) ++ nread = soup_filter_input_stream_read_until ( ++ SOUP_FILTER_INPUT_STREAM (bistream->priv->base_stream), ++ metabuf, sizeof (metabuf), ++ "\r\n", 2, blocking, TRUE, ++ &got_line, cancellable, error); ++ if (nread < 0) + return nread; +- if (!got_line) { +- g_set_error_literal (error, G_IO_ERROR, +- G_IO_ERROR_PARTIAL_INPUT, +- _("Connection terminated unexpectedly")); ++ if (nread == 0 || !got_line) { ++ if (error && *error == NULL) { ++ g_set_error_literal (error, G_IO_ERROR, ++ G_IO_ERROR_PARTIAL_INPUT, ++ _("Connection terminated unexpectedly")); ++ } + return -1; + } + +@@ -208,13 +214,23 @@ again: + break; + + case SOUP_BODY_INPUT_STREAM_STATE_TRAILERS: +- nread = soup_filter_input_stream_read_line ( +- fstream, buffer, count, blocking, +- &got_line, cancellable, error); +- if (nread <= 0) ++ nread = soup_filter_input_stream_read_until ( ++ fstream, metabuf, sizeof (metabuf), ++ "\r\n", 2, blocking, TRUE, ++ &got_line, cancellable, error); ++ if (nread < 0) + return nread; + +- if (strncmp (buffer, "\r\n", nread) || strncmp (buffer, "\n", nread)) { ++ if (nread == 0) { ++ if (error && *error == NULL) { ++ g_set_error_literal (error, G_IO_ERROR, ++ G_IO_ERROR_PARTIAL_INPUT, ++ _("Connection terminated unexpectedly")); ++ } ++ return -1; ++ } ++ ++ if (nread == 2 && strncmp (metabuf, "\r\n", nread) == 0) { + bistream->priv->chunked_state = SOUP_BODY_INPUT_STREAM_STATE_DONE; + bistream->priv->eof = TRUE; + } +diff --git a/tests/server-test.c b/tests/server-test.c +index 8976103e..fbe8bdcc 100644 +--- a/tests/server-test.c ++++ b/tests/server-test.c +@@ -1373,6 +1373,71 @@ do_steal_connect_test (ServerData *sd, gconstpointer test_data) + soup_uri_free (proxy_uri); + } + ++static void ++server_chunked_hundler (SoupServer *server, ++ SoupMessage *msg, ++ const char *path, ++ GHashTable *query, ++ gpointer data) ++{ ++ g_assert_true (msg->method == SOUP_METHOD_POST); ++ g_assert_cmpstr (path, ==, "/valid"); ++ ++ soup_message_set_status (msg, SOUP_STATUS_OK); ++ soup_message_set_response (msg, "text/plain", SOUP_MEMORY_STATIC, "index", 5); ++} ++ ++#define CHUNKED_FORMAT_REQUEST "POST /valid HTTP/1.1\r\nHost: 127.0.0.1\r\n%sGET /invalid HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n" ++ ++static void ++do_chunked_test (ServerData *sd, gconstpointer test_data) ++{ ++ gint i; ++ struct { ++ const char *description; ++ const char *test; ++ } tests[] = { ++ { "Lone LF", "Transfer-Encoding: chunked\r\n\r\n5;ext\n data\r\n0\r\n\r\n" }, ++ }; ++ ++ sd->server = soup_test_server_new (SOUP_TEST_SERVER_IN_THREAD); ++ sd->base_uri = soup_test_server_get_uri (sd->server, "http", NULL); ++ server_add_handler (sd, NULL, server_chunked_hundler, NULL, NULL); ++ ++ for (i = 0; i < G_N_ELEMENTS (tests); i++) { ++ GSocketClient *client; ++ GSocketConnection *conn; ++ GInputStream *input; ++ GOutputStream *output; ++ char *request; ++ char buffer[4096]; ++ gssize nread; ++ GError *error = NULL; ++ ++ debug_printf (1, " %s\n", tests[i].description); ++ ++ client = g_socket_client_new (); ++ conn = g_socket_client_connect_to_host (client, sd->base_uri->host, sd->base_uri->port, NULL, &error); ++ g_assert_no_error (error); ++ ++ request = g_strdup_printf (CHUNKED_FORMAT_REQUEST, tests[i].test); ++ ++ output = g_io_stream_get_output_stream (G_IO_STREAM (conn)); ++ g_output_stream_write_all (output, request, strlen (request), NULL, NULL, NULL); ++ g_output_stream_close (output, NULL, NULL); ++ g_socket_shutdown (g_socket_connection_get_socket (G_SOCKET_CONNECTION (conn)), FALSE, TRUE, &error); ++ ++ input = g_io_stream_get_input_stream (G_IO_STREAM (conn)); ++ do { ++ nread = g_input_stream_read (input, buffer, sizeof(buffer), NULL, NULL); ++ } while (nread > 0); ++ ++ g_free (request); ++ g_object_unref (conn); ++ g_object_unref (client); ++ } ++} ++ + int + main (int argc, char **argv) + { +@@ -1411,6 +1476,8 @@ main (int argc, char **argv) + server_setup_nohandler, do_early_multi_test, server_teardown); + g_test_add ("/server/steal/CONNECT", ServerData, NULL, + server_setup, do_steal_connect_test, server_teardown); ++ g_test_add ("/server/chunked", ServerData, NULL, ++ NULL, do_chunked_test, server_teardown); + + ret = g_test_run (); + +-- +2.55.0 +
meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb +1 -0
@@ -42,6 +42,7 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ file://CVE-2025-2784.patch \ file://CVE-2025-4945.patch \ file://CVE-2026-1539.patch \ + file://CVE-2026-1801.patch \ " SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13"
Signature · 1 line
2.55.0
Re: [OE-core] [scarthgap][PATCH v2 2/5] libsoup-2.4: fix CVE-2026-1801
Quoted 22 lines · Jason Stasiak via lists.openembedded.org
Backport fix for CVE-2026-1801 from meta-oe to OE-core. Update CVE patch to restore the chunked server validation unit test from the upstream libsoup3 patch (
b9a1c0663ff8ab6e79715db4b35b54f560416ddd).(From meta-oe rev:
07d67228162018f5f619dce7183f85e79293378d)Signed-off-by Jason Stasiak <[email protected]>---
Changes since v1:
- Resolved malformed patch lines.../libsoup/libsoup-2.4/CVE-2026-1801.patch | 217 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 1 + 2 files changed, 218 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patchmeta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch new file +0
-0
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch line 6
Quoted 6 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch new file +6
-0@@ -0,0 +1,217 @@ +From f9c933e258e9ef2f221cca6395f8092a1c4b93dd Mon Sep 17 00:00:00 2001 +From: Changqing Li <[email protected]> +Date: Thu, 19 Mar 2026 17:10:36 +0800 +Subject: [PATCH 2/4] Fix CVE-2026-1801 + +This patch merges 3 upstream patches
Please do not merge patches like this. Instead, backport the 3 patches into CVE-2026-1801-{01,02,03}.patch.
(Again, I know this is in the upstream meta-oe commit, but we simply have different review expectation)
Quoted 33 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch new file +33
-0+ +Chery-pick the first two patches to make the context is the same as the +third patch that fix CVE-2026-1801 + +Upstream-Status: Backport +[https://gitlab.gnome.org/GNOME/libsoup/-/commit/1e32b5e123aa1689505472bdbfcbd897eac41977, +https://gitlab.gnome.org/GNOME/libsoup/-/commit/8a2e15c88512ae4517d2c2c887d39299725b22da, +https://gitlab.gnome.org/GNOME/libsoup/-/commit/b9a1c0663ff8ab6e79715db4b35b54f560416ddd] +CVE: CVE-2026-1801 + +Signed-off-by: Changqing Li <[email protected]> + +Backport the chunked server validation unit test from the upstream +libsoup3 patch (b9a1c0663ff8ab6e79715db4b35b54f560416ddd). + +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-body-input-stream.c | 66 +++++++++++++++++++------------ + tests/server-test.c | 67 ++++++++++++++++++++++++++++++++ + 2 files changed, 108 insertions(+), 25 deletions(-) + +diff --git a/libsoup/soup-body-input-stream.c b/libsoup/soup-body-input-stream.c +index 6b95884..25d9312 100644 +--- a/libsoup/soup-body-input-stream.c ++++ b/libsoup/soup-body-input-stream.c +@@ -159,15 +159,18 @@ soup_body_input_stream_read_chunked (SoupBodyInputStream *bistream, + again: + switch (bistream->priv->chunked_state) { + case SOUP_BODY_INPUT_STREAM_STATE_CHUNK_SIZE: +- nread = soup_filter_input_stream_read_line ( +- fstream, metabuf, sizeof (metabuf), blocking, +- &got_line, cancellable, error); +- if (nread <= 0)
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch line 49
Quoted 10 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch new file +10
-0++ nread = soup_filter_input_stream_read_until ( ++ fstream, metabuf, sizeof (metabuf), ++ "\r\n", 2, blocking, TRUE, ++ &got_line, cancellable, error); ++ if (nread < 0) + return nread; +- if (!got_line) { +- g_set_error_literal (error, G_IO_ERROR, +- G_IO_ERROR_PARTIAL_INPUT, +- _("Connection terminated unexpectedly"));
^ This indentation is different from upstream.
Please avoid changing upstream patch if not needed.
Quoted 74 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch new file +74
-0++ if (nread == 0 || !got_line) { ++ if (error && *error == NULL) { ++ g_set_error_literal (error, G_IO_ERROR, ++ G_IO_ERROR_PARTIAL_INPUT, ++ ("Connection terminated unexpectedly")); ++ } + return -1; + } + +@@ -180,9 +183,9 @@ again: + + case SOUP_BODY_INPUT_STREAM_STATE_CHUNK: + nread = soup_body_input_stream_read_raw ( +- bistream, buffer, +- MIN (count, bistream->priv->read_length), +- blocking, cancellable, error); ++ bistream, buffer, ++ MIN (count, bistream->priv->read_length), ++ blocking, cancellable, error); + if (nread > 0) { + bistream->priv->read_length -= nread; + if (bistream->priv->read_length == 0) +@@ -191,16 +194,19 @@ again: + return nread; + + case SOUP_BODY_INPUT_STREAM_STATE_CHUNK_END: +- nread = soup_filter_input_stream_read_line ( +- SOUP_FILTER_INPUT_STREAM (bistream->priv->base_stream), +- metabuf, sizeof (metabuf), blocking, +- &got_line, cancellable, error); +- if (nread <= 0) ++ nread = soup_filter_input_stream_read_until ( ++ SOUP_FILTER_INPUT_STREAM (bistream->priv->base_stream), ++ metabuf, sizeof (metabuf), ++ "\r\n", 2, blocking, TRUE, ++ &got_line, cancellable, error); ++ if (nread < 0) + return nread; +- if (!got_line) { +- g_set_error_literal (error, G_IO_ERROR, +- G_IO_ERROR_PARTIAL_INPUT, +- _("Connection terminated unexpectedly")); ++ if (nread == 0 || !got_line) { ++ if (error && *error == NULL) { ++ g_set_error_literal (error, G_IO_ERROR, ++ G_IO_ERROR_PARTIAL_INPUT, ++ _("Connection terminated unexpectedly")); ++ } + return -1; + } + +@@ -208,13 +214,23 @@ again: + break; + + case SOUP_BODY_INPUT_STREAM_STATE_TRAILERS: +- nread = soup_filter_input_stream_read_line ( +- fstream, buffer, count, blocking, +- &got_line, cancellable, error); +- if (nread <= 0) ++ nread = soup_filter_input_stream_read_until ( ++ fstream, metabuf, sizeof (metabuf), ++ "\r\n", 2, blocking, TRUE, ++ &got_line, cancellable, error); ++ if (nread < 0) + return nread; + +- if (strncmp (buffer, "\r\n", nread) || strncmp (buffer, "\n", nread)) { ++ if (nread == 0) { ++ if (error && *error == NULL) { ++ g_set_error_literal (error, G_IO_ERROR, ++ G_IO_ERROR_PARTIAL_INPUT, ++ _("Connection terminated unexpectedly")); ++ } ++ return -1;
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch line 133
Quoted 10 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1801.patch new file +10
-0++ } ++ ++ if (nread == 2 && strncmp (metabuf, "\r\n", nread) == 0) { + bistream->priv->chunked_state = SOUP_BODY_INPUT_STREAM_STATE_DONE; + bistream->priv->eof = TRUE; + } +diff --git a/tests/server-test.c b/tests/server-test.c +index 8976103e..fbe8bdcc 100644 +--- a/tests/server-test.c ++++ b/tests/server-test.c
Same remarks as patch 1/5 about test code. If we don't exercise it we don't have to backport/review it.
Thanks!
Signature · 2 lines
Yoann Congal Smile ECS
PATCH v2 3/5 libsoup-2.4: fix CVE-2026-2443
In reply to Jason StasiakBackport fix for CVE-2026-2443 from meta-oe to OE-core. Update CVE patch to restore the range-test validation unit test from the upstream libsoup3 patch (b9a1c0663ff8ab6e79715db4b35b54f560416ddd).
(From meta-oe rev: 07d67228162018f5f619dce7183f85e79293378d)
--- .../libsoup/libsoup-2.4/CVE-2026-2443.patch | 390 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 1 + 2 files changed, 391 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-2443.patch
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-2443.patch new file +390 -0
@@ -0,0 +1,390 @@ +From 7bb3115a296154e3f465900ea5c984a493385a7f Mon Sep 17 00:00:00 2001 +From: Philip Withnall <[email protected]> +Date: Fri, 19 Dec 2025 23:49:05 +0000 +Subject: [PATCH] Fix CVE-2026-2443 + +Upstream-Status: Backport [ +c1796442 soup-message-headers: Rework Range response statuses to match Apache +191ef313 soup-message-headers: Fix rejection of Range headers with trailing garbage +be677bea soup-message-headers: Fix parsing of invalid Range suffix lengths +2bbfdfe8 soup-message-headers: Reject ranges where end is before start +739bf7cb soup-message-headers: Reject invalid Range ends longer than the content +] +CVE: CVE-2026-2443 + +Signed-off-by: Changqing Li <[email protected]> + +Backport the range-test validation unit tests from the upstream libsoup3 patches. + +Upstream-Status: Backport [ +5890c42d tests: Add more tests for invalid Range headers +c1796442 soup-message-headers: Rework Range response statuses to match Apache +6574a84f tests: Allow range tests to check more response statuses +191ef313 soup-message-headers: Fix rejection of Range headers with trailing garbage +be677bea soup-message-headers: Fix parsing of invalid Range suffix lengths +2bbfdfe8 soup-message-headers: Reject ranges where end is before start +739bf7cb soup-message-headers: Reject invalid Range ends longer than the content +] + +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-message-headers.c | 62 ++++++++++---- + tests/range-test.c | 149 ++++++++++++++++++++++++++++----- + 2 files changed, 172 insertions(+), 39 deletions(-) + +diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c +index ff10e103..f30dd461 100644 +--- a/libsoup/soup-message-headers.c ++++ b/libsoup/soup-message-headers.c +@@ -940,10 +940,16 @@ sort_ranges (gconstpointer a, gconstpointer b) + } + + /* like soup_message_headers_get_ranges(), except it returns: +- * SOUP_STATUS_OK if there is no Range or it should be ignored. +- * SOUP_STATUS_PARTIAL_CONTENT if there is at least one satisfiable range. +- * SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE if @check_satisfiable +- * is %TRUE and the request is not satisfiable given @total_length. ++ * - SOUP_STATUS_OK if there is no Range or it should be ignored due to being ++ * entirely invalid. ++ * - SOUP_STATUS_PARTIAL_CONTENT if there is at least one satisfiable range. ++ * - SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE if @check_satisfiable ++ * is %TRUE, the Range is valid, but no part of the request is satisfiable ++ * given @total_length. ++ * ++ * @ranges and @length are only set if SOUP_STATUS_PARTIAL_CONTENT is returned. ++ * ++ * See https://httpwg.org/specs/rfc9110.html#field.range + */ + guint + soup_message_headers_get_ranges_internal (SoupMessageHeaders *hdrs, +@@ -957,22 +963,28 @@ soup_message_headers_get_ranges_internal (SoupMessageHeaders *hdrs, + GArray *array; + char *spec, *end; + guint status = SOUP_STATUS_OK; ++ gboolean is_all_valid = TRUE; + + if (!range || strncmp (range, "bytes", 5) != 0) +- return status; ++ return SOUP_STATUS_OK; /* invalid header or unknown range unit */ + + range += 5; + while (g_ascii_isspace (*range)) + range++; + if (*range++ != '=') +- return status; ++ return SOUP_STATUS_OK; /* invalid header */ + while (g_ascii_isspace (*range)) + range++; + + range_list = soup_header_parse_list (range); + if (!range_list) +- return status; ++ return SOUP_STATUS_OK; /* invalid list */ + ++ /* Loop through the ranges and modify the status accordingly. Default to ++ * status 200 (OK, ignoring the ranges). Switch to status 206 (Partial ++ * Content) if there is at least one partially valid range. Switch to ++ * status 416 (Range Not Satisfiable) if there are no partially valid ++ * ranges at all. */ + array = g_array_new (FALSE, FALSE, sizeof (SoupRange)); + for (r = range_list; r; r = r->next) { + SoupRange cur; +@@ -985,30 +997,44 @@ soup_message_headers_get_ranges_internal (SoupMessageHeaders *hdrs, + cur.start = g_ascii_strtoull (spec, &end, 10); + if (*end == '-') + end++; +- if (*end) { ++ if (*end) + cur.end = g_ascii_strtoull (end, &end, 10); +- if (cur.end < cur.start) { +- status = SOUP_STATUS_OK; +- break; +- } +- } else ++ else + cur.end = total_length - 1; + } ++ + if (*end) { +- status = SOUP_STATUS_OK; +- break; +- } else if (check_satisfiable && cur.start >= total_length) { +- if (status == SOUP_STATUS_OK) +- status = SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE; ++ /* Junk after the range */ ++ is_all_valid = FALSE; ++ continue; ++ } ++ ++ if (cur.end < cur.start) { ++ is_all_valid = FALSE; ++ continue; ++ } ++ ++ g_assert (cur.start >= 0); ++ if (cur.end >= total_length) ++ cur.end = total_length - 1; ++ ++ if (cur.start >= total_length) { ++ /* Range is valid, but unsatisfiable */ + continue; + } + ++ /* We have at least one (at least partially) satisfiable range */ + g_array_append_val (array, cur); + status = SOUP_STATUS_PARTIAL_CONTENT; + } + soup_header_free_list (range_list); + + if (status != SOUP_STATUS_PARTIAL_CONTENT) { ++ g_assert (status == SOUP_STATUS_OK); ++ ++ if (is_all_valid && check_satisfiable) ++ status = SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE; ++ + g_array_free (array, TRUE); + return status; + } +diff --git a/tests/range-test.c b/tests/range-test.c +index d3c49963..8bd0fa1c 100644 +--- a/tests/range-test.c ++++ b/tests/range-test.c +@@ -57,7 +57,8 @@ check_part (SoupMessageHeaders *headers, const char *body, gsize body_len, + + static void + do_single_range (SoupSession *session, SoupMessage *msg, +- int start, int end, gboolean succeed) ++ int start, int end, SoupStatus expected_status, ++ int expected_start, int expected_end) + { + const char *content_type; + +@@ -66,7 +67,7 @@ do_single_range (SoupSession *session, SoupMessage *msg, + + soup_session_send_message (session, msg); + +- if (!succeed) { ++ if (expected_status == SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE) { + soup_test_assert_message_status (msg, SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE); + if (msg->status_code != SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE) { + const char *content_range; +@@ -76,31 +77,78 @@ do_single_range (SoupSession *session, SoupMessage *msg, + if (content_range) + debug_printf (1, " Content-Range: %s\n", content_range); + } +- + g_object_unref (msg); + return; ++ } else if (expected_status == SOUP_STATUS_OK) { ++ soup_test_assert_message_status (msg, SOUP_STATUS_OK); ++ ++ content_type = soup_message_headers_get_content_type(msg->response_headers, NULL); ++ g_assert_cmpstr (content_type, !=, "multipart/byteranges"); ++ ++ g_assert_false (soup_message_headers_get_content_range (msg->response_headers, NULL, ++ NULL, NULL)); ++ g_assert_cmpint (soup_message_headers_get_content_length (msg->response_headers), ++ ==, full_response->length); ++ } else { ++ soup_test_assert_message_status (msg, SOUP_STATUS_PARTIAL_CONTENT); ++ content_type = soup_message_headers_get_content_type (msg->response_headers, NULL); ++ g_assert_cmpstr (content_type, !=, "multipart/byteranges"); ++ ++ check_part (msg->response_headers, msg->response_body->data, ++ msg->response_body->length, TRUE, expected_start, expected_end); + } + +- soup_test_assert_message_status (msg, SOUP_STATUS_PARTIAL_CONTENT); +- +- content_type = soup_message_headers_get_content_type ( +- msg->response_headers, NULL); +- g_assert_cmpstr (content_type, !=, "multipart/byteranges"); +- +- check_part (msg->response_headers, msg->response_body->data, +- msg->response_body->length, TRUE, start, end); + g_object_unref (msg); + } + + static void + request_single_range (SoupSession *session, const char *uri, +- int start, int end, gboolean succeed) ++ int start, int end, SoupStatus expected_status, ++ int expected_start, int expected_end) + { + SoupMessage *msg; + + msg = soup_message_new ("GET", uri); + soup_message_headers_set_range (msg->request_headers, start, end); +- do_single_range (session, msg, start, end, succeed); ++ do_single_range (session, msg, start, end, expected_status, expected_start, expected_end); ++} ++ ++/* This always asserts failure (either 406 or 200 with no Content-Range); it’s ++ * intended to be used for passing invalid ++ * Range header formats which can’t be built by calling ++ * soup_message_headers_set_range(). */ ++static void ++request_single_range_by_string (SoupSession *session, const char *uri, ++ const char *range, SoupStatus expected_status) ++{ ++ SoupMessage *msg; ++ ++ msg = soup_message_new ("GET", uri); ++ soup_message_headers_replace (msg->request_headers, "Range", range); ++ ++ debug_printf (1, " Range: %s\n", ++ soup_message_headers_get_one (msg->request_headers, "Range")); ++ ++ soup_session_send_message (session, msg); ++ ++ if (expected_status == SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE) { ++ soup_test_assert_message_status (msg, SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE); ++ } else { ++ const char *content_type; ++ ++ soup_test_assert_message_status (msg, SOUP_STATUS_OK); ++ ++ content_type = soup_message_headers_get_content_type (msg->response_headers, NULL); ++ g_assert_cmpstr (content_type, !=, "multipart/byteranges"); ++ ++ g_assert_false (soup_message_headers_get_content_range (msg->response_headers, ++ NULL, NULL, NULL)); ++ ++ g_assert_cmpint (soup_message_headers_get_content_length (msg->response_headers), ++ ==, full_response->length); ++ } ++ ++ g_object_unref (msg); + } + + static void +@@ -165,7 +213,9 @@ request_double_range (SoupSession *session, const char *uri, + do_single_range (session, msg, + MIN (first_start, second_start), + MAX (first_end, second_end), +- TRUE); ++ SOUP_STATUS_PARTIAL_CONTENT, ++ MIN (first_start, second_start), ++ MAX (first_end, second_end)); + } else + do_multi_range (session, msg, expected_return_ranges); + } +@@ -193,7 +243,9 @@ request_triple_range (SoupSession *session, const char *uri, + do_single_range (session, msg, + MIN (first_start, MIN (second_start, third_start)), + MAX (first_end, MAX (second_end, third_end)), +- TRUE); ++ SOUP_STATUS_PARTIAL_CONTENT, ++ MIN (first_start, MIN (second_start, third_start)), ++ MAX (first_end, MAX (second_end, third_end))); + } else + do_multi_range (session, msg, expected_return_ranges); + } +@@ -248,7 +300,8 @@ do_range_test (SoupSession *session, const char *uri, + debug_printf (1, "Requesting %d-%d\n", 0 * twelfths, 1 * twelfths); + request_single_range (session, uri, + 0 * twelfths, 1 * twelfths, +- TRUE); ++ SOUP_STATUS_PARTIAL_CONTENT, ++ 0 * twelfths, 1 * twelfths); + + /* B: 11, end-relative request. These two are mostly redundant + * in terms of data coverage, but they may still catch +@@ -257,11 +310,13 @@ do_range_test (SoupSession *session, const char *uri, + debug_printf (1, "Requesting %d-\n", 11 * twelfths); + request_single_range (session, uri, + 11 * twelfths, -1, +- TRUE); ++ SOUP_STATUS_PARTIAL_CONTENT, ++ 11 * twelfths, -1); + debug_printf (1, "Requesting -%d\n", 1 * twelfths); + request_single_range (session, uri, + -1 * twelfths, -1, +- TRUE); ++ SOUP_STATUS_PARTIAL_CONTENT, ++ -1 * twelfths, -1); + + /* C: 2 and 5 */ + debug_printf (1, "Requesting %d-%d,%d-%d\n", +@@ -314,7 +369,8 @@ do_range_test (SoupSession *session, const char *uri, + (int) full_response->length + 100); + request_single_range (session, uri, + full_response->length + 1, full_response->length + 100, +- FALSE); ++ SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE, ++ 0, 0); + + debug_printf (1, "Requesting (semi-invalid) 1-10,%d-%d,20-30\n", + (int) full_response->length + 1, +@@ -322,7 +378,58 @@ do_range_test (SoupSession *session, const char *uri, + request_semi_invalid_range (session, uri, + 1, 10, + full_response->length + 1, full_response->length + 100, +- 20, 30); ++ 20, 30); ++ ++ debug_printf (1, "Requesting (invalid end) %d-%d\n", ++ 1, ++ (int) full_response->length + 1000); ++ request_single_range (session, uri, ++ 1, full_response->length + 1000, ++ SOUP_STATUS_PARTIAL_CONTENT, ++ 1, full_response->length - 1); ++ ++ debug_printf (1, "Requesting (end before start) %d-%d\n", ++ 10, ++ 1); ++ request_single_range (session, uri, ++ 10, 1, ++ SOUP_STATUS_OK, ++ 1, full_response->length); ++ ++ debug_printf (1, "Requesting (malformed suffix length) -0\n"); ++ request_single_range_by_string (session, uri, ++ "bytes=-0", ++ SOUP_STATUS_OK); ++ ++ debug_printf (1, "Requesting (extra content after valid header value) 0-10\n"); ++ request_single_range_by_string (session, uri, ++ "bytes=0-10 but with weird trailing content", ++ SOUP_STATUS_OK); ++ ++ debug_printf (1, "Requesting (invalid range dash) 0a10\n"); ++ request_single_range_by_string (session, uri, ++ "bytes=0a10", ++ SOUP_STATUS_OK); ++ ++ debug_printf (1, "Requesting (invalid range unit) 0-10\n"); ++ request_single_range_by_string (session, uri, ++ "horses=0-10", ++ SOUP_STATUS_OK); ++ ++ debug_printf (1, "Requesting (missing equals) 0-10\n"); ++ request_single_range_by_string (session, uri, ++ "bytes 0-10", ++ SOUP_STATUS_OK); ++ ++ debug_printf (1, "Requesting (end before start but with whitespace) 10-1\n"); ++ request_single_range_by_string (session, uri, ++ "bytes \t = \t 10-1", ++ SOUP_STATUS_OK); ++ ++ debug_printf (1, "Requesting (delimiters but no ranges)\n"); ++ request_single_range_by_string (session, uri, ++ "bytes=, ,,\t, ", ++ SOUP_STATUS_OK); + } + + static void +@@ -341,7 +448,7 @@ do_apache_range_test (void) + + static void + server_handler (SoupServer *server, +- SoupMessage *msg, ++ SoupMessage *msg, + const char *path, + GHashTable *query, + SoupClientContext *client, +-- +2.55.0 +
meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb +1 -0
@@ -43,6 +43,7 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ file://CVE-2025-4945.patch \ file://CVE-2026-1539.patch \ file://CVE-2026-1801.patch \ + file://CVE-2026-2443.patch \ " SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13"
Signature · 1 line
2.55.0
Re: [OE-core] [scarthgap][PATCH v2 3/5] libsoup-2.4: fix CVE-2026-2443
Quoted 36 lines · Jason Stasiak via lists.openembedded.org
Backport fix for CVE-2026-2443 from meta-oe to OE-core. Update CVE patch to restore the range-test validation unit test from the upstream libsoup3 patch (
b9a1c0663ff8ab6e79715db4b35b54f560416ddd).(From meta-oe rev:
07d67228162018f5f619dce7183f85e79293378d)Signed-off-by Jason Stasiak <[email protected]>--- .../libsoup/libsoup-2.4/CVE-2026-2443.patch | 390 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 1 + 2 files changed, 391 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-2443.patchmeta/recipes-support/libsoup/libsoup-2.4/CVE-2026-2443.patch new file +17
-0@@ -0,0 +1,390 @@ +From 7bb3115a296154e3f465900ea5c984a493385a7f Mon Sep 17 00:00:00 2001 +From: Philip Withnall <[email protected]> +Date: Fri, 19 Dec 2025 23:49:05 +0000 +Subject: [PATCH] Fix CVE-2026-2443 + +Upstream-Status: Backport [ +c1796442 soup-message-headers: Rework Range response statuses to match Apache +191ef313 soup-message-headers: Fix rejection of Range headers with trailing garbage +be677bea soup-message-headers: Fix parsing of invalid Range suffix lengths +2bbfdfe8 soup-message-headers: Reject ranges where end is before start +739bf7cb soup-message-headers: Reject invalid Range ends longer than the content +] +CVE: CVE-2026-2443 + +Signed-off-by: Changqing Li <[email protected]> + +Backport the range-test validation unit tests from the upstream libsoup3 patches.
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-2443.patch line 27
Quoted 10 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-2443.patch new file +10
-0+ +Upstream-Status: Backport [ +5890c42d tests: Add more tests for invalid Range headers +c1796442 soup-message-headers: Rework Range response statuses to match Apache +6574a84f tests: Allow range tests to check more response statuses +191ef313 soup-message-headers: Fix rejection of Range headers with trailing garbage +be677bea soup-message-headers: Fix parsing of invalid Range suffix lengths +2bbfdfe8 soup-message-headers: Reject ranges where end is before start +739bf7cb soup-message-headers: Reject invalid Range ends longer than the content +]
Please split the backports into separate patch files. Also, only one "Upstream-Status:" per patch is expected.
And please use a commit URL (like in 1/5), that way I can automatically grab the upstream patch and compare it with yours. It also helps manual review.
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-2443.patch line 33
Quoted 6 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-2443.patch new file +6
-0+ +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-message-headers.c | 62 ++++++++++---- + tests/range-test.c | 149 ++++++++++++++++++++++++++++----- + 2 files changed, 172 insertions(+), 39 deletions(-)
Thanks!
Signature · 2 lines
Yoann Congal Smile ECS
PATCH v2 4/5 libsoup-2.4: fix CVE-2026-5119
In reply to Jason StasiakBackport fix for CVE-2026-5119 from upstream libsoup 3 patch [1].
[1] https://gitlab.gnome.org/GNOME/libsoup/-/commit/b0626fff8538e3dd4a52f148d91c8348d51d64d1
---
Changes since v1:
- Updated subject line to identify correct CVE
.../libsoup/libsoup-2.4/CVE-2026-5119.patch | 129 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 1 + 2 files changed, 130 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +129 -0
@@ -0,0 +1,129 @@ +From b0626fff8538e3dd4a52f148d91c8348d51d64d1 Mon Sep 17 00:00:00 2001 +From: Carlos Garcia Campos <[email protected]> +Date: Fri, 27 Feb 2026 12:03:25 +0100 +Subject: [PATCH] Fix CVE-2026-5119 + +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/b0626fff8538e3dd4a52f148d91c8348d51d64d1] +CVE: CVE-2026-5119 + +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-cookie-jar.c | 25 +++++++++++++++------ + tests/proxy-test.c | 46 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 64 insertions(+), 7 deletions(-) + +diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c +index c8231f0e..b9abdc82 100644 +--- a/libsoup/soup-cookie-jar.c ++++ b/libsoup/soup-cookie-jar.c +@@ -12,6 +12,7 @@ + #include <string.h> + + #include "soup-cookie-jar.h" ++#include "soup-connection.h" + #include "soup-message-private.h" + #include "soup-misc-private.h" + #include "soup.h" +@@ -818,18 +819,28 @@ process_set_cookie_header (SoupMessage *msg, gpointer user_data) + g_slist_free (new_cookies); + } + ++static gboolean ++allow_cookies_for_request (SoupMessage *msg) ++{ ++ /* Do not send cookies to a HTTP proxy for a HTTPS request */ ++ return msg->method != SOUP_METHOD_CONNECT || !soup_connection_is_tunnelled (soup_message_get_connection (msg)); ++} ++ + static void + msg_starting_cb (SoupMessage *msg, gpointer feature) + { + SoupCookieJar *jar = SOUP_COOKIE_JAR (feature); +- GSList *cookies; ++ GSList *cookies = NULL; ++ ++ if (allow_cookies_for_request (msg)) { ++ cookies = soup_cookie_jar_get_cookie_list_with_same_site_info (jar, soup_message_get_uri (msg), ++ soup_message_get_first_party (msg), ++ soup_message_get_site_for_cookies (msg), ++ TRUE, ++ SOUP_METHOD_IS_SAFE (msg->method), ++ soup_message_get_is_top_level_navigation (msg)); ++ } + +- cookies = soup_cookie_jar_get_cookie_list_with_same_site_info (jar, soup_message_get_uri (msg), +- soup_message_get_first_party (msg), +- soup_message_get_site_for_cookies (msg), +- TRUE, +- SOUP_METHOD_IS_SAFE (msg->method), +- soup_message_get_is_top_level_navigation (msg)); + if (cookies != NULL) { + char *cookie_header = soup_cookies_to_cookie_header (cookies); + soup_message_headers_replace (msg->request_headers, "Cookie", cookie_header); +diff --git a/tests/proxy-test.c b/tests/proxy-test.c +index 105a02a6..d8c7e8a1 100644 +--- a/tests/proxy-test.c ++++ b/tests/proxy-test.c +@@ -435,6 +435,51 @@ do_proxy_auth_cache_test (void) + g_object_unref (cache); + } + ++static void ++connect_message_wrote_headers_cb (SoupMessage *msg, guint *counter) ++{ ++ SoupMessageHeaders *hdrs; ++ ++ *counter += 1; ++ ++ if (msg->method == SOUP_METHOD_CONNECT) ++ g_assert_null (soup_message_headers_get_one (msg->request_headers, "Cookie")); ++ else ++ g_assert_nonnull (soup_message_headers_get_one (msg->request_headers, "Cookie")); ++} ++ ++static void ++request_queued_cb (SoupSession *session, SoupMessage *msg, guint *counter) ++{ ++ g_signal_connect (msg, "wrote-headers", G_CALLBACK (connect_message_wrote_headers_cb), counter); ++} ++ ++static void ++do_proxy_secure_cookies_test (void) ++{ ++ SoupSession *session; ++ SoupMessage *msg; ++ SoupCookieJar *jar; ++ guint counter = 0; ++ ++ SOUP_TEST_SKIP_IF_NO_APACHE; ++ SOUP_TEST_SKIP_IF_NO_TLS; ++ ++ session = soup_test_session_new (SOUP_TYPE_SESSION_SYNC, SOUP_SESSION_PROXY_RESOLVER, proxy_resolvers[SIMPLE_PROXY], NULL); ++ g_signal_connect (session, "request-queued", G_CALLBACK (request_queued_cb), &counter); ++ ++ soup_session_add_feature_by_type (session, SOUP_TYPE_COOKIE_JAR); ++ jar = SOUP_COOKIE_JAR (soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR)); ++ ++ msg = soup_message_new (SOUP_METHOD_GET, HTTPS_SERVER); ++ soup_cookie_jar_set_cookie (jar, soup_message_get_uri (msg), "user=password; secure"); ++ soup_session_send_message (session, msg); ++ soup_test_assert_message_status (msg, SOUP_STATUS_OK); ++ g_assert_cmpuint (counter, ==, 2); ++ ++ soup_test_session_abort_unref (session); ++} ++ + int + main (int argc, char **argv) + { +@@ -470,6 +515,7 @@ main (int argc, char **argv) + g_test_add_func ("/proxy/redirect", do_proxy_redirect_test); + g_test_add_func ("/proxy/auth-redirect", do_proxy_auth_redirect_test); + g_test_add_func ("/proxy/auth-cache", do_proxy_auth_cache_test); ++ g_test_add_func ("/proxy/secure-cookies", do_proxy_secure_cookies_test); + + ret = g_test_run (); + +-- +2.55.0 +
meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb +1 -0
@@ -44,6 +44,7 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ file://CVE-2026-1539.patch \ file://CVE-2026-1801.patch \ file://CVE-2026-2443.patch \ + file://CVE-2026-5119.patch \ " SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13"
Signature · 1 line
2.55.0
Re: [OE-core] [scarthgap][PATCH v2 4/5] libsoup-2.4: fix CVE-2026-5119
Quoted 20 lines · Jason Stasiak via lists.openembedded.org
Backport fix for CVE-2026-5119 from upstream libsoup 3 patch [1].
[1] https://gitlab.gnome.org/GNOME/libsoup/-/commit/b0626fff8538e3dd4a52f148d91c8348d51d64d1
Signed-off-by Jason Stasiak <[email protected]>---
Changes since v1:
- Updated subject line to identify correct CVE.../libsoup/libsoup-2.4/CVE-2026-5119.patch | 129 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 1 + 2 files changed, 130 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patchmeta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +0
-0
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch line 4
Quoted 4 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +4
-0@@ -0,0 +1,129 @@ +From b0626fff8538e3dd4a52f148d91c8348d51d64d1 Mon Sep 17 00:00:00 2001 +From: Carlos Garcia Campos <[email protected]> +Date: Fri, 27 Feb 2026 12:03:25 +0100 +Subject: [PATCH] Fix CVE-2026-5119
Keep the upstream patch subject please
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch line 9
Quoted 5 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +5
-0+ +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/b0626fff8538e3dd4a52f148d91c8348d51d64d1] +CVE: CVE-2026-5119 + +Signed-off-by: Jason Stasiak <[email protected]>
As an exemple, this backport changed:soup_message_get_method (msg) -> msg->method
This look quite simple but this might hide more code that just a pointer shorthand. I'd prefer it was listed in the backport notes with the check that this is just a shorthand and not something more complex.
Quoted 16 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +16
-0+--- + libsoup/soup-cookie-jar.c | 25 +++++++++++++++------ + tests/proxy-test.c | 46 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 64 insertions(+), 7 deletions(-) + +diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c +index c8231f0e..b9abdc82 100644 +--- a/libsoup/soup-cookie-jar.c ++++ b/libsoup/soup-cookie-jar.c +@@ -12,6 +12,7 @@ + #include <string.h> + + #include "soup-cookie-jar.h" ++#include "soup-connection.h" + #include "soup-message-private.h" + #include "soup-misc-private.h"
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch line 35
Quoted 10 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +10
-0+ #include "soup.h" +@@ -818,18 +819,28 @@ process_set_cookie_header (SoupMessage *msg, gpointer user_data) + g_slist_free (new_cookies); + } + ++static gboolean ++allow_cookies_for_request (SoupMessage *msg) ++{ ++ /* Do not send cookies to a HTTP proxy for a HTTPS request */ ++ return msg->method != SOUP_METHOD_CONNECT || !soup_connection_is_tunnelled (soup_message_get_connection (msg));
^ this has been re-indented
Quoted 7 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +7
-0++} ++ + static void + msg_starting_cb (SoupMessage *msg, gpointer feature) + { + SoupCookieJar *jar = SOUP_COOKIE_JAR (feature); +- GSList *cookies;
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch line 52
Quoted 10 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +10
-0++ GSList *cookies = NULL; ++ ++ if (allow_cookies_for_request (msg)) { ++ cookies = soup_cookie_jar_get_cookie_list_with_same_site_info (jar, soup_message_get_uri (msg), ++ soup_message_get_first_party (msg), ++ soup_message_get_site_for_cookies (msg), ++ TRUE, ++ SOUP_METHOD_IS_SAFE (msg->method), ++ soup_message_get_is_top_level_navigation (msg)); ++ }
^ Also reindented. I admit the upstream indentation is not ideal but
changing it adds a lot of noise in my review process.
Quoted 4 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +4
-0+ +- cookies = soup_cookie_jar_get_cookie_list_with_same_site_info (jar, soup_message_get_uri (msg), +- soup_message_get_first_party (msg), +- soup_message_get_site_for_cookies (msg),
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch line 66
Quoted 10 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-5119.patch new file +10
-0+- TRUE, +- SOUP_METHOD_IS_SAFE (msg->method), +- soup_message_get_is_top_level_navigation (msg)); + if (cookies != NULL) { + char *cookie_header = soup_cookies_to_cookie_header (cookies); + soup_message_headers_replace (msg->request_headers, "Cookie", cookie_header); +diff --git a/tests/proxy-test.c b/tests/proxy-test.c +index 105a02a6..d8c7e8a1 100644 +--- a/tests/proxy-test.c ++++ b/tests/proxy-test.c
Same remarks about the test code.
Thanks!
Signature · 2 lines
Yoann Congal Smile ECS
PATCH v2 5/5 libsoup-2.4: fix CVE-2026-3633
In reply to Jason StasiakBackport fix for CVE-2026-3633 [1] and additional supporting patches [2][3][4] from the upstream libsoup 3 repo.
[1] https://gitlab.gnome.org/GNOME/libsoup/-/commit/7f2013d874f005035f2245e382ec82823a439926
[2] https://gitlab.gnome.org/GNOME/libsoup/-/commit/0120f183ca2b74abeee8439f73abc8ab504fbccf
[3] https://gitlab.gnome.org/GNOME/libsoup/-/commit/05910f8cb577682d444b0abaef670b4eb028e2fa
[4] https://gitlab.gnome.org/GNOME/libsoup/-/commit/a90c442df5f980dd9a8108c9def3b06607662fc8
--- .../libsoup/libsoup-2.4/CVE-2026-3633-1.patch | 51 ++++++++ .../libsoup/libsoup-2.4/CVE-2026-3633-2.patch | 53 ++++++++ .../libsoup/libsoup-2.4/CVE-2026-3633-3.patch | 49 ++++++++ .../libsoup/libsoup-2.4/CVE-2026-3633-4.patch | 113 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 4 + 5 files changed, 270 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-2.patch create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-3.patch create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-4.patch
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch new file +51 -0
@@ -0,0 +1,51 @@ +From 5d61da4e261fab02d07dc74bb3049bbd13535247 Mon Sep 17 00:00:00 2001 +From: Jason Stasiak <[email protected]> +Date: Fri, 25 Sep 2026 10:17:05 -0700 +Subject: [PATCH 1/4] CVE-2026-3633: Make SoupMessage a private and final type + +CVE: CVE-2026-3633 +Upstream-Status: Backport [ https://gitlab.gnome.org/GNOME/libsoup/-/commit/0120f183ca2b74abeee8439f73abc8ab504fbccf ] + +Backport the introduction of soup_message_set_method() from upstream +libsoup 3 patch to begin alignment of libsoup 2.4 code with that needed +to address CVE-2026-3633. + +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-message-private.h | 2 ++ + libsoup/soup-message.c | 10 ++++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/libsoup/soup-message-private.h b/libsoup/soup-message-private.h +index c30361c0..ee73112f 100644 +--- a/libsoup/soup-message-private.h ++++ b/libsoup/soup-message-private.h +@@ -179,4 +179,6 @@ gboolean soup_message_has_chunk_allocator (SoupMessage *msg); + SoupBuffer *soup_message_allocate_chunk (SoupMessage *msg, + goffset read_length); + ++void soup_message_set_method (SoupMessage *msg, ++ const char *method); + #endif /* __SOUP_MESSAGE_PRIVATE_H__ */ +diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c +index cc4f22b6..eae11eea 100644 +--- a/libsoup/soup-message.c ++++ b/libsoup/soup-message.c +@@ -2394,3 +2394,13 @@ soup_message_allocate_chunk (SoupMessage *msg, + + return priv->chunk_allocator (msg, read_length, priv->chunk_allocator_data); + } ++ ++ ++void ++soup_message_set_method (SoupMessage *msg, ++ const char *method) ++{ ++ g_return_if_fail (method != NULL); ++ ++ msg->method = g_intern_string (method); ++} +\ No newline at end of file +-- +2.55.0 +
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-2.patch new file +53 -0
53 lines not on this page · raw message
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-3.patch new file +49 -0
49 lines not on this page · raw message
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-4.patch new file +113 -0
113 lines not on this page · raw message
meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb +4 -0
@@ -45,6 +45,10 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ file://CVE-2026-1801.patch \ file://CVE-2026-2443.patch \ file://CVE-2026-5119.patch \ + file://CVE-2026-3633-1.patch \ + file://CVE-2026-3633-2.patch \ + file://CVE-2026-3633-3.patch \ + file://CVE-2026-3633-4.patch \ " SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13"
Signature · 1 line
2.55.0
Re: [OE-core] [scarthgap][PATCH v2 5/5] libsoup-2.4: fix CVE-2026-3633
Quoted 27 lines · Jason Stasiak via lists.openembedded.org
Backport fix for CVE-2026-3633 [1] and additional supporting patches [2][3][4] from the upstream libsoup 3 repo.
[1] https://gitlab.gnome.org/GNOME/libsoup/-/commit/7f2013d874f005035f2245e382ec82823a439926
[2] https://gitlab.gnome.org/GNOME/libsoup/-/commit/0120f183ca2b74abeee8439f73abc8ab504fbccf
[3] https://gitlab.gnome.org/GNOME/libsoup/-/commit/05910f8cb577682d444b0abaef670b4eb028e2fa
[4] https://gitlab.gnome.org/GNOME/libsoup/-/commit/a90c442df5f980dd9a8108c9def3b06607662fc8Signed-off-by Jason Stasiak <[email protected]>--- .../libsoup/libsoup-2.4/CVE-2026-3633-1.patch | 51 ++++++++ .../libsoup/libsoup-2.4/CVE-2026-3633-2.patch | 53 ++++++++ .../libsoup/libsoup-2.4/CVE-2026-3633-3.patch | 49 ++++++++ .../libsoup/libsoup-2.4/CVE-2026-3633-4.patch | 113 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 4 + 5 files changed, 270 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-2.patch create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-3.patch create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-4.patchmeta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch new file +0
-0
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch line 4
Quoted 4 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch new file +4
-0@@ -0,0 +1,51 @@ +From 5d61da4e261fab02d07dc74bb3049bbd13535247 Mon Sep 17 00:00:00 2001 +From: Jason Stasiak <[email protected]> +Date: Fri, 25 Sep 2026 10:17:05 -0700 +Subject: [PATCH 1/4] CVE-2026-3633: Make SoupMessage a private and final type
Please keep upstream authorship info and title.
Quoted 32 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch new file +32
-0+ +CVE: CVE-2026-3633 +Upstream-Status: Backport [ https://gitlab.gnome.org/GNOME/libsoup/-/commit/0120f183ca2b74abeee8439f73abc8ab504fbccf ] + +Backport the introduction of soup_message_set_method() from upstream +libsoup 3 patch to begin alignment of libsoup 2.4 code with that needed +to address CVE-2026-3633. + +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-message-private.h | 2 ++ + libsoup/soup-message.c | 10 ++++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/libsoup/soup-message-private.h b/libsoup/soup-message-private.h +index c30361c0..ee73112f 100644 +--- a/libsoup/soup-message-private.h ++++ b/libsoup/soup-message-private.h +@@ -179,4 +179,6 @@ gboolean soup_message_has_chunk_allocator (SoupMessage *msg); + SoupBuffer *soup_message_allocate_chunk (SoupMessage *msg, + goffset read_length); + ++void soup_message_set_method (SoupMessage *msg, ++ const char *method); + #endif /* __SOUP_MESSAGE_PRIVATE_H__ */ +diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c +index cc4f22b6..eae11eea 100644 +--- a/libsoup/soup-message.c ++++ b/libsoup/soup-message.c +@@ -2394,3 +2394,13 @@ soup_message_allocate_chunk (SoupMessage *msg, + + return priv->chunk_allocator (msg, read_length, priv->chunk_allocator_data);
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch line 46
Quoted 10 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-3633-1.patch new file +10
-0+ } ++ ++ ++void ++soup_message_set_method (SoupMessage *msg, ++ const char *method) ++{ ++ g_return_if_fail (method != NULL); ++ ++ msg->method = g_intern_string (method);
Same idea, please don't reindent upstream code.
Also, upstream, that function uses soup_message_get_instance_private() that your don't, can you explain why?
(I'll stop my review here, please apply the above reviews and from the previous patches of the series to the next patches)
Thanks!
Signature · 2 lines
Yoann Congal Smile ECS
Hello,
Quoted 22 lines · Jason Stasiak via lists.openembedded.org
Backport fix for CVE-2026-1539 from meta-oe to OE-core. Update CVE patch to restore the auth-redirect proxy validation unit test from the upstream libsoup3 patch.
(From meta-oe rev:
07d67228162018f5f619dce7183f85e79293378d)Signed-off-by Jason Stasiak <[email protected]>---
Changes since v1:
- Resolved malformed patch lines.../libsoup/libsoup-2.4/CVE-2026-1539.patch | 104 ++++++++++++++++++ .../libsoup/libsoup-2.4_2.74.3.bb | 1 + 2 files changed, 105 insertions(+) create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patchmeta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patch new file +0
-0
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patch line 2
Quoted 2 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patch new file +2
-0@@ -0,0 +1,104 @@ +From 285faea567e1e2a95226201175dbf745a64a2439 Mon Sep 17 00:00:00 2001 +From: Changqing Li <[email protected]>
^
I just saw that this is in the meta-oe commit but this patch is not authored by Changqing Li but by Carlos Garcia Campos.
Quoted 77 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patch new file +77
-0+Date: Fri, 20 Mar 2026 15:04:22 +0800 +Subject: [PATCH 4/4] Also remove Proxy-Authorization header on cross origin + redirect + +Closes #489 + +Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/98c1285d9d78662c38bf14b4a128af01ccfdb446] +CVE: CVE-2026-1539 + +Signed-off-by: Changqing Li <[email protected]> + +Backport the auth-redirect proxy validation unit tests from the upstream +libsoup3 patch + +Signed-off-by: Jason Stasiak <[email protected]> +--- + libsoup/soup-session.c | 1 + + tests/httpd.conf.in | 1 + + tests/proxy-test.c | 36 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 38 insertions(+) + +diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c +index fadd5cd2..4cad0946 100644 +--- a/libsoup/soup-session.c ++++ b/libsoup/soup-session.c +@@ -1192,6 +1192,7 @@ soup_session_redirect_message (SoupSession *session, SoupMessage *msg) + /* Strip all credentials on cross-origin redirect. */ + if (!soup_uri_host_equal (soup_message_get_uri (msg), new_uri)) { + soup_message_headers_remove (msg->request_headers, "Authorization"); ++ soup_message_headers_remove (msg->request_headers, "Proxy-Authorization"); + soup_message_set_auth (msg, NULL); + } + +diff --git a/tests/httpd.conf.in b/tests/httpd.conf.in +index 93fb7ff4..e190b6f7 100644 +--- a/tests/httpd.conf.in ++++ b/tests/httpd.conf.in +@@ -37,6 +37,7 @@ DirectoryIndex index.txt + TypesConfig /dev/null + AddType application/x-httpd-php .php + Redirect permanent /redirected /index.txt ++Redirect permanent /Basic/realm1/redirected https://127.0.0.1:47525/index.txt + + # Proxy #1: unauthenticated + Listen 127.0.0.1:47526 +diff --git a/tests/proxy-test.c b/tests/proxy-test.c +index 1d68aa05..105a02a6 100644 +--- a/tests/proxy-test.c ++++ b/tests/proxy-test.c +@@ -322,6 +322,41 @@ do_proxy_redirect_test (void) + soup_test_session_abort_unref (session); + } + ++static void proxy_auth_redirect_message_restarted (SoupMessage *msg) ++{ ++ if (msg->status_code != SOUP_STATUS_MOVED_PERMANENTLY) ++ return; ++ ++ g_assert_null (soup_message_headers_get_one (msg->request_headers, "Proxy-Authorization")); ++} ++ ++static void ++do_proxy_auth_redirect_test (void) ++{ ++ SoupSession *session; ++ SoupMessage *msg; ++ char *url; ++ ++ SOUP_TEST_SKIP_IF_NO_APACHE; ++ SOUP_TEST_SKIP_IF_NO_TLS; ++ ++ session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC, ++ SOUP_SESSION_PROXY_RESOLVER, proxy_resolvers[AUTH_PROXY], ++ NULL); ++ ++ url = g_strconcat (HTTP_SERVER, "/Basic/realm1/redirected", NULL); ++ msg = soup_message_new (SOUP_METHOD_GET, url);
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patch line 89
Quoted 10 lines
meta/recipes-support/libsoup/libsoup-2.4/CVE-2026-1539.patch new file +10
-0++ g_signal_connect (session, "authenticate", G_CALLBACK (authenticate), NULL); ++ g_signal_connect (msg, "restarted", G_CALLBACK (proxy_auth_redirect_message_restarted), NULL); ++ ++ soup_session_send_message (session, msg); ++ soup_test_assert_message_status (msg, SOUP_STATUS_OK); ++ ++ g_free (url); ++ g_object_unref (msg); ++ soup_test_session_abort_unref (session); ++}
This function body has changes from upstream patch:
* soup_test_session_new call arguments
* g_signal_connect (session, "authenticate, ... instead of msg
* soup_test_session_send_message -> soup_session_send_message call
* indentation changed which tends to hide the above changes.
Since the recipe does not inherit ptest, do we actually exercise this test code? If we don't, please consider just removing it.
If you want to keep it, please explain/document the above changes (or in case of the indentation change: revert it)
The current explanation is not detailed enough for that.
Thanks!
Signature · 2 lines
Yoann Congal Smile ECS