Skip to contentSkip to conversation

package/libmspack: patch CVE-2026-110602

PATCH New Thomas Perale via buildroot 1 participant 1 message Nov 23

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libmspack: patch CVE-2026-110602

This fixes the following vulnerability:

- CVE-2026-110602:
libmspack through 0.11alpha contains an uninitialized pointer free vulnerability in kwajd_open() in mspack/kwajd.c that frees unzeroed filename and extra pointers on header read errors. Attackers can supply a truncated, empty, or wrong-signature KWAJ file to crash the process or obtain an arbitrary-free memory corruption primitive.

For more information, see:
- https://www.cve.org/CVERecord?id=CVE-2026-110602
- https://github.com/kyz/libmspack/commit/4d868504114346aa767d435fbb89a8b76603493f

(alternative to commit fdcee66f200951adad776dbde5d095521e972564)

---
 ...-pointers-before-returning-any-error.patch | 42 +++++++++++++++++++
 package/libmspack/libmspack.mk                |  3 ++
 2 files changed, 45 insertions(+)
 create mode 100644 package/libmspack/0001-kwajd_read_headers-initialise-pointers-before-returning-any-error.patch
package/libmspack/0001-kwajd_read_headers-initialise-pointers-before-returning-any-error.patch new file +42 -0
new file mode 100644
index 00000000000..980bee6adfd
@@ -0,0 +1,42 @@
+From 4d868504114346aa767d435fbb89a8b76603493f Mon Sep 17 00:00:00 2001
+From: Stuart Caie <[email protected]>
+Date: Mon, 15 Jun 2026 16:33:33 +0000
+Subject: [PATCH] kwajd_read_headers(): initialise pointers before returning
+ any error
+
+CVE: CVE-2026-110602
+Upstream: https://github.com/kyz/libmspack/commit/4d868504114346aa767d435fbb89a8b76603493f
+[thomas: drop ChangeLog, tests and backport context]
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ mspack/kwajd.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/mspack/kwajd.c b/mspack/kwajd.c
+index 490778c..0d9a732 100644
+--- a/mspack/kwajd.c
++++ b/mspack/kwajd.c
+@@ -155,6 +155,11 @@ static int kwajd_read_headers(struct mspack_system *sys,
+     unsigned char buf[16];
+     int i;
+ 
++
++    /* initialise pointers */
++    hdr->filename = NULL;
++    hdr->extra    = NULL;
++
+     /* read in the header */
+     if (sys->read(fh, &buf[0], kwajh_SIZEOF) != kwajh_SIZEOF) {
+         return MSPACK_ERR_READ;
+@@ -172,8 +177,6 @@ static int kwajd_read_headers(struct mspack_system *sys,
+     hdr->data_offset  = EndGetI16(&buf[kwajh_DataOffset]);
+     hdr->headers      = EndGetI16(&buf[kwajh_Flags]);
+     hdr->length       = 0;
+-    hdr->filename     = NULL;
+-    hdr->extra        = NULL;
+     hdr->extra_length = 0;
+ 
+     /* optional headers */
+-- 
+2.53.0
+
package/libmspack/libmspack.mk +3 -0
index f806192eec6..a8c37d60f11 100644
@@ -15,4 +15,7 @@ LIBMSPACK_CPE_ID_VERSION = $(LIBMSPACK_VERSION_MAJOR)
 LIBMSPACK_CPE_ID_UPDATE = $(LIBMSPACK_VERSION_MINOR)
 LIBMSPACK_INSTALL_STAGING = YES
 
+# 0001-kwajd_read_headers-initialise-pointers-before-returning-any-error.patch
+LIBMSPACK_IGNORE_CVES += CVE-2026-110602
+
 $(eval $(autotools-package))
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot