Skip to content

Commit 9021815

Browse files
Merge PR "[AUTO-CHERRYPICK] [AutoPR- Security] Patch gnupg2 for CVE-2026-24882 [HIGH] - branch 3.0-dev" #15713
Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
1 parent 82d82f0 commit 9021815

File tree

6 files changed

+79
-11
lines changed

6 files changed

+79
-11
lines changed

SPECS/gnupg2/CVE-2026-24882.patch

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
From b23aa406f96b773fc2c8cc2cf63451f59a435350 Mon Sep 17 00:00:00 2001
2+
From: Werner Koch <wk@gnupg.org>
3+
Date: Mon, 26 Jan 2026 11:13:44 +0100
4+
Subject: [PATCH] tpm: Fix possible buffer overflow in PKDECRYPT
5+
6+
* tpm2d/tpm2.c (tpm2_ecc_decrypt): Bail out on too long CIPHERTEXT.
7+
(tpm2_rsa_decrypt): Ditto.
8+
--
9+
10+
GnuPG-bug-id: 8045
11+
Co-authored-by: NIIBE Yutaka <gniibe@fsij.org>
12+
Reported-by: OpenAI Security Research
13+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
14+
Upstream-reference: https://github.com/gpg/gnupg/commit/93fa34d9a346.patch
15+
---
16+
tpm2d/tpm2.c | 22 +++++++++++++++++++++-
17+
1 file changed, 21 insertions(+), 1 deletion(-)
18+
19+
diff --git a/tpm2d/tpm2.c b/tpm2d/tpm2.c
20+
index 3e908dd..cd0347c 100644
21+
--- a/tpm2d/tpm2.c
22+
+++ b/tpm2d/tpm2.c
23+
@@ -917,10 +917,20 @@ tpm2_ecc_decrypt (ctrl_t ctrl, TSS_CONTEXT *tssc, TPM_HANDLE key,
24+
size_t len;
25+
int ret;
26+
27+
+#if defined(TPM2_MAX_ECC_KEY_BYTES) /* Intel stack */
28+
+ if (ciphertext_len > 2*TPM2_MAX_ECC_KEY_BYTES + 1)
29+
+ return GPG_ERR_TOO_LARGE;
30+
+#elif defined(MAX_ECC_KEY_BYTES) /* IBM stack */
31+
+ if (ciphertext_len > 2*MAX_ECC_KEY_BYTES + 1)
32+
+ return GPG_ERR_TOO_LARGE;
33+
+#else
34+
+# error TMP2 header are not correctly installed
35+
+#endif
36+
+
37+
/* This isn't really a decryption per se. The ciphertext actually
38+
* contains an EC Point which we must multiply by the private key number.
39+
*
40+
- * The reason is to generate a diffe helman agreement on a shared
41+
+ * The reason is to generate a diffie-hellman agreement on a shared
42+
* point. This shared point is then used to generate the per
43+
* session encryption key.
44+
*/
45+
@@ -976,6 +986,16 @@ tpm2_rsa_decrypt (ctrl_t ctrl, TSS_CONTEXT *tssc, TPM_HANDLE key,
46+
TPM_HANDLE ah;
47+
char *auth;
48+
49+
+#if defined(TPM2_MAX_RSA_KEY_BYTES) /* Intel stack */
50+
+ if (ciphertext_len > TPM2_MAX_RSA_KEY_BYTES)
51+
+ return GPG_ERR_TOO_LARGE;
52+
+#elif defined(MAX_RSA_KEY_BYTES) /* IBM stack */
53+
+ if (ciphertext_len > MAX_RSA_KEY_BYTES)
54+
+ return GPG_ERR_TOO_LARGE;
55+
+#else
56+
+# error TMP2 header are not correctly installed
57+
+#endif
58+
+
59+
inScheme.scheme = TPM_ALG_RSAES;
60+
/*
61+
* apparent gcrypt error: occasionally rsa ciphertext will
62+
--
63+
2.45.4
64+

SPECS/gnupg2/gnupg2.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
Summary: OpenPGP standard implementation used for encrypted communication and data storage.
22
Name: gnupg2
33
Version: 2.4.9
4-
Release: 1%{?dist}
4+
Release: 2%{?dist}
55
License: BSD and CC0 and GPLv2+ and LGPLv2+
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
88
Group: Applications/Cryptography.
99
URL: https://gnupg.org/index.html
1010
Source0: https://gnupg.org/ftp/gcrypt/gnupg/gnupg-%{version}.tar.bz2
11+
Patch0: CVE-2026-24882.patch
1112
BuildRequires: zlib-devel
1213
BuildRequires: bzip2-devel
1314
BuildRequires: readline-devel
@@ -104,6 +105,9 @@ ln -s $(pwd)/bin/gpg $(pwd)/bin/gpg2
104105
%defattr(-,root,root)
105106

106107
%changelog
108+
* Tue Feb 03 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.4.9-2
109+
- Patch for CVE-2026-24882
110+
107111
* Mon Jan 05 2026 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 2.4.9-1
108112
- Auto-upgrade to 2.4.9 - for CVE-2025-68973
109113

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ libksba-devel-1.6.4-1.azl3.aarch64.rpm
228228
libxslt-1.1.43-3.azl3.aarch64.rpm
229229
npth-1.6-4.azl3.aarch64.rpm
230230
pinentry-1.2.1-1.azl3.aarch64.rpm
231-
gnupg2-2.4.9-1.azl3.aarch64.rpm
232-
gnupg2-lang-2.4.9-1.azl3.aarch64.rpm
231+
gnupg2-2.4.9-2.azl3.aarch64.rpm
232+
gnupg2-lang-2.4.9-2.azl3.aarch64.rpm
233233
gpgme-1.23.2-2.azl3.aarch64.rpm
234234
azurelinux-repos-shared-3.0-5.azl3.noarch.rpm
235235
azurelinux-repos-3.0-5.azl3.noarch.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ libksba-devel-1.6.4-1.azl3.x86_64.rpm
228228
libxslt-1.1.43-3.azl3.x86_64.rpm
229229
npth-1.6-4.azl3.x86_64.rpm
230230
pinentry-1.2.1-1.azl3.x86_64.rpm
231-
gnupg2-2.4.9-1.azl3.x86_64.rpm
232-
gnupg2-lang-2.4.9-1.azl3.x86_64.rpm
231+
gnupg2-2.4.9-2.azl3.x86_64.rpm
232+
gnupg2-lang-2.4.9-2.azl3.x86_64.rpm
233233
gpgme-1.23.2-2.azl3.x86_64.rpm
234234
azurelinux-repos-shared-3.0-5.azl3.noarch.rpm
235235
azurelinux-repos-3.0-5.azl3.noarch.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ glibc-tools-2.38-18.azl3.aarch64.rpm
140140
gmp-6.3.0-1.azl3.aarch64.rpm
141141
gmp-debuginfo-6.3.0-1.azl3.aarch64.rpm
142142
gmp-devel-6.3.0-1.azl3.aarch64.rpm
143-
gnupg2-2.4.9-1.azl3.aarch64.rpm
144-
gnupg2-debuginfo-2.4.9-1.azl3.aarch64.rpm
145-
gnupg2-lang-2.4.9-1.azl3.aarch64.rpm
143+
gnupg2-2.4.9-2.azl3.aarch64.rpm
144+
gnupg2-debuginfo-2.4.9-2.azl3.aarch64.rpm
145+
gnupg2-lang-2.4.9-2.azl3.aarch64.rpm
146146
gperf-3.1-5.azl3.aarch64.rpm
147147
gperf-debuginfo-3.1-5.azl3.aarch64.rpm
148148
gpgme-1.23.2-2.azl3.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ glibc-tools-2.38-18.azl3.x86_64.rpm
147147
gmp-6.3.0-1.azl3.x86_64.rpm
148148
gmp-debuginfo-6.3.0-1.azl3.x86_64.rpm
149149
gmp-devel-6.3.0-1.azl3.x86_64.rpm
150-
gnupg2-2.4.9-1.azl3.x86_64.rpm
151-
gnupg2-debuginfo-2.4.9-1.azl3.x86_64.rpm
152-
gnupg2-lang-2.4.9-1.azl3.x86_64.rpm
150+
gnupg2-2.4.9-2.azl3.x86_64.rpm
151+
gnupg2-debuginfo-2.4.9-2.azl3.x86_64.rpm
152+
gnupg2-lang-2.4.9-2.azl3.x86_64.rpm
153153
gperf-3.1-5.azl3.x86_64.rpm
154154
gperf-debuginfo-3.1-5.azl3.x86_64.rpm
155155
gpgme-1.23.2-2.azl3.x86_64.rpm

0 commit comments

Comments
 (0)