diff mbox series

[meta-oe,scarthgap] libwebsockets: patch CVE-2026-78161

Message ID 20261008185424.999795-1-peter.marko@siemens.com
State New
Headers show
Series [meta-oe,scarthgap] libwebsockets: patch CVE-2026-78161 | expand

Commit Message

Peter Marko Oct. 8, 2026, 6:54 p.m. UTC
From: Peter Marko <peter.marko@siemens.com>

Pick patch per [1].

[1] https://security-tracker.debian.org/tracker/CVE-2026-78161

Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 .../libwebsockets/CVE-2026-78161.patch        | 45 +++++++++++++++++++
 .../libwebsockets/libwebsockets_4.3.10.bb     |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta-oe/recipes-connectivity/libwebsockets/libwebsockets/CVE-2026-78161.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-connectivity/libwebsockets/libwebsockets/CVE-2026-78161.patch b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets/CVE-2026-78161.patch
new file mode 100644
index 0000000000..ab978811d8
--- /dev/null
+++ b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets/CVE-2026-78161.patch
@@ -0,0 +1,45 @@ 
+From 1d44554a1bb262db63ff4e240152a9deecd99054 Mon Sep 17 00:00:00 2001
+From: Biniam F Demissie <biniamfd@gmail.com>
+Date: Mon, 6 Jul 2026 04:33:45 +0100
+Subject: [PATCH] cbor: overflow
+
+CVE: CVE-2026-78161
+Upstream-Status: Backport [https://github.com/warmcat/libwebsockets/commit/1d44554a1bb262db63ff4e240152a9deecd99054]
+Signed-off-by: Peter Marko <peter.marko@siemens.com>
+---
+ lib/misc/lecp.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/lib/misc/lecp.c b/lib/misc/lecp.c
+index 44a7ac667..13e6ba476 100644
+--- a/lib/misc/lecp.c
++++ b/lib/misc/lecp.c
+@@ -325,11 +325,11 @@ report_raw_cbor(struct lecp_ctx *ctx)
+ 	if (!ctx->cbor_pos)
+ 		return 0;
+ 
++	ctx->cbor_pos = 0;                /* reset BEFORE callback */
++
+ 	if (pst->cb(ctx, LECPCB_LITERAL_CBOR))
+ 		return 1;
+ 
+-	ctx->cbor_pos = 0;
+-
+ 	return 0;
+ }
+ 
+@@ -388,10 +388,11 @@ lecp_parse(struct lecp_ctx *ctx, const uint8_t *cbor, size_t len)
+ 		 */
+ 
+ 		if (ctx->literal_cbor_report) {
++			if (ctx->cbor_pos >= sizeof(ctx->cbor)) {
++				if (report_raw_cbor(ctx))
++					goto reject_callback;
++			}
+ 			ctx->cbor[ctx->cbor_pos++] = c;
+-			if (ctx->cbor_pos == sizeof(ctx->cbor) &&
+-			    report_raw_cbor(ctx))
+-				goto reject_callback;
+ 		}
+ 
+ 		switch (st->s) {
diff --git a/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.10.bb b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.10.bb
index 57db93bc1d..1aa1d1a369 100644
--- a/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.10.bb
+++ b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.10.bb
@@ -11,6 +11,7 @@  SRCREV = "2288cf200bc1c28680765bd4f07e437356106c2d"
 SRC_URI = "git://github.com/warmcat/libwebsockets.git;protocol=https;branch=v4.3-stable \
           file://CVE-2026-10650.patch \
           file://CVE-2026-19773.patch \
+          file://CVE-2026-78161.patch \
           "
 
 UPSTREAM_CHECK_URI = "https://github.com/warmcat/${BPN}/releases"