public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Adrian Vovk <avovk@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/libsoup3] f43: Fix various CVEs
Date: Tue, 27 Oct 2026 03:29:26 GMT	[thread overview]
Message-ID: <179307176605.1.6724175231607135413.rpms-libsoup3-869bc38988d2@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/libsoup3
            Branch : f43
            Commit : 869bc38988d24de6e17fd66c00c3630882e7ce70
            Author : Adrian Vovk <avovk@redhat.com>
            Date   : 2026-10-26T23:26:48-04:00
            Stats  : +1836/-0 in 11 file(s)
            URL    : https://src.fedoraproject.org/rpms/libsoup3/c/869bc38988d24de6e17fd66c00c3630882e7ce70?branch=f43

            Log:
            Fix various CVEs

This commit backports a bunch of upstream CVE fixes to the 3.6.6 branch:

- CVE-2026-102560 (rhbz#2543294)
- CVE-2026-102559 (rhbz#2543282)
- CVE-2026-102558 (rhbz#2543279)
- CVE-2026-102555 (rhbz#2543270)
- CVE-2026-102556 (rhbz#2543266)
- CVE-2026-102557 (rhbz#2543248) (Same fix as CVE-2026-102559)
- CVE-2026-85197 (rhbz#2528508)
- CVE-2026-103399 (rhbz#2543958)
- CVE-2026-85534 (rhbz#2528444)
- CVE-2026-3633 (rhbz#2445149)
- CVE-2026-3099 (rhbz#2442235)

Assisted-by: Claude

---
diff --git a/CVE-2026-102555.patch b/CVE-2026-102555.patch
new file mode 100644
index 0000000..01d75db
--- /dev/null
+++ b/CVE-2026-102555.patch
@@ -0,0 +1,82 @@
+From e4f032268fa18f691a6c34d6adcb5b666f3e3f77 Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:30:58 -0500
+Subject: [PATCH] uri-utils: Don't treat base64 data URI content as a
+ NUL-terminated string
+
+soup_uri_decode_data_uri() percent-decodes the payload and then passed it
+to g_base64_decode_inplace(), which measures its input with strlen().
+Percent-decoded data can contain NUL bytes, so for input such as
+"data:;base64,A%00B" the measured length was too short to satisfy that
+function's preconditions and it returned without writing the output
+length. The uninitialized length was then stored as the size of the
+returned GBytes, letting callers read past the allocation.
+
+Decode with g_base64_decode_step() using the real buffer length instead.
+Decoding in place remains safe because base64 output is never longer than
+its input.
+
+Also make the data URI tests actually compare the decoded bytes, which
+they never did; two existing expectations were wrong and are corrected.
+
+Fixes #554 (bug 1)
+---
+ libsoup/soup-uri-utils.c | 10 +++++++---
+ tests/uri-parsing-test.c | 11 ++++++++---
+ 2 files changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/libsoup/soup-uri-utils.c b/libsoup/soup-uri-utils.c
+index 44cc59b1..0ceb5e2a 100644
+--- a/libsoup/soup-uri-utils.c
++++ b/libsoup/soup-uri-utils.c
+@@ -408,10 +408,14 @@ soup_uri_decode_data_uri (const char *uri,
+                         if (g_bytes_get_size (bytes) <= 1)
+                                 g_clear_pointer (&bytes, g_bytes_unref);
+                         else {
+-                                gsize content_length;
+                                 GByteArray *unescaped_array = g_bytes_unref_to_array (bytes);
+-                                g_base64_decode_inplace ((gchar*)unescaped_array->data, &content_length);
+-                                unescaped_array->len = content_length;
++                                gint state = 0;
++                                guint save = 0;
++
++                                unescaped_array->len = g_base64_decode_step ((const gchar *)unescaped_array->data,
++                                                                             unescaped_array->len,
++                                                                             unescaped_array->data,
++                                                                             &state, &save);
+                                 bytes = g_byte_array_free_to_bytes (unescaped_array);
+                         }
+                 }
+diff --git a/tests/uri-parsing-test.c b/tests/uri-parsing-test.c
+index 877a5613..e6cf4701 100644
+--- a/tests/uri-parsing-test.c
++++ b/tests/uri-parsing-test.c
+@@ -184,10 +184,13 @@ static struct {
+         { "data:text/plain,hello", "hello", "text/plain" },
+         { "data:text/plain;charset=UTF-8,hello", "hello", "text/plain;charset=UTF-8" },
+         { "data:text/plain;base64,aGVsbG8=", "hello", "text/plain" },
+-        { "data:text/plain;base64,invalid=", "", "text/plain" },
++        { "data:text/plain;base64,invalid=", "\x8a\x7b\xda\x96\x27", "text/plain" },
+         { "data:,", "", CONTENT_TYPE_DEFAULT },
+-        { "data:.///", "./", CONTENT_TYPE_DEFAULT },
+-        { "data:/.//", "./", CONTENT_TYPE_DEFAULT },
++        { "data:.///", "/.//", CONTENT_TYPE_DEFAULT },
++        { "data:/.//", "/.//", CONTENT_TYPE_DEFAULT },
++        /* Embedded NUL bytes in base64 data must not be treated as the end of the input */
++        { "data:;base64,%00%00%00", "", CONTENT_TYPE_DEFAULT },
++        { "data:;base64,aGVs%00bG8=", "hello", CONTENT_TYPE_DEFAULT },
+ };
+ 
+ static void
+@@ -207,6 +210,8 @@ do_data_uri_tests (void)
+ 
+                 g_assert_nonnull (output);
+                 g_assert_cmpstr (content_type, ==, data_uri_tests[i].content_type);
++                g_assert_cmpmem (g_bytes_get_data (output, NULL), g_bytes_get_size (output),
++                                 data_uri_tests[i].output, strlen (data_uri_tests[i].output));
+ 
+ 		g_free (content_type);
+ 		g_bytes_unref (output);
+-- 
+GitLab
+

diff --git a/CVE-2026-102556.patch b/CVE-2026-102556.patch
new file mode 100644
index 0000000..92c1fa4
--- /dev/null
+++ b/CVE-2026-102556.patch
@@ -0,0 +1,61 @@
+From d2cbaf25f81a9ce041714cf842c366c67b0b873e Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:28:14 -0500
+Subject: [PATCH] websocket: Emit the pong signal with a GBytes as declared
+
+Fixes #554
+---
+ libsoup/websocket/soup-websocket-connection.c | 7 ++++---
+ tests/websocket-test.c                        | 7 +++++++
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/libsoup/websocket/soup-websocket-connection.c b/libsoup/websocket/soup-websocket-connection.c
+index 39e640a5..0751ea95 100644
+--- a/libsoup/websocket/soup-websocket-connection.c
++++ b/libsoup/websocket/soup-websocket-connection.c
+@@ -878,6 +878,7 @@ receive_pong (SoupWebsocketConnection *self,
+ {
+         SoupWebsocketConnectionPrivate *priv = soup_websocket_connection_get_instance_private (self);
+ 	GByteArray *bytes;
++	GBytes *payload;
+ 
+ 	bytes = g_byte_array_sized_new (len + 1);
+ 	g_byte_array_append (bytes, data, len);
+@@ -898,9 +899,9 @@ receive_pong (SoupWebsocketConnection *self,
+                 g_debug ("received pong message");
+         }
+ 
+-	g_signal_emit (self, signals[PONG], 0, bytes);
+-	g_byte_array_unref (bytes);
+-
++	payload = g_byte_array_free_to_bytes (bytes);
++	g_signal_emit (self, signals[PONG], 0, payload);
++	g_bytes_unref (payload);
+ }
+ 
+ static void
+diff --git a/tests/websocket-test.c b/tests/websocket-test.c
+index b06e9fa0..76897360 100644
+--- a/tests/websocket-test.c
++++ b/tests/websocket-test.c
+@@ -399,10 +399,17 @@ on_pong_set_flag (SoupWebsocketConnection *ws,
+                   gpointer user_data)
+ {
+         gboolean *flag = user_data;
++        const char *payload;
++        gsize size;
+ 
+         g_assert_false (*flag);
+         g_assert_nonnull (message);
+ 
++        payload = g_bytes_get_data (message, &size);
++        g_assert_cmpuint (size, >, strlen ("libsoup-keepalive-"));
++        g_assert_cmpuint (size, <=, 125);
++        g_assert_true (g_str_has_prefix (payload, "libsoup-keepalive-"));
++
+         *flag = TRUE;
+ }
+ 
+-- 
+GitLab
+

diff --git a/CVE-2026-102558.patch b/CVE-2026-102558.patch
new file mode 100644
index 0000000..437f77d
--- /dev/null
+++ b/CVE-2026-102558.patch
@@ -0,0 +1,173 @@
+From 381a474ff437d0f7573d2bb3e8d3027260ab584f Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:26:44 -0500
+Subject: [PATCH] websocket: Cap incoming frame payloads at what the buffer can
+ hold
+
+Incoming frames are accumulated in a GByteArray, whose length is a guint
+and whose growth is not safe beyond G_MAXINT on all supported GLib
+versions. With max-incoming-payload-size set to 0 (unlimited) a peer
+could declare a payload of a few GiB and stream it, and the buffer
+length would eventually wrap in g_byte_array_set_size() while the read
+still targeted the original offset, writing past the allocation.
+
+Reject any payload length above what the buffer can represent as soon as
+the frame header is parsed, before waiting for the payload. Doing this
+check first also means the at + payload_len arithmetic can no longer
+overflow, so the separate G_MAXSIZE guard that previously ran after that
+addition is no longer needed.
+
+Such frames are now reported as SOUP_WEBSOCKET_CLOSE_TOO_BIG rather than
+SOUP_WEBSOCKET_CLOSE_BAD_DATA, and, as for exceeding the configured
+limit, the stream is closed without a close handshake so that no further
+data is buffered.
+
+Fixes #553
+Fixes #554 (bug 6)
+
+[Adapted for libsoup 3.6.6: the "incoming payload too big" error close helper
+got renamed too_big_error_and_close() -> too_big_incoming_payload_error_and_close()
+at some point between 3.6.6 and the upstream version of this patch. The context
+of the "safety valve" hunk was adjusted to match]
+---
+ libsoup/websocket/soup-websocket-connection.c | 24 +++++----
+ tests/websocket-test.c                        | 49 +++++++++++++++++--
+ 2 files changed, 60 insertions(+), 13 deletions(-)
+
+diff --git a/libsoup/websocket/soup-websocket-connection.c b/libsoup/websocket/soup-websocket-connection.c
+index f07d4219..39e640a5 100644
+--- a/libsoup/websocket/soup-websocket-connection.c
++++ b/libsoup/websocket/soup-websocket-connection.c
+@@ -168,6 +168,13 @@ typedef struct {
+ #define MAX_INCOMING_PAYLOAD_SIZE_DEFAULT   128 * 1024
+ #define READ_BUFFER_SIZE 1024
+ #define MASK_LENGTH 4
++#define MAX_FRAME_HEADER_SIZE (10 + MASK_LENGTH)
++
++/* Incoming frames are buffered in a GByteArray, which uses guint lengths and
++ * whose growth is not safe beyond G_MAXINT on all supported GLib versions.
++ * Leave room for the largest possible frame header and one extra read.
++ */
++#define MAX_INCOMING_PAYLOAD_SIZE ((guint64)G_MAXINT - MAX_FRAME_HEADER_SIZE - READ_BUFFER_SIZE)
+ 
+ /* If a pong payload begins with these bytes, we assume it is a pong from one of
+  * our keepalive pings.
+@@ -1158,9 +1165,14 @@ process_frame (SoupWebsocketConnection *self)
+ 		break;
+ 	}
+ 
+-	/* Safety valve */
+-	if (priv->max_incoming_payload_size > 0 &&
+-	    payload_len > priv->max_incoming_payload_size) {
++	/* Safety valve. Even with no configured limit, the frame can never
++	 * exceed what the incoming buffer can hold. Checking this before any
++	 * arithmetic on payload_len also guarantees at + payload_len cannot
++	 * overflow below.
++	 */
++	if (payload_len > MAX_INCOMING_PAYLOAD_SIZE ||
++	    (priv->max_incoming_payload_size > 0 &&
++	     payload_len > priv->max_incoming_payload_size)) {
+ 		too_big_error_and_close (self, payload_len);
+ 		return FALSE;
+ 	}
+@@ -1170,12 +1182,6 @@ process_frame (SoupWebsocketConnection *self)
+ 
+ 	payload = header + at;
+ 
+-	/* at has a maximum value of 10 + 4 = 14 */
+-	if (payload_len > G_MAXSIZE - 14) {
+-		bad_data_error_and_close (self);
+-		return FALSE;
+-	}
+-
+ 	if (masked) {
+ 		mask = header + at;
+ 		payload += 4;
+diff --git a/tests/websocket-test.c b/tests/websocket-test.c
+index 5f94b5f6..b06e9fa0 100644
+--- a/tests/websocket-test.c
++++ b/tests/websocket-test.c
+@@ -2758,13 +2758,12 @@ test_bad_length_masked (Test *test,
+ 	g_assert_cmpuint (written, ==, 14);
+ 
+ 	WAIT_UNTIL (error != NULL);
+-	g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_BAD_DATA);
++	g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_TOO_BIG);
+ 	g_clear_error (&error);
+ 
++	/* The receiver closes the stream immediately rather than negotiating a close */
+ 	WAIT_UNTIL (soup_websocket_connection_get_state (test->client) == SOUP_WEBSOCKET_STATE_CLOSED);
+ 	g_assert_true (close_event);
+-
+-	g_assert_cmpuint (soup_websocket_connection_get_close_code (test->client), ==, SOUP_WEBSOCKET_CLOSE_BAD_DATA);
+ }
+ 
+ static gpointer
+@@ -2802,7 +2801,7 @@ test_bad_length_unmasked (Test *test,
+ 	thread = g_thread_new ("send-bad-length-frame-thread", send_bad_length_frame_server_thread, test);
+ 
+ 	WAIT_UNTIL (error != NULL || received != NULL);
+-	g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_BAD_DATA);
++	g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_TOO_BIG);
+ 	g_clear_error (&error);
+ 	g_assert_null (received);
+ 
+@@ -2814,6 +2813,44 @@ test_bad_length_unmasked (Test *test,
+ 	WAIT_UNTIL (soup_websocket_connection_get_state (test->client) == SOUP_WEBSOCKET_STATE_CLOSED);
+ }
+ 
++/* A declared payload length that fits in a gsize,
++ * but that the GByteArray-backed incoming buffer can never
++ * hold. With no configured max-incoming-payload-size the receiver used to
++ * keep buffering until the array length wrapped.
++ */
++static void
++test_payload_over_buffer_limit (Test *test,
++                                gconstpointer unused)
++{
++	GError *error = NULL;
++	GIOStream *io;
++	gsize written;
++	/* Masked binary frame declaring a 2 GiB payload (10-byte header + 4-byte mask) */
++	const char frame[] = "\x82\xff\x00\x00\x00\x00\x80\x00\x00\x00\xaa\xbb\xcc\xdd";
++	gboolean close_event = FALSE;
++
++	g_signal_handlers_disconnect_by_func (test->server, on_error_not_reached, NULL);
++	g_signal_connect (test->server, "error", G_CALLBACK (on_error_copy), &error);
++	g_signal_connect (test->client, "closed", G_CALLBACK (on_close_set_flag), &close_event);
++
++	soup_websocket_connection_set_max_incoming_payload_size (test->server, 0);
++
++	io = soup_websocket_connection_get_io_stream (test->client);
++	g_output_stream_write_all (g_io_stream_get_output_stream (io),
++				   frame, sizeof (frame) - 1, &written, NULL, &error);
++	g_assert_no_error (error);
++	g_assert_cmpuint (written, ==, sizeof (frame) - 1);
++
++	/* The error must be reported from the header alone, without waiting for payload */
++	wait_for_websocket_error (&error);
++	g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_TOO_BIG);
++	g_clear_error (&error);
++
++	/* The receiver closes the stream immediately rather than negotiating a close */
++	WAIT_UNTIL (soup_websocket_connection_get_state (test->client) == SOUP_WEBSOCKET_STATE_CLOSED);
++	g_assert_true (close_event);
++}
++
+ int
+ main (int argc,
+       char *argv[])
+@@ -3177,6 +3214,10 @@ main (int argc,
+ 		    setup_direct_connection,
+ 		    test_bad_length_masked,
+ 		    teardown_direct_connection);
++	g_test_add ("/websocket/direct/payload-over-buffer-limit", Test, NULL,
++		    setup_direct_connection,
++		    test_payload_over_buffer_limit,
++		    teardown_direct_connection);
+ 	g_test_add ("/websocket/soup/bad-length-masked", Test, NULL,
+ 		    setup_soup_connection,
+ 		    test_bad_length_masked,
+-- 
+GitLab
+

diff --git a/CVE-2026-102559.patch b/CVE-2026-102559.patch
new file mode 100644
index 0000000..69172a5
--- /dev/null
+++ b/CVE-2026-102559.patch
@@ -0,0 +1,238 @@
+From d7f074f8c8c90216f2476522836287c6f80fc53e Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:34:38 -0500
+Subject: [PATCH] websocket: Cap message reassembly and outgoing frames at the
+ buffer limit
+
+Both a reassembled message and an outgoing frame are built in GByteArrays,
+whose length is a guint. A message grown past G_MAXINT by a run of
+fragments (or by an extension that expands its input) and a send payload
+at or above 2^32 both truncated the size passed to g_byte_array_set_size()
+/ g_byte_array_sized_new() while the surrounding code kept using the full
+length, corrupting the heap.
+
+Reject a reassembled message that would exceed what the array can hold
+before appending, independently of max-total-message-size, and reject an
+outgoing payload above the same ceiling both before and after extensions
+have processed it.
+
+Fixes #554
+
+[Adapted for libsoup 3.6.6: The test_receive_expanded_over_buffer_limit
+test case, together with its helpers, have been dropped from this patch.
+It depends on soup_websocket_connection_set_max_total_message_size(), which
+doesn't exist in 3.6.6 because the size is hard-coded instead. See also: our
+patch for CVE-2026-15709, which deals with a similar problem. The fix itself
+is unchanged]
+---
+ libsoup/websocket/soup-websocket-connection.c |  54 +++++++
+ po/POTFILES.in                                |   1 +
+ tests/websocket-test.c                        | 141 ++++++++++++++++++
+ 3 files changed, 196 insertions(+)
+
+diff --git a/libsoup/websocket/soup-websocket-connection.c b/libsoup/websocket/soup-websocket-connection.c
+index 0751ea95..b743379c 100644
+--- a/libsoup/websocket/soup-websocket-connection.c
++++ b/libsoup/websocket/soup-websocket-connection.c
+@@ -22,6 +22,8 @@
+ 
+ #include <string.h>
+ 
++#include <glib/gi18n-lib.h>
++
+ #include "soup-websocket-connection.h"
+ #include "soup-websocket-connection-private.h"
+ #include "soup-enum-types.h"
+@@ -176,6 +178,16 @@ typedef struct {
+  */
+ #define MAX_INCOMING_PAYLOAD_SIZE ((guint64)G_MAXINT - MAX_FRAME_HEADER_SIZE - READ_BUFFER_SIZE)
+ 
++/* Likewise for a reassembled message and for an outgoing frame, which are
++ * also built in GByteArrays. Extensions may expand a frame's payload, so the
++ * incoming cap above does not bound these on its own.
++ */
++#define MAX_MESSAGE_SIZE ((guint64)G_MAXINT - 1)
++#define MAX_OUTGOING_PAYLOAD_SIZE ((gsize)G_MAXINT - MAX_FRAME_HEADER_SIZE)
++
++static void too_big_outgoing_payload_error_and_close (SoupWebsocketConnection *self,
++                                                      gsize                    len);
++
+ /* If a pong payload begins with these bytes, we assume it is a pong from one of
+  * our keepalive pings.
+  */
+@@ -513,6 +525,11 @@ send_message (SoupWebsocketConnection *self,
+ 		return;
+ 	}
+ 
++	if (length > MAX_OUTGOING_PAYLOAD_SIZE) {
++		too_big_outgoing_payload_error_and_close (self, length);
++		return;
++	}
++
+ 	bytes = g_byte_array_sized_new (14 + length);
+ 	outer = bytes->data;
+ 	outer[0] = 0x80 | opcode;
+@@ -533,6 +550,14 @@ send_message (SoupWebsocketConnection *self,
+ 	data = g_bytes_get_data (filtered_bytes, &length);
+ 	buffered_amount = length;
+ 
++	/* Extensions may have grown the payload */
++	if (length > MAX_OUTGOING_PAYLOAD_SIZE) {
++		g_byte_array_free (bytes, TRUE);
++		g_bytes_unref (filtered_bytes);
++		too_big_outgoing_payload_error_and_close (self, length);
++		return;
++	}
++
+ 	/* If control message, check payload size */
+ 	if (opcode & 0x08) {
+ 		if (length > 125) {
+@@ -718,6 +743,20 @@ too_big_incoming_payload_error_and_close (SoupWebsocketConnection *self,
+ 	emit_error_and_close (self, error, TRUE);
+ }
+ 
++static void
++too_big_outgoing_payload_error_and_close (SoupWebsocketConnection *self,
++                                          gsize len)
++{
++	GError *error;
++
++	error = g_error_new_literal (SOUP_WEBSOCKET_ERROR,
++				     SOUP_WEBSOCKET_CLOSE_TOO_BIG,
++				     _("WebSocket message is too large to send"));
++	g_debug ("attempted to send a frame of size %" G_GSIZE_FORMAT ", but max supported size is %" G_GSIZE_FORMAT,
++	         len, MAX_OUTGOING_PAYLOAD_SIZE);
++	emit_error_and_close (self, error, FALSE);
++}
++
+ static void
+ too_big_message_error_and_close (SoupWebsocketConnection *self,
+                                  guint64 len)
+@@ -988,6 +1027,21 @@ process_contents (SoupWebsocketConnection *self,
+ 			g_debug ("received frame %d with %d payload", (int)opcode, (int)payload_len);
+ 		}
+ 
++		/* Regardless of max-total-message-size, the reassembled message
++		 * must fit in a GByteArray. Check before allocating, since
++		 * g_byte_array_sized_new() takes a guint too.
++		 */
++		if (payload_len > MAX_MESSAGE_SIZE - (priv->message_data ? priv->message_data->len : 0)) {
++			guint64 message_size = priv->message_data ? priv->message_data->len : 0;
++
++			if (payload_len > G_MAXUINT64 - message_size)
++				message_size = G_MAXUINT64;
++			else
++				message_size += payload_len;
++			too_big_message_error_and_close (self, message_size);
++			return;
++		}
++
+ 		if (opcode) {
+ 			priv->message_opcode = opcode;
+ 			priv->message_data = g_byte_array_sized_new (payload_len + 1);
+diff --git a/po/POTFILES.in b/po/POTFILES.in
+index a8fbbd9f..4b6dd76a 100644
+--- a/po/POTFILES.in
++++ b/po/POTFILES.in
+@@ -13,4 +13,5 @@ libsoup/server/soup-listener.c
+ libsoup/server/soup-server.c
+ libsoup/soup-session.c
+ libsoup/soup-tld.c
++libsoup/websocket/soup-websocket-connection.c
+ libsoup/websocket/soup-websocket.c
+diff --git a/tests/websocket-test.c b/tests/websocket-test.c
+index ee0aff9a..0b007d02 100644
+--- a/tests/websocket-test.c
++++ b/tests/websocket-test.c
+@@ -23,6 +23,9 @@
+ #include "soup-server-message-private.h"
+ #include "soup-websocket-connection-private.h"
+ #include <zlib.h>
++#ifdef G_OS_UNIX
++#include <sys/mman.h>
++#endif
+ 
+ typedef struct {
+ 	GSocket *listener;
+@@ -40,6 +43,7 @@ typedef struct {
+ 	GIOStream *raw_server;
+ 
+ 	gboolean enable_extensions;
++	GType server_extension_type;
+ 	gboolean disable_deflate_in_message;
+ 
+ 	GList *initial_cookies;
+@@ -179,6 +183,8 @@ got_connection (GSocket *listener,
+ 									   NULL, NULL));
+ 			extensions = g_list_prepend (extensions, extension);
+ 		}
++		if (test->server_extension_type)
++			extensions = g_list_prepend (extensions, g_object_new (test->server_extension_type, NULL));
+ 		test->server = soup_websocket_connection_new (G_IO_STREAM (conn), uri,
+ 							      SOUP_WEBSOCKET_CONNECTION_SERVER,
+ 							      NULL, NULL,
+@@ -2862,6 +2868,50 @@ test_bad_length_unmasked (Test *test,
+ 	WAIT_UNTIL (soup_websocket_connection_get_state (test->client) == SOUP_WEBSOCKET_STATE_CLOSED);
+ }
+ 
++/* Sending a payload larger than a GByteArray can hold. The frame is built in
++ * a GByteArray, so g_byte_array_sized_new() and g_byte_array_append() used to
++ * truncate the length while xor_with_mask() still iterated the full length,
++ * writing past the small allocation. The mapping is never read when the size
++ * is rejected up front, so MAP_NORESERVE keeps this cheap.
++ */
++static void
++test_send_over_buffer_limit (Test *test,
++                             gconstpointer unused)
++{
++#ifdef G_OS_UNIX
++	GError *error = NULL;
++	gsize length = (gsize)G_MAXINT + 1;
++	void *payload;
++
++	if (sizeof (gsize) < 8) {
++		g_test_skip ("needs a 64-bit gsize");
++		return;
++	}
++
++	payload = mmap (NULL, length, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0);
++	if (payload == MAP_FAILED) {
++		g_test_skip ("could not map a 2 GiB region");
++		return;
++	}
++
++	g_signal_handlers_disconnect_by_func (test->client, on_error_not_reached, NULL);
++	g_signal_connect (test->client, "error", G_CALLBACK (on_error_copy), &error);
++
++	soup_websocket_connection_send_binary (test->client, payload, length);
++
++	wait_for_websocket_error (&error);
++	g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_TOO_BIG);
++	g_clear_error (&error);
++
++	WAIT_UNTIL (soup_websocket_connection_get_state (test->client) == SOUP_WEBSOCKET_STATE_CLOSED);
++	g_assert_cmpuint (soup_websocket_connection_get_close_code (test->client), ==, SOUP_WEBSOCKET_CLOSE_TOO_BIG);
++
++	munmap (payload, length);
++#else
++	g_test_skip ("needs mmap");
++#endif
++}
++
+ /* A declared payload length that fits in a gsize,
+  * but that the GByteArray-backed incoming buffer can never
+  * hold. With no configured max-incoming-payload-size the receiver used to
+@@ -3269,6 +3319,10 @@ main (int argc,
+ 		    setup_direct_connection,
+ 		    test_payload_over_buffer_limit,
+ 		    teardown_direct_connection);
++	g_test_add ("/websocket/direct/send-over-buffer-limit", Test, NULL,
++		    setup_direct_connection,
++		    test_send_over_buffer_limit,
++		    teardown_direct_connection);
+ 	g_test_add ("/websocket/soup/bad-length-masked", Test, NULL,
+ 		    setup_soup_connection,
+ 		    test_bad_length_masked,
+-- 
+GitLab
+

diff --git a/CVE-2026-102560.patch b/CVE-2026-102560.patch
new file mode 100644
index 0000000..da032d5
--- /dev/null
+++ b/CVE-2026-102560.patch
@@ -0,0 +1,139 @@
+From dbd0417ea3a569135e9a9344b7812076b7b178f1 Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:30:58 -0500
+Subject: [PATCH] websocket: Bound outgoing permessage-deflate buffer growth
+
+The outgoing deflater stored deflateBound()'s uLong result in a guint and
+grew its GByteArray by that amount. For a payload approaching 4 GiB the
+bound exceeds G_MAXUINT, the truncated value let buffer->len + max_length
+wrap on a later growth, and zlib then wrote through next_out past the
+allocation.
+
+Refuse payloads whose compressed bound cannot fit in a GByteArray before
+compressing, and check each incremental growth as well.
+
+Fixes #554
+---
+ .../soup-websocket-extension-deflate.c        | 24 +++++++++-
+ tests/websocket-test.c                        | 44 +++++++++++++++++++
+ 2 files changed, 67 insertions(+), 1 deletion(-)
+
+diff --git a/libsoup/websocket/soup-websocket-extension-deflate.c b/libsoup/websocket/soup-websocket-extension-deflate.c
+index 2c649a88..3a0fa546 100644
+--- a/libsoup/websocket/soup-websocket-extension-deflate.c
++++ b/libsoup/websocket/soup-websocket-extension-deflate.c
+@@ -283,6 +283,7 @@ soup_websocket_extension_deflate_process_outgoing_message (SoupWebsocketExtensio
+ {
+         const guint8 *payload_data;
+         gsize payload_length;
++        unsigned long bound;
+         guint max_length;
+         gboolean control;
+         GByteArray *buffer;
+@@ -306,11 +307,21 @@ soup_websocket_extension_deflate_process_outgoing_message (SoupWebsocketExtensio
+         if (payload_length == 0)
+                 return payload;
+ 
++        bound = deflateBound (&priv->deflater.zstream, payload_length);
++        if (bound > G_MAXUINT) {
++                g_set_error_literal (error,
++                                     SOUP_WEBSOCKET_ERROR,
++                                     SOUP_WEBSOCKET_CLOSE_TOO_BIG,
++                                     "Outgoing WebSocket message is too large to compress");
++                g_bytes_unref (payload);
++                return NULL;
++        }
++
+         /* Mark the frame as compressed using reserved bit 1 (0x40) */
+         header[0] |= 0x40;
+ 
+         buffer = g_byte_array_new ();
+-        max_length = deflateBound(&priv->deflater.zstream, payload_length);
++        max_length = (guint)bound;
+ 
+         priv->deflater.zstream.next_in = (void *)payload_data;
+         priv->deflater.zstream.avail_in = payload_length;
+@@ -324,6 +335,17 @@ soup_websocket_extension_deflate_process_outgoing_message (SoupWebsocketExtensio
+                 if (priv->deflater.zstream.avail_out == 0) {
+                         guint write_position;
+ 
++                        if (buffer->len > G_MAXUINT - max_length) {
++                                deflateReset (&priv->deflater.zstream);
++                                g_byte_array_unref (buffer);
++                                g_bytes_unref (payload);
++                                g_set_error_literal (error,
++                                                     SOUP_WEBSOCKET_ERROR,
++                                                     SOUP_WEBSOCKET_CLOSE_TOO_BIG,
++                                                     "Compressed WebSocket message is too large");
++                                return NULL;
++                        }
++
+                         priv->deflater.zstream.avail_out = max_length;
+                         write_position = buffer->len;
+                         g_byte_array_set_size (buffer, buffer->len + max_length);
+diff --git a/tests/websocket-test.c b/tests/websocket-test.c
+index 76897360..ee0aff9a 100644
+--- a/tests/websocket-test.c
++++ b/tests/websocket-test.c
+@@ -1809,6 +1809,48 @@ test_deflate_output_limit (gconstpointer data)
+ 	g_object_unref (sender);
+ }
+ 
++static void
++test_deflate_outgoing_too_large (void)
++{
++	SoupWebsocketExtension *extension;
++	GBytes *payload;
++	GBytes *output;
++	GError *error = NULL;
++	guint8 header = 0x82;
++	static const guint8 dummy[1] = { 0 };
++
++	if (sizeof (gsize) < 8) {
++		g_test_skip ("needs a 64-bit gsize");
++		return;
++	}
++
++	extension = g_object_new (SOUP_TYPE_WEBSOCKET_EXTENSION_DEFLATE, NULL);
++	g_assert_true (soup_websocket_extension_configure (extension,
++							   SOUP_WEBSOCKET_CONNECTION_CLIENT,
++							   NULL, &error));
++	g_assert_no_error (error);
++
++	/* The payload data is never read, so a bogus pointer is enough */
++	payload = g_bytes_new_static (dummy, (gsize)G_MAXUINT - 100);
++	output = soup_websocket_extension_process_outgoing_message (extension, &header,
++								    payload, &error);
++	g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_TOO_BIG);
++	g_assert_null (output);
++	/* The frame must not have been marked as compressed */
++	g_assert_cmpuint (header & 0x40, ==, 0);
++	g_clear_error (&error);
++
++	/* The extension must still be usable afterwards */
++	payload = g_bytes_new_static ("hello", 5);
++	output = soup_websocket_extension_process_outgoing_message (extension, &header,
++								    payload, &error);
++	g_assert_no_error (error);
++	g_assert_nonnull (output);
++	g_bytes_unref (output);
++
++	g_object_unref (extension);
++}
++
+ static const DeflateOutputLimitTest deflate_output_below_limit = {
+ 	4095, 4096, FALSE
+ };
+@@ -3095,6 +3137,8 @@ main (int argc,
+ 
+ 	g_test_add_func ("/websocket/extension/incoming-limit-legacy-fallback",
+ 			 test_websocket_extension_limit_fallback);
++	g_test_add_func ("/websocket/deflate/outgoing-too-large",
++			 test_deflate_outgoing_too_large);
+ 	g_test_add_data_func ("/websocket/deflate/output-limit/below",
+ 			      &deflate_output_below_limit,
+ 			      test_deflate_output_limit);
+-- 
+GitLab
+
+

diff --git a/CVE-2026-103399.patch b/CVE-2026-103399.patch
new file mode 100644
index 0000000..444ddac
--- /dev/null
+++ b/CVE-2026-103399.patch
@@ -0,0 +1,335 @@
+From 333025aedfcf80c724e81cbd73b233510688d595 Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:40:03 -0500
+Subject: [PATCH 1/2] server: Close the connection after an early response to
+ Expect: 100-continue
+
+When a client sends "Expect: 100-continue" with a body and the server
+produces a final response before reading that body (for example a 401
+from a SoupAuthDomain), libsoup marked the read side done without draining
+the declared body bytes or closing the connection. RFC 9110 allows the
+client to send the body without waiting, so those bytes may already be in
+the socket buffer; on a kept-alive connection they were then parsed as the
+next request, allowing request smuggling behind a connection-pooling proxy.
+
+Send "Connection: close" in that case so the connection is torn down and
+the undrained body is discarded, as RFC 9112 requires.
+
+Fixes #539
+---
+ .../http1/soup-server-message-io-http1.c      |  13 ++
+ tests/server-test.c                           | 116 ++++++++++++++++++
+ 2 files changed, 129 insertions(+)
+
+diff --git a/libsoup/server/http1/soup-server-message-io-http1.c b/libsoup/server/http1/soup-server-message-io-http1.c
+index ff56fb06..2e3c122f 100644
+--- a/libsoup/server/http1/soup-server-message-io-http1.c
++++ b/libsoup/server/http1/soup-server-message-io-http1.c
+@@ -427,6 +427,19 @@ io_write (SoupServerMessageIOHTTP1 *server_io,
+                          * server did not set an error.
+                          */
+                         soup_server_message_set_status (msg, SOUP_STATUS_CONTINUE, NULL);
++                } else if (io->read_state == SOUP_MESSAGE_IO_STATE_BLOCKING &&
++                           !SOUP_STATUS_IS_INFORMATIONAL (status_code)) {
++                        /* The client requested "Expect: 100-continue" but the
++                         * server is sending a final response without reading
++                         * the request body. The client may already have sent
++                         * that body (RFC 9110 permits sending it without
++                         * waiting), and those undrained bytes must not be
++                         * parsed as the next request on a reused connection.
++                         * Force the connection closed, per RFC 9112.
++                         */
++                        soup_message_headers_replace_common (soup_server_message_get_response_headers (msg),
++                                                             SOUP_HEADER_CONNECTION, "close",
++                                                             SOUP_HEADER_VALUE_TRUSTED);
+                 }
+ 
+                 if (!io->write_buf->len)
+diff --git a/tests/server-test.c b/tests/server-test.c
+index db966ba2..bf3b5d26 100644
+--- a/tests/server-test.c
++++ b/tests/server-test.c
+@@ -497,6 +497,121 @@ do_multi_family_test (ServerData *sd, gconstpointer test_data)
+ 	do_multi_test (sd, uri1, uri2);
+ }
+ 
++static gboolean smuggle_auth_callback_hit;
++
++static void
++smuggle_target_callback (SoupServer        *server,
++			 SoupServerMessage *msg,
++			 const char        *path,
++			 GHashTable        *query,
++			 gpointer           data)
++{
++	/* The smuggled request must never be dispatched */
++	g_assert_not_reached ();
++}
++
++static gboolean
++smuggle_auth_callback (SoupAuthDomain    *domain,
++		       SoupServerMessage *msg,
++		       const char        *username,
++		       const char        *password,
++		       gpointer           user_data)
++{
++	smuggle_auth_callback_hit = TRUE;
++
++	/* Always reject, so the server sends a 401 before reading the body */
++	return FALSE;
++}
++
++/* A client that requests "Expect: 100-continue" may still send its body
++ * without waiting. If the server produces an early final response (here a 401
++ * from an auth domain) without draining that body, the leftover bytes must not
++ * be parsed as the next request on a kept-alive connection. See issue #539.
++ */
++static void
++do_early_response_expect_continue_test (void)
++{
++	SoupServer *server;
++	SoupAuthDomain *auth_domain;
++	GUri *uri;
++	GSocketClient *client;
++	GSocketConnection *conn;
++	GInputStream *istream;
++	GOutputStream *ostream;
++	GError *error = NULL;
++	char *request;
++	const char *smuggled = "GET /smuggled HTTP/1.1\r\nHost: localhost\r\n\r\n";
++	char buf[4096];
++	gsize total = 0;
++	gssize n;
++
++	smuggle_auth_callback_hit = FALSE;
++
++	server = soup_test_server_new (SOUP_TEST_SERVER_IN_THREAD);
++	soup_server_add_handler (server, "/smuggled", smuggle_target_callback, NULL, NULL);
++	auth_domain = soup_auth_domain_basic_new ("realm", "smuggle-test",
++						  "auth-callback", smuggle_auth_callback,
++						  NULL);
++	soup_auth_domain_add_path (auth_domain, "/protected");
++	soup_server_add_auth_domain (server, auth_domain);
++	g_object_unref (auth_domain);
++
++	uri = soup_test_server_get_uri (server, "http", "127.0.0.1");
++
++	client = g_socket_client_new ();
++	conn = g_socket_client_connect_to_host (client, "127.0.0.1", g_uri_get_port (uri), NULL, &error);
++	g_assert_no_error (error);
++	/* Bound the read so the buggy behaviour (connection kept open) fails
++	 * quickly rather than hanging.
++	 */
++	g_socket_set_timeout (g_socket_connection_get_socket (conn), 5);
++	istream = g_io_stream_get_input_stream (G_IO_STREAM (conn));
++	ostream = g_io_stream_get_output_stream (G_IO_STREAM (conn));
++
++	/* Send credentials so the auth domain reaches smuggle_auth_callback
++	 * and rejects there, rather than refusing for lack of a header.
++	 */
++	request = g_strdup_printf ("POST /protected HTTP/1.1\r\n"
++				   "Host: localhost\r\n"
++				   "Authorization: Basic dXNlcjpwYXNzd29yZA==\r\n"
++				   "Content-Length: %zu\r\n"
++				   "Expect: 100-continue\r\n"
++				   "\r\n"
++				   "%s",
++				   strlen (smuggled), smuggled);
++	g_output_stream_write_all (ostream, request, strlen (request), NULL, NULL, &error);
++	g_assert_no_error (error);
++
++	/* Read until the server closes the connection. A conformant server
++	 * sends a single 401 and closes; the smuggled request is never run.
++	 */
++	while ((n = g_input_stream_read (istream, buf + total,
++					 sizeof (buf) - 1 - total, NULL, &error)) > 0) {
++		total += n;
++		if (total >= sizeof (buf) - 1)
++			break;
++	}
++	buf[total] = '\0';
++
++	g_assert_true (smuggle_auth_callback_hit);
++	g_assert_nonnull (strstr (buf, " 401 "));
++	/* The server must not have produced a second response for the
++	 * smuggled request.
++	 */
++	g_assert_null (strstr (buf, " 200 "));
++	/* The connection must have been closed cleanly (EOF), not left open */
++	g_assert_no_error (error);
++	g_assert_cmpint (n, ==, 0);
++	g_clear_error (&error);
++
++	g_free (request);
++	g_io_stream_close (G_IO_STREAM (conn), NULL, NULL);
++	g_object_unref (conn);
++	g_object_unref (client);
++	g_uri_unref (uri);
++	soup_test_server_quit_unref (server);
++}
++
+ static void
+ do_gsocket_import_test (void)
+ {
+@@ -1522,6 +1637,7 @@ main (int argc, char **argv)
+ 		    NULL, do_multi_scheme_test, server_teardown);
+ 	g_test_add ("/server/multi/family", ServerData, NULL,
+ 		    NULL, do_multi_family_test, server_teardown);
++	g_test_add_func ("/server/early-response-expect-continue", do_early_response_expect_continue_test);
+ 	g_test_add_func ("/server/import/gsocket", do_gsocket_import_test);
+ 	g_test_add_func ("/server/import/fd", do_fd_import_test);
+ 	g_test_add_func ("/server/accept/iostream", do_iostream_accept_test);
+-- 
+GitLab
+
+
+From df785cd3520d8f1cd18056f09c9abe978a3242f3 Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:42:55 -0500
+Subject: [PATCH 2/2] server: Reject Host headers containing URI delimiters
+
+The request URI is built by interpolating the Host header into a string
+that is then parsed as a URI. The code only rejected a Host containing
+'/', so a value with a percent-encoded '?' or '#' (for example
+"localhost:80%3fkey=value%23") shifted the query or fragment of the
+resulting URI. Behind a proxy that applies path-based checks this creates
+a request-interpretation differential.
+
+Reject Host header values containing control characters, spaces, '%', or
+any of the URI structural delimiters before constructing the URI.
+
+Fixes #492
+---
+ .../http1/soup-server-message-io-http1.c      | 22 +++++-
+ tests/server-test.c                           | 68 +++++++++++++++++++
+ 2 files changed, 89 insertions(+), 1 deletion(-)
+
+diff --git a/libsoup/server/http1/soup-server-message-io-http1.c b/libsoup/server/http1/soup-server-message-io-http1.c
+index 2e3c122f..e45239f0 100644
+--- a/libsoup/server/http1/soup-server-message-io-http1.c
++++ b/libsoup/server/http1/soup-server-message-io-http1.c
+@@ -629,6 +629,26 @@ parse_connect_authority (const char *req_path)
+ 	return uri;
+ }
+ 
++/* RFC 9110 defines Host as "uri-host [ ":" port ]", so it never carries a
++ * path, query, fragment or userinfo. Reject values holding characters that
++ * would let the constructed request URI be reinterpreted: "?" and "#" shift
++ * the path and query, and "@" moves the host itself, since everything before
++ * it parses as userinfo. Either way a proxy and this server would disagree
++ * about what was requested.
++ */
++static gboolean
++req_host_is_valid (const char *host)
++{
++        const char *p;
++
++        for (p = host; *p; p++) {
++                if ((guchar)*p <= ' ' || strchr ("/?#\\%@", *p))
++                        return FALSE;
++        }
++
++        return TRUE;
++}
++
+ static guint
+ parse_headers (SoupServerMessage *msg,
+                char              *headers,
+@@ -678,7 +698,7 @@ parse_headers (SoupServerMessage *msg,
+ 
+         /* Generate correct context for request */
+         req_host = soup_message_headers_get_one_common (request_headers, SOUP_HEADER_HOST);
+-        if (req_host && strchr (req_host, '/')) {
++        if (req_host && !req_host_is_valid (req_host)) {
+                 g_free (req_path);
+                 return SOUP_STATUS_BAD_REQUEST;
+         }
+diff --git a/tests/server-test.c b/tests/server-test.c
+index bf3b5d26..05358ab5 100644
+--- a/tests/server-test.c
++++ b/tests/server-test.c
+@@ -523,6 +523,73 @@ smuggle_auth_callback (SoupAuthDomain    *domain,
+ 	return FALSE;
+ }
+ 
++/* The server builds the request URI from the Host header. A Host value that
++ * smuggles URI delimiters (here a percent-encoded "?" and "#") must be
++ * rejected rather than shifting the path or query. See issue #492.
++ */
++static void
++assert_host_header_status (GUri       *server_uri,
++			   const char *host,
++			   const char *expected_status)
++{
++	GSocketClient *client;
++	GSocketConnection *conn;
++	GInputStream *istream;
++	GOutputStream *ostream;
++	GError *error = NULL;
++	char *request;
++	char buf[1024];
++	gssize n;
++
++	client = g_socket_client_new ();
++	conn = g_socket_client_connect_to_host (client, "127.0.0.1", g_uri_get_port (server_uri), NULL, &error);
++	g_assert_no_error (error);
++	g_socket_set_timeout (g_socket_connection_get_socket (conn), 5);
++	istream = g_io_stream_get_input_stream (G_IO_STREAM (conn));
++	ostream = g_io_stream_get_output_stream (G_IO_STREAM (conn));
++
++	request = g_strdup_printf ("GET /path HTTP/1.1\r\n"
++				   "Host: %s\r\n"
++				   "\r\n", host);
++	g_output_stream_write_all (ostream, request, strlen (request), NULL, NULL, &error);
++	g_assert_no_error (error);
++
++	n = g_input_stream_read (istream, buf, sizeof (buf) - 1, NULL, &error);
++	g_assert_no_error (error);
++	g_assert_cmpint (n, >, 0);
++	buf[n] = '\0';
++	soup_test_assert (strstr (buf, expected_status) != NULL,
++			  "Host: %s -> expected %s, got: %.*s",
++			  host, expected_status, (int)strcspn (buf, "\r\n"), buf);
++
++	g_free (request);
++	g_io_stream_close (G_IO_STREAM (conn), NULL, NULL);
++	g_object_unref (conn);
++	g_object_unref (client);
++}
++
++static void
++do_bad_host_header_test (void)
++{
++	SoupServer *server;
++	GUri *uri;
++
++	server = soup_test_server_new (SOUP_TEST_SERVER_IN_THREAD);
++	soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
++	uri = soup_test_server_get_uri (server, "http", "127.0.0.1");
++
++	assert_host_header_status (uri, "localhost:80%3fkey=value%23", " 400 ");
++	/* Everything before "@" parses as userinfo, so the real host becomes
++	 * whatever follows it.
++	 */
++	assert_host_header_status (uri, "localhost@internal.test", " 400 ");
++	assert_host_header_status (uri, "user:pass@internal.test", " 400 ");
++	assert_host_header_status (uri, "localhost", " 200 ");
++
++	g_uri_unref (uri);
++	soup_test_server_quit_unref (server);
++}
++
+ /* A client that requests "Expect: 100-continue" may still send its body
+  * without waiting. If the server produces an early final response (here a 401
+  * from an auth domain) without draining that body, the leftover bytes must not
+@@ -1638,6 +1705,7 @@ main (int argc, char **argv)
+ 	g_test_add ("/server/multi/family", ServerData, NULL,
+ 		    NULL, do_multi_family_test, server_teardown);
+ 	g_test_add_func ("/server/early-response-expect-continue", do_early_response_expect_continue_test);
++	g_test_add_func ("/server/bad-host-header", do_bad_host_header_test);
+ 	g_test_add_func ("/server/import/gsocket", do_gsocket_import_test);
+ 	g_test_add_func ("/server/import/fd", do_fd_import_test);
+ 	g_test_add_func ("/server/accept/iostream", do_iostream_accept_test);
+-- 
+GitLab
+

diff --git a/CVE-2026-3099.patch b/CVE-2026-3099.patch
new file mode 100644
index 0000000..5ee74d3
--- /dev/null
+++ b/CVE-2026-3099.patch
@@ -0,0 +1,331 @@
+From 07c5b406649d6eed19cd0ed9157e02d21abe3bcc Mon Sep 17 00:00:00 2001
+From: Milan Crha <mcrha@redhat.com>
+Date: Mon, 21 Sep 2026 15:59:06 +0200
+Subject: [PATCH] auth-domain-digest: Check nonce validity
+
+Let the Digest authentication check the `nonce` validity, to prevent
+message reply.
+
+This is CVE-2026-3099.
+
+Closes https://gitlab.gnome.org/GNOME/libsoup/-/work_items/495
+---
+ libsoup/server/soup-auth-domain-digest.c |  79 ++++++++++++-
+ tests/digest-nonce-replay-test.c         | 139 +++++++++++++++++++++++
+ tests/meson.build                        |   1 +
+ 3 files changed, 215 insertions(+), 4 deletions(-)
+ create mode 100644 tests/digest-nonce-replay-test.c
+
+diff --git a/libsoup/server/soup-auth-domain-digest.c b/libsoup/server/soup-auth-domain-digest.c
+index 8edb5c17..23ddbd52 100644
+--- a/libsoup/server/soup-auth-domain-digest.c
++++ b/libsoup/server/soup-auth-domain-digest.c
+@@ -43,11 +43,20 @@ struct _SoupAuthDomainDigest {
+ 	SoupAuthDomain parent;
+ };
+ 
++typedef struct {
++	gint64 issue_time;
++	guint64 max_nc;
++} SoupDigestNonceInfo;
++
++#define SOUP_DIGEST_NONCE_LIFETIME (300 * G_USEC_PER_SEC)
++
+ typedef struct {
+ 	SoupAuthDomainDigestAuthCallback auth_callback;
+ 	gpointer auth_data;
+ 	GDestroyNotify auth_dnotify;
+ 
++	GMutex nonce_lock;
++	GHashTable *nonces;
+ } SoupAuthDomainDigestPrivate;
+ 
+ G_DEFINE_FINAL_TYPE_WITH_PRIVATE (SoupAuthDomainDigest, soup_auth_domain_digest, SOUP_TYPE_AUTH_DOMAIN)
+@@ -55,6 +64,11 @@ G_DEFINE_FINAL_TYPE_WITH_PRIVATE (SoupAuthDomainDigest, soup_auth_domain_digest,
+ static void
+ soup_auth_domain_digest_init (SoupAuthDomainDigest *digest)
+ {
++	SoupAuthDomainDigestPrivate *priv =
++		soup_auth_domain_digest_get_instance_private (digest);
++
++	g_mutex_init (&priv->nonce_lock);
++	priv->nonces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+ }
+ 
+ static void
+@@ -66,6 +80,9 @@ soup_auth_domain_digest_finalize (GObject *object)
+ 	if (priv->auth_dnotify)
+ 		priv->auth_dnotify (priv->auth_data);
+ 
++	g_hash_table_destroy (priv->nonces);
++	g_mutex_clear (&priv->nonce_lock);
++
+ 	G_OBJECT_CLASS (soup_auth_domain_digest_parent_class)->finalize (object);
+ }
+ 
+@@ -207,11 +224,15 @@ check_hex_urp (SoupAuthDomain    *domain,
+ 	       const char        *username,
+ 	       const char        *hex_urp)
+ {
++	SoupAuthDomainDigestPrivate *priv =
++		soup_auth_domain_digest_get_instance_private (SOUP_AUTH_DOMAIN_DIGEST (domain));
+ 	const char *uri, *qop, *realm, *msg_username;
+ 	const char *nonce, *nc, *cnonce, *response;
+ 	char hex_a1[33], computed_response[33];
+ 	int nonce_count;
+ 	GUri *dig_uri, *req_uri;
++	SoupDigestNonceInfo *nonce_info;
++	gboolean accept;
+ 
+ 	msg_username = g_hash_table_lookup (params, "username");
+ 	if (!msg_username || strcmp (msg_username, username) != 0)
+@@ -272,6 +293,16 @@ check_hex_urp (SoupAuthDomain    *domain,
+ 	if (!response)
+ 		return FALSE;
+ 
++	g_mutex_lock (&priv->nonce_lock);
++
++	nonce_info = g_hash_table_lookup (priv->nonces, nonce);
++	if (!nonce_info ||
++	    g_get_monotonic_time () - nonce_info->issue_time > SOUP_DIGEST_NONCE_LIFETIME ||
++	    (guint64) nonce_count <= nonce_info->max_nc) {
++		g_mutex_unlock (&priv->nonce_lock);
++		return FALSE;
++	}
++
+ 	soup_auth_digest_compute_hex_a1 (hex_urp,
+ 					 SOUP_AUTH_DIGEST_ALGORITHM_MD5,
+ 					 nonce, cnonce, hex_a1);
+@@ -281,7 +312,14 @@ check_hex_urp (SoupAuthDomain    *domain,
+ 					   SOUP_AUTH_DIGEST_QOP_AUTH,
+ 					   nonce, cnonce, nonce_count,
+ 					   computed_response);
+-	return strcmp (response, computed_response) == 0;
++
++	accept = strcmp (response, computed_response) == 0;
++	if (accept)
++		nonce_info->max_nc = nonce_count;
++
++	g_mutex_unlock (&priv->nonce_lock);
++
++	return accept;
+ }
+ 
+ static char *
+@@ -330,20 +368,53 @@ soup_auth_domain_digest_accepts (SoupAuthDomain    *domain,
+ 	return ret_user;
+ }
+ 
++static void
++prune_expired_nonces (SoupAuthDomainDigestPrivate *priv,
++		      gint64                       now)
++{
++	GHashTableIter iter;
++	gpointer key, value;
++	SoupDigestNonceInfo *nonce_info;
++
++	g_hash_table_iter_init (&iter, priv->nonces);
++	while (g_hash_table_iter_next (&iter, &key, &value)) {
++		nonce_info = value;
++		if (now - nonce_info->issue_time > SOUP_DIGEST_NONCE_LIFETIME)
++			g_hash_table_iter_remove (&iter);
++	}
++}
++
+ static char *
+ soup_auth_domain_digest_challenge (SoupAuthDomain    *domain,
+ 				   SoupServerMessage *msg)
+ {
++	SoupAuthDomainDigestPrivate *priv =
++		soup_auth_domain_digest_get_instance_private (SOUP_AUTH_DOMAIN_DIGEST (domain));
+ 	GString *str;
++	char *nonce;
++	SoupDigestNonceInfo *nonce_info;
++	gint64 now;
++
++	now = g_get_monotonic_time ();
++	nonce = g_strdup_printf ("%lu%" G_GINT64_FORMAT, (unsigned long) msg, now);
++
++	nonce_info = g_new (SoupDigestNonceInfo, 1);
++	nonce_info->issue_time = now;
++	nonce_info->max_nc = 0;
++
++	g_mutex_lock (&priv->nonce_lock);
++	prune_expired_nonces (priv, now);
++	g_hash_table_replace (priv->nonces, g_strdup (nonce), nonce_info);
++	g_mutex_unlock (&priv->nonce_lock);
+ 
+ 	str = g_string_new ("Digest ");
+ 	soup_header_g_string_append_param_quoted (str, "realm", soup_auth_domain_get_realm (domain));
+-	g_string_append_printf (str, ", nonce=\"%lu%lu\"", 
+-				(unsigned long) msg,
+-				(unsigned long) time (0));
++	g_string_append_printf (str, ", nonce=\"%s\"", nonce);
+ 	g_string_append_printf (str, ", qop=\"auth\"");
+ 	g_string_append_printf (str, ", algorithm=MD5");
+ 
++	g_free (nonce);
++
+ 	return g_string_free (str, FALSE);
+ }
+ 
+diff --git a/tests/digest-nonce-replay-test.c b/tests/digest-nonce-replay-test.c
+new file mode 100644
+index 00000000..78f2699d
+--- /dev/null
++++ b/tests/digest-nonce-replay-test.c
+@@ -0,0 +1,139 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
++
++#include "test-utils.h"
++#include "soup-auth-digest-private.h"
++
++#define REALM "digest-replay-test"
++
++static void
++server_cb (SoupServer        *server,
++	   SoupServerMessage *msg,
++	   const char        *path,
++	   GHashTable        *query,
++	   gpointer           user_data)
++{
++	soup_server_message_set_status (msg, SOUP_STATUS_OK, NULL);
++	soup_server_message_set_response (msg, "text/plain", SOUP_MEMORY_STATIC, "ok", 2);
++}
++
++static char *
++auth_callback (SoupAuthDomain    *domain,
++	       SoupServerMessage *msg,
++	       const char        *username,
++	       gpointer           user_data)
++{
++	if (strcmp (username, "user") != 0)
++		return NULL;
++
++	return soup_auth_domain_digest_encode_password ("user", REALM, "password");
++}
++
++static SoupMessage *
++send_with_authorization (SoupSession *session,
++	                 const char  *url,
++	                 const char  *authorization)
++{
++	SoupMessage *msg;
++	GBytes *body;
++	GError *error = NULL;
++
++	msg = soup_message_new (SOUP_METHOD_GET, url);
++	if (authorization) {
++		soup_message_headers_replace (soup_message_get_request_headers (msg),
++					      "Authorization", authorization);
++	}
++	body = soup_test_session_async_send (session, msg, NULL, &error);
++	g_assert_no_error (error);
++	g_clear_pointer (&body, g_bytes_unref);
++
++	return msg;
++}
++
++static void
++do_digest_nonce_replay_test (void)
++{
++	SoupServer *server;
++	SoupAuthDomain *auth_domain;
++	SoupSession *session;
++	SoupMessage *msg;
++	GUri *base_uri;
++	char *base_str, *url;
++	const char *www_authenticate;
++	GHashTable *challenge_params;
++	const char *nonce;
++	char hex_urp[33], response[33];
++	char *authorization;
++
++	server = soup_test_server_new (SOUP_TEST_SERVER_IN_THREAD);
++	soup_server_add_handler (server, NULL, server_cb, NULL, NULL);
++
++	auth_domain = soup_auth_domain_digest_new (
++		"realm", REALM,
++		"auth-callback", auth_callback,
++		NULL);
++	soup_auth_domain_add_path (auth_domain, "/");
++	soup_server_add_auth_domain (server, auth_domain);
++	g_object_unref (auth_domain);
++
++	base_uri = soup_test_server_get_uri (server, "http", "127.0.0.1");
++	base_str = g_uri_to_string (base_uri);
++	url = g_strconcat (base_str, "protected", NULL);
++
++	session = soup_test_session_new (NULL);
++
++	/* Get challenged, and extract the nonce the server issued. */
++	msg = send_with_authorization (session, url, NULL);
++	soup_test_assert_message_status (msg, SOUP_STATUS_UNAUTHORIZED);
++	www_authenticate = soup_message_headers_get_one (soup_message_get_response_headers (msg), "WWW-Authenticate");
++	g_assert_nonnull (www_authenticate);
++	g_assert_true (g_str_has_prefix (www_authenticate, "Digest "));
++	challenge_params = soup_header_parse_param_list (www_authenticate + strlen ("Digest "));
++	nonce = g_hash_table_lookup (challenge_params, "nonce");
++	g_assert_nonnull (nonce);
++	g_object_unref (msg);
++
++	/* Hand-compute a valid Authorization header for that nonce. */
++	soup_auth_digest_compute_hex_urp ("user", REALM, "password", hex_urp);
++	soup_auth_digest_compute_response ("GET", "/protected", hex_urp,
++					   SOUP_AUTH_DIGEST_QOP_AUTH,
++					   nonce, "clientnonce", 1, response);
++	authorization = g_strdup_printf (
++		"Digest username=\"user\", realm=\"%s\", nonce=\"%s\", uri=\"/protected\", "
++		"qop=auth, nc=00000001, cnonce=\"clientnonce\", response=\"%s\"",
++		REALM, nonce, response);
++
++	/* The first use of this Authorization header must succeed. */
++	msg = send_with_authorization (session, url, authorization);
++	soup_test_assert_message_status (msg, SOUP_STATUS_OK);
++	g_object_unref (msg);
++
++	/* Replaying the exact same header -- same nonce, same nc, same
++	 * cnonce, same response -- must be rejected.
++	 */
++	msg = send_with_authorization (session, url, authorization);
++	soup_test_assert_message_status (msg, SOUP_STATUS_UNAUTHORIZED);
++	g_object_unref (msg);
++
++	g_free (authorization);
++	soup_header_free_param_list (challenge_params);
++	soup_test_session_abort_unref (session);
++	g_free (base_str);
++	g_free (url);
++	g_uri_unref (base_uri);
++	soup_test_server_quit_unref (server);
++}
++
++int
++main (int argc, char **argv)
++{
++	int ret;
++
++	test_init (argc, argv, NULL);
++
++	g_test_add_func ("/digest-nonce-replay/rejected", do_digest_nonce_replay_test);
++
++	ret = g_test_run ();
++
++	test_cleanup ();
++	return ret;
++}
+diff --git a/tests/meson.build b/tests/meson.build
+index c4f9accd..e6e1e600 100644
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -88,6 +88,7 @@ tests = [
+   {'name': 'continue'},
+   {'name': 'cookies'},
+   {'name': 'date'},
++  {'name': 'digest-nonce-replay'},
+   {'name': 'forms'},
+   {'name': 'header-parsing'},
+   {'name': 'http2', 'slow': true},
+-- 
+GitLab
+

diff --git a/CVE-2026-3633.patch b/CVE-2026-3633.patch
new file mode 100644
index 0000000..040bc06
--- /dev/null
+++ b/CVE-2026-3633.patch
@@ -0,0 +1,171 @@
+From 3faf81fa94ddbff9cc55b0c406e4f0594575914c Mon Sep 17 00:00:00 2001
+From: Milan Crha <mcrha@redhat.com>
+Date: Fri, 4 Sep 2026 10:09:55 +0200
+Subject: [PATCH 1/2] soup-message: Reject CRLF injection in HTTP method
+
+Reject methods not conforming to RFC 9110 'token' specification.
+
+This is CVE-2026-3633.
+
+Closes https://gitlab.gnome.org/GNOME/libsoup/-/work_items/484
+---
+ libsoup/soup-message.c | 32 +++++++++++++++++++++++++++++++-
+ tests/misc-test.c      | 22 ++++++++++++++++++++++
+ 2 files changed, 53 insertions(+), 1 deletion(-)
+
+diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
+index d86f58a3..c44daddd 100644
+--- a/libsoup/soup-message.c
++++ b/libsoup/soup-message.c
+@@ -3121,6 +3121,28 @@ soup_message_set_reason_phrase (SoupMessage *msg, const char *reason_phrase)
+         g_object_notify_by_pspec (G_OBJECT (msg), properties[PROP_REASON_PHRASE]);
+ }
+ 
++/* Validates that a method string conforms to the RFC 9110 'token' specification. */
++static gboolean
++method_is_valid (const char *method)
++{
++        const char *p;
++
++        if (method == NULL || *method == '\0')
++                return FALSE;
++
++        for (p = method; *p != '\0'; p++) {
++                char c = *p;
++
++                if (g_ascii_isalnum (c))
++                        continue;
++
++	        if (strchr ("!#$%&\'*+-.^_`|~", c) == NULL)
++		        return FALSE;
++        }
++
++        return TRUE;
++}
++
+ /**
+  * soup_message_set_method: (attributes org.gtk.Method.set_property=method)
+  * @msg: a #SoupMessage
+@@ -3133,8 +3155,16 @@ soup_message_set_method (SoupMessage *msg,
+                          const char  *method)
+ {
+         SoupMessagePrivate *priv = soup_message_get_instance_private (msg);
+-        const char *new_method = g_intern_string (method);
++        const char *new_method;
++
++        g_return_if_fail (method != NULL);
++
++        if (!method_is_valid (method)) {
++                g_warning ("soup_message_set_method: Rejecting invalid method '%s'", method);
++                return;
++        }
+ 
++        new_method = g_intern_string (method);
+         if (priv->method == new_method)
+                 return;
+ 
+diff --git a/tests/misc-test.c b/tests/misc-test.c
+index fe256d00..091910e4 100644
+--- a/tests/misc-test.c
++++ b/tests/misc-test.c
+@@ -103,6 +103,27 @@ server_callback (SoupServer        *server,
+ 	}
+ }
+ 
++static void
++do_method_injection_test (void)
++{
++        SoupMessage *msg;
++
++        g_test_expect_message ("libsoup", G_LOG_LEVEL_WARNING,
++                               "soup_message_set_method: Rejecting invalid method*");
++        msg = soup_message_new_from_uri ("GET / HTTP/1.1\r\nX-Injected: evil", base_uri);
++        g_assert_null (soup_message_get_method (msg));
++        g_test_assert_expected_messages ();
++        g_object_unref (msg);
++
++        g_test_expect_message ("libsoup", G_LOG_LEVEL_WARNING,
++                               "soup_message_set_method: Rejecting invalid method*");
++        msg = soup_message_new_from_uri (SOUP_METHOD_GET, base_uri);
++        soup_message_set_method (msg, "POST /evil HTTP/1.1\r\nHost: attacker\r\n\r\nGET");
++        g_assert_cmpstr (soup_message_get_method (msg), ==, SOUP_METHOD_GET);
++        g_test_assert_expected_messages ();
++        g_object_unref (msg);
++}
++
+ /* Host header handling: client must be able to override the default
+  * value, server must be able to recognize different Host values.
+  */
+@@ -1181,6 +1202,7 @@ main (int argc, char **argv)
+ 
+ 	g_test_add_func ("/misc/bigheader", do_host_big_header);
+ 	g_test_add_func ("/misc/host", do_host_test);
++	g_test_add_func ("/misc/method-injection", do_method_injection_test);
+ 	g_test_add_func ("/misc/callback-unref/msg", do_callback_unref_test);
+ 	g_test_add_func ("/misc/msg-reuse", do_msg_reuse_test);
+ 	g_test_add_func ("/misc/early-abort/msg", do_early_abort_test);
+-- 
+GitLab
+
+
+From cfcee41b93635edce7cf3defc03f40f0a209754a Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Sun, 13 Sep 2026 16:52:13 -0500
+Subject: [PATCH 2/2] soup-message: Use g_return_if_fail() for the method check
+
+Passing a malformed method is a programmer error, so treat it like every
+other precondition in this API rather than warning by hand. g_return_if_fail()
+is only compiled out under G_DISABLE_CHECKS, which libsoup does not define.
+
+method_is_valid() already rejects NULL, so the separate NULL precondition
+is redundant.
+---
+ libsoup/soup-message.c | 7 +------
+ tests/misc-test.c      | 8 ++++----
+ 2 files changed, 5 insertions(+), 10 deletions(-)
+
+diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
+index c44daddd..17be0195 100644
+--- a/libsoup/soup-message.c
++++ b/libsoup/soup-message.c
+@@ -3157,12 +3157,7 @@ soup_message_set_method (SoupMessage *msg,
+         SoupMessagePrivate *priv = soup_message_get_instance_private (msg);
+         const char *new_method;
+ 
+-        g_return_if_fail (method != NULL);
+-
+-        if (!method_is_valid (method)) {
+-                g_warning ("soup_message_set_method: Rejecting invalid method '%s'", method);
+-                return;
+-        }
++        g_return_if_fail (method_is_valid (method));
+ 
+         new_method = g_intern_string (method);
+         if (priv->method == new_method)
+diff --git a/tests/misc-test.c b/tests/misc-test.c
+index 091910e4..e781cc35 100644
+--- a/tests/misc-test.c
++++ b/tests/misc-test.c
+@@ -108,15 +108,15 @@ do_method_injection_test (void)
+ {
+         SoupMessage *msg;
+ 
+-        g_test_expect_message ("libsoup", G_LOG_LEVEL_WARNING,
+-                               "soup_message_set_method: Rejecting invalid method*");
++        g_test_expect_message ("libsoup", G_LOG_LEVEL_CRITICAL,
++                               "*assertion*method_is_valid*failed*");
+         msg = soup_message_new_from_uri ("GET / HTTP/1.1\r\nX-Injected: evil", base_uri);
+         g_assert_null (soup_message_get_method (msg));
+         g_test_assert_expected_messages ();
+         g_object_unref (msg);
+ 
+-        g_test_expect_message ("libsoup", G_LOG_LEVEL_WARNING,
+-                               "soup_message_set_method: Rejecting invalid method*");
++        g_test_expect_message ("libsoup", G_LOG_LEVEL_CRITICAL,
++                               "*assertion*method_is_valid*failed*");
+         msg = soup_message_new_from_uri (SOUP_METHOD_GET, base_uri);
+         soup_message_set_method (msg, "POST /evil HTTP/1.1\r\nHost: attacker\r\n\r\nGET");
+         g_assert_cmpstr (soup_message_get_method (msg), ==, SOUP_METHOD_GET);
+-- 
+GitLab
+

diff --git a/CVE-2026-85197.patch b/CVE-2026-85197.patch
new file mode 100644
index 0000000..ecb9108
--- /dev/null
+++ b/CVE-2026-85197.patch
@@ -0,0 +1,126 @@
+From ebf2d8ad8d2507787c286883a02874f0539c0206 Mon Sep 17 00:00:00 2001
+From: Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
+Date: Tue, 19 Aug 2025 20:02:48 +0000
+Subject: [PATCH] http2: fix crash in on_data_read after connection has been
+ destroyed
+
+wrap the item's cancellable object, so `on_data_read` can be canceled
+in soup_http2_message_data_close.
+---
+ libsoup/http2/soup-client-message-io-http2.c | 29 +++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
+index 0b40d7a8..6694a5fc 100644
+--- a/libsoup/http2/soup-client-message-io-http2.c
++++ b/libsoup/http2/soup-client-message-io-http2.c
+@@ -103,6 +103,8 @@ typedef struct {
+         GByteArray *data_source_buffer;
+         GError *data_source_error;
+         gboolean data_source_eof;
++        GCancellable *data_source_cancellable;
++        gulong data_source_cancellable_id;
+ 
+         SoupClientMessageIOHTTP2 *io; /* Unowned */
+         SoupMessageIOCompletionFn completion_cb;
+@@ -1248,6 +1250,14 @@ log_request_data (SoupHTTP2MessageData *data,
+         soup_logger_log_request_data (data->logger, data->msg, (const char *)buffer, len);
+ }
+ 
++static void
++on_data_source_cancelled (GCancellable *cancellable,
++                          gpointer      data)
++{
++        GCancellable *linked_cancellable = G_CANCELLABLE (data);
++        g_cancellable_cancel (linked_cancellable);
++}
++
+ static ssize_t
+ on_data_source_read_callback (nghttp2_session     *session,
+                               int32_t              stream_id,
+@@ -1379,9 +1389,17 @@ on_data_source_read_callback (nghttp2_session     *session,
+                 } else {
+                         h2_debug (data->io, data, "[SEND_BODY] Reading async");
+                         g_byte_array_set_size (data->data_source_buffer, length);
++                        if (!data->data_source_cancellable) {
++                                data->data_source_cancellable = g_cancellable_new ();
++                                if (data->item->cancellable) {
++                                        data->data_source_cancellable_id =
++                                                g_cancellable_connect (data->item->cancellable, G_CALLBACK (on_data_source_cancelled),
++                                                                       g_object_ref (data->data_source_cancellable),  g_object_unref);
++                                }
++                        }
+                         g_input_stream_read_async (in_stream, data->data_source_buffer->data, length,
+                                                    get_data_io_priority (data),
+-                                                   data->item->cancellable,
++                                                   data->data_source_cancellable,
+                                                    (GAsyncReadyCallback)on_data_read, data);
+                         data->io->in_callback--;
+                         return NGHTTP2_ERR_DEFERRED;
+@@ -1466,6 +1484,15 @@ soup_http2_message_data_close (SoupHTTP2MessageData *data)
+                 g_clear_object (&data->body_istream);
+         }
+ 
++        if (data->data_source_cancellable_id) {
++                g_cancellable_disconnect (data->item->cancellable, data->data_source_cancellable_id);
++                data->data_source_cancellable_id = 0;
++        }
++        if (data->data_source_cancellable) {
++                g_cancellable_cancel(data->data_source_cancellable);
++                g_clear_object(&data->data_source_cancellable);
++        }
++
+         if (data->msg)
+                 g_signal_handlers_disconnect_by_data (data->msg, data);
+ 
+-- 
+GitLab
+
+
+From 3bf4a56c2d7e516dd8809f8a4f7a24b22c5b07ba Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Tue, 26 May 2026 12:47:39 -0500
+Subject: [PATCH] http2: Keep reference to message cancellable
+
+There is a possible condition where a SoupMessage is updated externally so we refer to the wrong cancellable later.
+---
+ libsoup/http2/soup-client-message-io-http2.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
+index 6694a5fc..1e196875 100644
+--- a/libsoup/http2/soup-client-message-io-http2.c
++++ b/libsoup/http2/soup-client-message-io-http2.c
+@@ -104,6 +104,7 @@ typedef struct {
+         GError *data_source_error;
+         gboolean data_source_eof;
+         GCancellable *data_source_cancellable;
++        GCancellable *data_source_message_cancellable;
+         gulong data_source_cancellable_id;
+ 
+         SoupClientMessageIOHTTP2 *io; /* Unowned */
+@@ -1392,8 +1393,9 @@ on_data_source_read_callback (nghttp2_session     *session,
+                         if (!data->data_source_cancellable) {
+                                 data->data_source_cancellable = g_cancellable_new ();
+                                 if (data->item->cancellable) {
++                                        data->data_source_message_cancellable = g_object_ref (data->item->cancellable);
+                                         data->data_source_cancellable_id =
+-                                                g_cancellable_connect (data->item->cancellable, G_CALLBACK (on_data_source_cancelled),
++                                                g_cancellable_connect (data->data_source_message_cancellable, G_CALLBACK (on_data_source_cancelled),
+                                                                        g_object_ref (data->data_source_cancellable),  g_object_unref);
+                                 }
+                         }
+@@ -1485,8 +1487,9 @@ soup_http2_message_data_close (SoupHTTP2MessageData *data)
+         }
+ 
+         if (data->data_source_cancellable_id) {
+-                g_cancellable_disconnect (data->item->cancellable, data->data_source_cancellable_id);
++                g_cancellable_disconnect (data->data_source_message_cancellable, data->data_source_cancellable_id);
+                 data->data_source_cancellable_id = 0;
++                g_clear_object (&data->data_source_message_cancellable);
+         }
+         if (data->data_source_cancellable) {
+                 g_cancellable_cancel(data->data_source_cancellable);
+-- 
+GitLab
+

diff --git a/CVE-2026-85534.patch b/CVE-2026-85534.patch
new file mode 100644
index 0000000..3b84b04
--- /dev/null
+++ b/CVE-2026-85534.patch
@@ -0,0 +1,169 @@
+From 58517108332c9b156fb1d3ead86e2d91e706494f Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:34:38 -0500
+Subject: [PATCH 1/2] http2: Keep the message alive across io_run_until in
+ run_until_read
+
+io_run_until() took and released its own reference on the SoupMessage,
+implying the message can be destroyed as a side effect of running I/O.
+But soup_client_message_io_http2_run_until_read() kept using the message
+and its SoupHTTP2MessageData after the call with no reference of its own,
+so a server GOAWAY that tore the message down during the run left it
+touching freed memory.
+
+Move the reference up into run_until_read(), which is the frame that
+outlives the I/O run, and re-fetch the message data afterwards since it
+may have been freed. io_run_until() no longer needs its own ref.
+
+Fixes #526
+---
+ libsoup/http2/soup-client-message-io-http2.c | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
+index b6742924..438774ca 100644
+--- a/libsoup/http2/soup-client-message-io-http2.c
++++ b/libsoup/http2/soup-client-message-io-http2.c
+@@ -1868,8 +1868,6 @@ io_run_until (SoupClientMessageIOHTTP2 *io,
+ 		return FALSE;
+ 	}
+ 
+-	g_object_ref (msg);
+-
+ 	while (progress && get_io_data (msg) == io && !data->paused && !data->error && data->state < state)
+                 progress = io_run (data, cancellable, &my_error);
+ 
+@@ -1883,7 +1881,6 @@ io_run_until (SoupClientMessageIOHTTP2 *io,
+ 
+ 	if (data->error) {
+                 g_propagate_error (error, g_steal_pointer (&data->error));
+-		g_object_unref (msg);
+ 		return FALSE;
+         }
+ 
+@@ -1891,13 +1888,11 @@ io_run_until (SoupClientMessageIOHTTP2 *io,
+ 		g_set_error_literal (error, G_IO_ERROR,
+ 				     G_IO_ERROR_CANCELLED,
+ 				     _("Operation was cancelled"));
+-		g_object_unref (msg);
+ 		return FALSE;
+ 	}
+ 
+ 	done = data->state >= state;
+ 
+-	g_object_unref (msg);
+ 	return done;
+ }
+ 
+@@ -1908,13 +1903,20 @@ soup_client_message_io_http2_run_until_read (SoupClientMessageIO  *iface,
+                                              GError              **error)
+ {
+         SoupClientMessageIOHTTP2 *io = (SoupClientMessageIOHTTP2 *)iface;
+-        SoupHTTP2MessageData *data = get_data_for_message (io, msg);
++        SoupHTTP2MessageData *data;
+         GError *my_error = NULL;
+ 
+-        if (io_run_until (io, msg, STATE_READ_DATA, cancellable, &my_error))
++        /* Running I/O may complete or cancel the message */
++        g_object_ref (msg);
++
++        if (io_run_until (io, msg, STATE_READ_DATA, cancellable, &my_error)) {
++                g_object_unref (msg);
+                 return TRUE;
++        }
+ 
+-        if (get_io_data (msg) == io) {
++        /* The message data may have been freed while running I/O */
++        data = get_data_for_message (io, msg);
++        if (data && get_io_data (msg) == io) {
+                 if (soup_http2_message_data_can_be_restarted (data, my_error))
+                         data->item->state = SOUP_MESSAGE_RESTARTING;
+                 else
+@@ -1924,6 +1926,7 @@ soup_client_message_io_http2_run_until_read (SoupClientMessageIO  *iface,
+         }
+ 
+         g_propagate_error (error, my_error);
++        g_object_unref (msg);
+ 
+         return FALSE;
+ }
+-- 
+GitLab
+
+
+From c2a3dfa6b38ea425a8561ca52dbdd5ad1eb04461 Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Fri, 4 Sep 2026 14:51:13 -0500
+Subject: [PATCH 2/2] http2: Never send more body bytes than nghttp2 requested
+
+When a request body comes from a non-pollable GInputStream, the data is
+read asynchronously into data_source_buffer and copied out on the next
+data-source callback. The copy used the buffered length and only asserted
+that it did not exceed nghttp2's requested length. A peer that shrinks the
+stream window with a SETTINGS frame after the read was issued makes the
+callback's length smaller than the buffered amount, so the memcpy wrote
+past the output buffer (the assertion is compiled out in release builds).
+
+Copy at most the requested length and keep the remainder in the buffer for
+the following callback, only flagging EOF once the buffer is fully drained.
+
+A regression test would require an HTTP/2 peer that adversarially shrinks
+the window mid-upload, which the in-tree server cannot do; existing upload
+tests confirm the common path is unchanged.
+
+Fixes #551 (CVE-2026-85534)
+---
+ libsoup/http2/soup-client-message-io-http2.c | 27 +++++++++++++-------
+ 1 file changed, 18 insertions(+), 9 deletions(-)
+
+diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
+index 438774ca..63901781 100644
+--- a/libsoup/http2/soup-client-message-io-http2.c
++++ b/libsoup/http2/soup-client-message-io-http2.c
+@@ -1344,7 +1344,7 @@ on_data_source_read_callback (nghttp2_session     *session,
+         } else {
+                 GInputStream *in_stream = G_INPUT_STREAM (source->ptr);
+ 
+-                /* To support non-pollable input streams we always deffer reads
++                /* To support non-pollable input streams we always defer reads
+                 * and read async into a local buffer. The next time around we will
+                 * send that buffer or error.
+                 */
+@@ -1353,17 +1353,26 @@ on_data_source_read_callback (nghttp2_session     *session,
+ 
+                 guint buffer_len = data->data_source_buffer->len;
+                 if (buffer_len) {
+-                        if (data->data_source_eof) {
+-                                h2_debug (data->io, data, "[SEND_BODY] Sending %zu, EOF", buffer_len);
++                        /* nghttp2 may accept fewer bytes than we buffered, for
++                         * example after the peer shrinks the stream window with
++                         * a SETTINGS frame.
++                         */
++                        gsize to_send = MIN (buffer_len, length);
++                        gboolean partial = to_send < buffer_len;
++
++                        if (data->data_source_eof && !partial) {
++                                h2_debug (data->io, data, "[SEND_BODY] Sending %zu, EOF", to_send);
+                                 *data_flags |= NGHTTP2_DATA_FLAG_EOF;
+                         } else
+-                                h2_debug (data->io, data, "[SEND_BODY] Sending %zu", buffer_len);
+-                        g_assert (buffer_len <= length); /* QUESTION: Maybe not reliable */
+-                        memcpy (buf, data->data_source_buffer->data, buffer_len);
+-                        log_request_data (data, buf, buffer_len);
+-                        g_byte_array_set_size (data->data_source_buffer, 0);
++                                h2_debug (data->io, data, "[SEND_BODY] Sending %zu", to_send);
++                        memcpy (buf, data->data_source_buffer->data, to_send);
++                        log_request_data (data, buf, to_send);
++                        if (partial)
++                                g_byte_array_remove_range (data->data_source_buffer, 0, to_send);
++                        else
++                                g_byte_array_set_size (data->data_source_buffer, 0);
+                         data->io->in_callback--;
+-                        return buffer_len;
++                        return to_send;
+                 } else if (data->data_source_eof) {
+                         h2_debug (data->io, data, "[SEND_BODY] EOF");
+                         *data_flags |= NGHTTP2_DATA_FLAG_EOF;
+-- 
+GitLab
+

diff --git a/libsoup3.spec b/libsoup3.spec
index 9918c0d..6098aff 100644
--- a/libsoup3.spec
+++ b/libsoup3.spec
@@ -40,6 +40,17 @@ Patch:   CVE-2026-15709.patch
 Patch:   CVE-2026-15713.patch
 Patch:   CVE-2026-15712.patch
 
+Patch:   CVE-2026-102560.patch
+Patch:   CVE-2026-102558.patch
+Patch:   CVE-2026-102559.patch
+Patch:   CVE-2026-102555.patch
+Patch:   CVE-2026-102556.patch
+Patch:   CVE-2026-85197.patch
+Patch:   CVE-2026-103399.patch
+Patch:   CVE-2026-85534.patch
+Patch:   CVE-2026-3633.patch
+Patch:   CVE-2026-3099.patch
+
 BuildRequires: gcc
 BuildRequires: gettext
 BuildRequires: glib-networking >= %{glib2_version}

                 reply	other threads:[~2026-10-27  3:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179307176605.1.6724175231607135413.rpms-libsoup3-869bc38988d2@fedoraproject.org \
    --to=avovk@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox