mirror of
https://git.yoctoproject.org/poky
synced 2026-10-22 19:18:18 +00:00
gnutls: fix CVE-2026-42015
Backport patch to fix CVE-2026-42015. References: https://nvd.nist.gov/vuln/detail/CVE-2026-42015 Upstream fix: https://gitlab.com/gnutls/gnutls/-/commit/a3e7c50d3e1761e5ef1d4b225507cab8f2b2c3ca Tested with ptest (From OE-Core rev: a069e8d76883bd23148b228eb6bac273ef3d01b7) Signed-off-by: Jakub Szczudlo <jakub.szczudlo@nokia.com> Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Paul Barker <paul@pbarker.dev>
This commit is contained in:
1 parent
e2ca02cebe
commit
05a1b4d418
2 files changed
+44
No files matched your search
@@ -0,0 +1,43 @@
|
||||
From a3e7c50d3e1761e5ef1d4b225507cab8f2b2c3ca Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Sosedkin <asosedkin@redhat.com>
|
||||
Date: Mon, 20 Apr 2026 22:42:20 +0200
|
||||
Subject: [PATCH] x509/pkcs12_bag: fix off-by-one in bag element bounds check
|
||||
|
||||
Appending elements to a PKCS#12 bag had a bounds check that
|
||||
prevented adding the 32nd element.
|
||||
On the other hand, it is possible to import one that already has 32.
|
||||
Subsequent appending then led to writing past the 32-element array,
|
||||
smashing its length.
|
||||
|
||||
Tighten the check to reject any bag with 32 or more elements.
|
||||
|
||||
We'll treat this vulnerability as a Low due to how contrived
|
||||
the requirements are: for the code to be vulnerable,
|
||||
it needs to append to an imported untrusted unencrypted PKCS#12 structure.
|
||||
|
||||
Reported-by: Zou Dikai
|
||||
Fixes: #1840
|
||||
Fixes: CVE-2026-42015
|
||||
Fixes: GNUTLS-SA-2026-04-29-11
|
||||
CVSS: 6.1 Medium CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:H
|
||||
Severity: Low
|
||||
Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
|
||||
|
||||
CVE: CVE-2026-42015
|
||||
Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/a3e7c50d3e1761e5ef1d4b225507cab8f2b2c3ca]
|
||||
|
||||
Signed-off-by: Jakub Szczudlo <jakub.szczudlo@nokia.com>
|
||||
---
|
||||
diff --git a/lib/x509/pkcs12_bag.c b/lib/x509/pkcs12_bag.c
|
||||
index 911aeff..3822861 100644
|
||||
--- a/lib/x509/pkcs12_bag.c
|
||||
+++ b/lib/x509/pkcs12_bag.c
|
||||
@@ -375,7 +375,7 @@ int gnutls_pkcs12_bag_set_data(gnutls_pkcs12_bag_t bag,
|
||||
return GNUTLS_E_INVALID_REQUEST;
|
||||
}
|
||||
|
||||
- if (bag->bag_elements == MAX_BAG_ELEMENTS - 1) {
|
||||
+ if (bag->bag_elements >= MAX_BAG_ELEMENTS - 1) {
|
||||
gnutls_assert();
|
||||
/* bag is full */
|
||||
return GNUTLS_E_MEMORY_ERROR;
|
||||
@@ -59,6 +59,7 @@ SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar
|
||||
file://CVE-2026-42013-pre1.patch \
|
||||
file://CVE-2026-42013.patch \
|
||||
file://CVE-2026-42014.patch \
|
||||
file://CVE-2026-42015.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "2bea4e154794f3f00180fa2a5c51fe8b005ac7a31cd58bd44cdfa7f36ebc3a9b"
|
||||
|
||||
Reference in new issue
Block a user