Skip to contentSkip to conversation

libtasn1: Stack-based_buffer_overflow_fix

PATCH In review [email protected] 2 participants 4 messages Jan 12 – Jan 13 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtasn1: Stack-based_buffer_overflow_fix

From: Amaury Couderc <[email protected]>

---
 .../gnutls/libtasn1/CVE-2025-13151.patch      | 36 +++++++++++++++++++
 .../recipes-support/gnutls/libtasn1_4.20.0.bb |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-support/gnutls/libtasn1/CVE-2025-13151.patch
meta/recipes-support/gnutls/libtasn1/CVE-2025-13151.patch new file +36 -0
new file mode 100644
index 0000000000..6ece045643
@@ -0,0 +1,36 @@
+From d6dbdff9a87e277c5c42adca935b32b5f99b464f Mon Sep 17 00:00:00 2001
+From: Vijay Sarvepalli <[email protected]>
+Date: Mon, 12 Jan 2026 10:49:46 +0100
+Subject: [PATCH] CVE-2025-13151
+
+Stack-based buffer overflow in libtasn1 version: v4.20.0. 
+The function fails to validate the size of input data 
+resulting in a buffer overflow in asn1_expend_octet_string.
+
+Fixes CVE-2025-13151
+CVE-2025-13151
+
+Upstream-Status: Backport
+[https://gitlab.com/gnutls/libtasn1/-/merge_requests/121/diffs?commit_id=305377bad9ab87f461a2adcbb056c424cd56d03a]
+
+Signed-off-by: Amaury Couderc <[email protected]>
+---
+ lib/decoding.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/decoding.c b/lib/decoding.c
+index 1e0fcb3..abcb49f 100644
+--- a/lib/decoding.c
++++ b/lib/decoding.c
+@@ -1983,7 +1983,7 @@ int
+ asn1_expand_octet_string (asn1_node_const definitions, asn1_node *element,
+ 			  const char *octetName, const char *objectName)
+ {
+-  char name[2 * ASN1_MAX_NAME_SIZE + 1], value[ASN1_MAX_NAME_SIZE];
++  char name[2 * ASN1_MAX_NAME_SIZE + 2], value[ASN1_MAX_NAME_SIZE];
+   int retCode = ASN1_SUCCESS, result;
+   int len, len2, len3;
+   asn1_node_const p2;
+-- 
+2.43.0
+
meta/recipes-support/gnutls/libtasn1_4.20.0.bb +1 -0
index 8127ba5b1d..bfc011a2f1 100644
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \
 
 SRC_URI = "${GNU_MIRROR}/libtasn1/libtasn1-${PV}.tar.gz \
            file://dont-depend-on-help2man.patch \
+           file://CVE-2025-13151.patch \
            "
 
 DEPENDS = "bison-native"
Signature · 1 line
2.44.1
#1 lore raw

Hi Amaury,

Is there any reason why this patch is only targeting scarthgap? Are master, whinlatter and kirkstone (the currently supported releases) not impacted? If so, why?

Cheers,
Quentin

A message that is not in the archive (sent off-list or not yet received): AMBP189MB3196A11C869915431C0CE336F88EA@AMBP189MB3196.EURP189.PROD.OUTLOOK.COM

#3 lore raw

Hi Amaury,

Please use "Reply All" when answering to mails on the mailing list so that the conversation stays public and is archived, adding the ML back in Cc myself.

Quoted 4 lines · Amaury Couderc

Hi Quentin,

I tested the patch on scarthgap, but I think it should be applicable on all the releases.

https://docs.yoctoproject.org/contributor-guide/submit-changes.html#submitting-changes-to-stable-release-branches

This is then clearly matching the description in point 2.2. It must be tested and sent against master first and then it can be backported to older-but-still-supported releases afterwards.

Thanks,
Quentin

#4 lore raw

Hi Quentin,

My bad, I will do that for future emails.

Kind Regards,

Amaury
________________________________
From: Quentin Schulz <[email protected]>
Sent: Tuesday, January 13, 2026 10:33 AM
To: Amaury Couderc <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [review][OE-core][scarthgap][PATCH] libtasn1: Stack-based_buffer_overflow_fix

Hi Amaury,

Please use "Reply All" when answering to mails on the mailing list so that the conversation stays public and is archived, adding the ML back in Cc myself.

Quoted 4 lines · Amaury Couderc

Hi Quentin,

I tested the patch on scarthgap, but I think it should be applicable on all the releases.

https://docs.yoctoproject.org/contributor-guide/submit-changes.html#submitting-changes-to-stable-release-branches

This is then clearly matching the description in point 2.2. It must be tested and sent against master first and then it can be backported to older-but-still-supported releases afterwards.

Thanks,
Quentin