summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2025-07-27 19:59:52 +0200
committerSteve Sakoman <steve@sakoman.com>2025-08-04 06:40:00 -0700
commit9c136548279504f2e458b59f5cdb347c464e6de5 (patch)
tree75cfcf21fb56de4f14540326bb85b6d9d8c45838
parentfc448b1b26b22ce7486c407456ac5bf22c2e738b (diff)
downloadpoky-9c136548279504f2e458b59f5cdb347c464e6de5.tar.gz
gnutls: patch CVE-2025-32989
Pick relevant commit from 3.8.10 release MR [1]. Binary test file was added as separate file as binary diffs are not supported. [1] https://gitlab.com/gnutls/gnutls/-/merge_requests/1979 (From OE-Core rev: fbe5f828c63071962d571a8787298aa5fd78ebe8) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-support/gnutls/gnutls/04939b75417cc95b7372c6f208c4bda4579bdc34bin0 -> 1782 bytes
-rw-r--r--meta/recipes-support/gnutls/gnutls/CVE-2025-32989.patch50
-rw-r--r--meta/recipes-support/gnutls/gnutls_3.7.4.bb6
3 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-support/gnutls/gnutls/04939b75417cc95b7372c6f208c4bda4579bdc34 b/meta/recipes-support/gnutls/gnutls/04939b75417cc95b7372c6f208c4bda4579bdc34
new file mode 100644
index 0000000000..ffcfe23e99
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/04939b75417cc95b7372c6f208c4bda4579bdc34
Binary files differ
diff --git a/meta/recipes-support/gnutls/gnutls/CVE-2025-32989.patch b/meta/recipes-support/gnutls/gnutls/CVE-2025-32989.patch
new file mode 100644
index 0000000000..c21fc6e969
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/CVE-2025-32989.patch
@@ -0,0 +1,50 @@
1From 8e5ca951257202089246fa37e93a99d210ee5ca2 Mon Sep 17 00:00:00 2001
2From: Andrew Hamilton <adhamilt@gmail.com>
3Date: Mon, 7 Jul 2025 10:23:59 +0900
4Subject: [PATCH] x509: fix read buffer overrun in SCT timestamps
5
6Prevent reading beyond heap buffer in call to _gnutls_parse_ct_sct
7when processing x509 Signed Certificate Timestamps with certain
8malformed data. Spotted by oss-fuzz at:
9https://issues.oss-fuzz.com/issues/42530513
10
11Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
12Signed-off-by: Daiki Ueno <ueno@gnu.org>
13
14CVE: CVE-2025-32989
15Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/8e5ca951257202089246fa37e93a99d210ee5ca2]
16Signed-off-by: Peter Marko <peter.marko@siemens.com>
17---
18 NEWS | 5 +++++
19 lib/x509/x509_ext.c | 2 +-
20 2 files changed, 6 insertions(+), 1 deletion(-)
21
22diff --git a/NEWS b/NEWS
23index 85efb5680..025e05148 100644
24--- a/NEWS
25+++ b/NEWS
26@@ -5,6 +5,11 @@ Copyright (C) 2000-2016 Free Software Foundation, Inc.
27 Copyright (C) 2013-2019 Nikos Mavrogiannopoulos
28 See the end for copying conditions.
29
30+** libgnutls: Fix heap read buffer overrun in parsing X.509 SCTS timestamps
31+ Spotted by oss-fuzz and reported by OpenAI Security Research Team,
32+ and fix developed by Andrew Hamilton. [GNUTLS-SA-2025-07-07-1,
33+ CVSS: medium] [CVE-2025-32989]
34+
35 * Version 3.7.4 (released 2022-03-17)
36
37 ** libgnutls: Fixed double free during verification of pkcs7 signatures.
38diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c
39index 064ca8357..05336a0c2 100644
40--- a/lib/x509/x509_ext.c
41+++ b/lib/x509/x509_ext.c
42@@ -3855,7 +3855,7 @@ int gnutls_x509_ext_ct_import_scts(const gnutls_datum_t *ext, gnutls_x509_ct_sct
43 }
44
45 length = _gnutls_read_uint16(scts_content.data);
46- if (length < 4) {
47+ if (length < 4 || length > scts_content.size) {
48 gnutls_free(scts_content.data);
49 return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE;
50 }
diff --git a/meta/recipes-support/gnutls/gnutls_3.7.4.bb b/meta/recipes-support/gnutls/gnutls_3.7.4.bb
index 5cd85c5996..48ddb269de 100644
--- a/meta/recipes-support/gnutls/gnutls_3.7.4.bb
+++ b/meta/recipes-support/gnutls/gnutls_3.7.4.bb
@@ -29,6 +29,8 @@ SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar
29 file://CVE-2024-28834.patch \ 29 file://CVE-2024-28834.patch \
30 file://CVE-2024-28835.patch \ 30 file://CVE-2024-28835.patch \
31 file://CVE-2024-12243.patch \ 31 file://CVE-2024-12243.patch \
32 file://CVE-2025-32989.patch \
33 file://04939b75417cc95b7372c6f208c4bda4579bdc34 \
32 " 34 "
33 35
34SRC_URI[sha256sum] = "e6adbebcfbc95867de01060d93c789938cf89cc1d1f6ef9ef661890f6217451f" 36SRC_URI[sha256sum] = "e6adbebcfbc95867de01060d93c789938cf89cc1d1f6ef9ef661890f6217451f"
@@ -65,6 +67,10 @@ do_configure:prepend() {
65 for dir in . lib; do 67 for dir in . lib; do
66 rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4 68 rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4
67 done 69 done
70
71 # binary files cannot be delivered as diff
72 mkdir -p ${S}/fuzz/gnutls_x509_parser_fuzzer.repro/
73 cp ${WORKDIR}/04939b75417cc95b7372c6f208c4bda4579bdc34 ${S}/fuzz/gnutls_x509_parser_fuzzer.repro/
68} 74}
69 75
70PACKAGES =+ "${PN}-openssl ${PN}-xx" 76PACKAGES =+ "${PN}-openssl ${PN}-xx"