diff options
-rw-r--r-- | meta/recipes-support/gnutls/gnutls/04939b75417cc95b7372c6f208c4bda4579bdc34 | bin | 0 -> 1782 bytes | |||
-rw-r--r-- | meta/recipes-support/gnutls/gnutls/CVE-2025-32989.patch | 50 | ||||
-rw-r--r-- | meta/recipes-support/gnutls/gnutls_3.8.4.bb | 6 |
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..e78c2d1da4 --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/CVE-2025-32989.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 8e5ca951257202089246fa37e93a99d210ee5ca2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrew Hamilton <adhamilt@gmail.com> | ||
3 | Date: Mon, 7 Jul 2025 10:23:59 +0900 | ||
4 | Subject: [PATCH] x509: fix read buffer overrun in SCT timestamps | ||
5 | |||
6 | Prevent reading beyond heap buffer in call to _gnutls_parse_ct_sct | ||
7 | when processing x509 Signed Certificate Timestamps with certain | ||
8 | malformed data. Spotted by oss-fuzz at: | ||
9 | https://issues.oss-fuzz.com/issues/42530513 | ||
10 | |||
11 | Signed-off-by: Andrew Hamilton <adhamilt@gmail.com> | ||
12 | Signed-off-by: Daiki Ueno <ueno@gnu.org> | ||
13 | |||
14 | CVE: CVE-2025-32989 | ||
15 | Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/8e5ca951257202089246fa37e93a99d210ee5ca2] | ||
16 | Signed-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 | |||
22 | diff --git a/NEWS b/NEWS | ||
23 | index 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.8.4 (released 2024-03-18) | ||
36 | |||
37 | ** libgnutls: RSA-OAEP encryption scheme is now supported | ||
38 | diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c | ||
39 | index 064ca8357..05336a0c2 100644 | ||
40 | --- a/lib/x509/x509_ext.c | ||
41 | +++ b/lib/x509/x509_ext.c | ||
42 | @@ -3757,7 +3757,7 @@ int gnutls_x509_ext_ct_import_scts(const gnutls_datum_t *ext, | ||
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.8.4.bb b/meta/recipes-support/gnutls/gnutls_3.8.4.bb index e77960724b..367872d47e 100644 --- a/meta/recipes-support/gnutls/gnutls_3.8.4.bb +++ b/meta/recipes-support/gnutls/gnutls_3.8.4.bb | |||
@@ -24,6 +24,8 @@ SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar | |||
24 | file://run-ptest \ | 24 | file://run-ptest \ |
25 | file://Add-ptest-support.patch \ | 25 | file://Add-ptest-support.patch \ |
26 | file://CVE-2024-12243.patch \ | 26 | file://CVE-2024-12243.patch \ |
27 | file://CVE-2025-32989.patch \ | ||
28 | file://04939b75417cc95b7372c6f208c4bda4579bdc34 \ | ||
27 | " | 29 | " |
28 | 30 | ||
29 | SRC_URI[sha256sum] = "2bea4e154794f3f00180fa2a5c51fe8b005ac7a31cd58bd44cdfa7f36ebc3a9b" | 31 | SRC_URI[sha256sum] = "2bea4e154794f3f00180fa2a5c51fe8b005ac7a31cd58bd44cdfa7f36ebc3a9b" |
@@ -62,6 +64,10 @@ do_configure:prepend() { | |||
62 | for dir in . lib; do | 64 | for dir in . lib; do |
63 | rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4 | 65 | rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4 |
64 | done | 66 | done |
67 | |||
68 | # binary files cannot be delivered as diff | ||
69 | mkdir -p ${S}/fuzz/gnutls_x509_parser_fuzzer.repro/ | ||
70 | cp ${WORKDIR}/04939b75417cc95b7372c6f208c4bda4579bdc34 ${S}/fuzz/gnutls_x509_parser_fuzzer.repro/ | ||
65 | } | 71 | } |
66 | 72 | ||
67 | do_compile_ptest() { | 73 | do_compile_ptest() { |