Control: tags -1 + patch

Hi,

I put together a trixie fix for CVE-2026-50161 from upstream commit
718b92615c7963670d26c1a2b246968b58d782e8. It guards the masked
WebSocket frame length before adding the four-byte mask. The tested
trixie debdiff is attached.

Both builds and Lintian checks passed; test_websock passed in each.
The suite passed 134 cases per build. The unsupported tracing case
failed identically because Debian disables tracing.

Hopefully it helps for the next trixie point release! Happy to
adjust anything

Dickson

Prepared with AI assistance (OpenAI Codex) and reviewed by me
before sending.
diff -Nru '--exclude=.pc' inspection/debian/changelog packaged/debian/changelog
--- inspection/debian/changelog	2024-11-07 20:06:08.000000000 +0000
+++ packaged/debian/changelog	2026-11-26 10:43:33.674722569 +0000
@@ -1,3 +1,9 @@
+libre (2.0.1-3+deb13u1) trixie; urgency=medium
+
+  * Backport upstream fix for CVE-2026-50161 (WebSocket length overflow).
+
+ -- Dickson Wu <[email protected]>  Wed, 25 Nov 2026 23:06:00 +0000
+
 libre (2.0.1-3) unstable; urgency=medium
 
   * Team upload
diff -Nru '--exclude=.pc' inspection/debian/patches/CVE-2026-50161.patch packaged/debian/patches/CVE-2026-50161.patch
--- inspection/debian/patches/CVE-2026-50161.patch	1970-01-01 00:00:00.000000000 +0000
+++ packaged/debian/patches/CVE-2026-50161.patch	2026-11-26 10:43:33.671722534 +0000
@@ -0,0 +1,20 @@
+Description: Reject masked WebSocket frame lengths that overflow size_t
+Origin: upstream, https://github.com/baresip/re/commit/718b92615c7963670d26c1a2b246968b58d782e8
+Bug-Debian: https://bugs.debian.org/1146714
+Applied-Upstream: 718b92615c7963670d26c1a2b246968b58d782e8
+Last-Update: 2026-11-25
+
+diff --git a/src/websock/websock.c b/src/websock/websock.c
+index 34d2f0343..69f60a4a5 100644
+--- a/src/websock/websock.c
++++ b/src/websock/websock.c
+@@ -204,7 +204,8 @@ static int websock_decode(struct websock_hdr *hdr, struct mbuf *mb)
+ 
+ 	if (hdr->mask) {
+ 
+-		if (mbuf_get_left(mb) < (4 + hdr->len))
++		if (hdr->len > SIZE_MAX - 4 ||
++		    mbuf_get_left(mb) < (4 + hdr->len))
+ 			return ENODATA;
+ 
+ 		hdr->mkey[0] = mbuf_read_u8(mb);
diff -Nru '--exclude=.pc' inspection/debian/patches/series packaged/debian/patches/series
--- inspection/debian/patches/series	2024-11-07 20:02:16.000000000 +0000
+++ packaged/debian/patches/series	2026-11-26 10:43:33.672722546 +0000
@@ -1,3 +1,4 @@
 1001_system_header_locations.patch
 1002_remove_SYSROOT.patch
 1003_remove_MACHINE.patch
+CVE-2026-50161.patch
diff -Nru '--exclude=.pc' inspection/src/websock/websock.c packaged/src/websock/websock.c
--- inspection/src/websock/websock.c	2021-04-21 22:05:17.000000000 +0000
+++ packaged/src/websock/websock.c	2026-11-26 10:43:33.670722523 +0000
@@ -204,7 +204,8 @@
 
 	if (hdr->mask) {
 
-		if (mbuf_get_left(mb) < (4 + hdr->len))
+		if (hdr->len > SIZE_MAX - 4 ||
+		    mbuf_get_left(mb) < (4 + hdr->len))
 			return ENODATA;
 
 		hdr->mkey[0] = mbuf_read_u8(mb);

Reply via email to