Skip to contentSkip to conversation

gnupg: Fix CVE-2026-105712

PATCH New Deepak Rathore -X (deeratho - E INFOCHIPS PRIVATE LIMITED at Cisco) 1 participant 1 message Nov 5

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gnupg: Fix CVE-2026-105712

From: Deepak Rathore <[email protected]>

This patch backports the upstream gpgtar security fix and its follow-up to GnuPG 2.5.17. The security fix, directory handling follow-up, and public CVE advisory are referenced in [1], [2], and [3]. The follow-up includes a regression check for dry-run extraction with a non-existing -C directory.

[1] https://github.com/gpg/gnupg/commit/7a2692fe5e580ae3bbb2a47abc4baaf1af65aa88
[2] https://github.com/gpg/gnupg/commit/1bdd1f5bb4d192d9700dd6ab2540b0a940c23dd5
[3] https://nvd.nist.gov/vuln/detail/CVE-2026-105712

---
 .../gnupg/CVE-2026-105712-regression.patch    |  39 ++++
 .../gnupg/gnupg/CVE-2026-105712.patch         | 194 ++++++++++++++++++
 meta/recipes-support/gnupg/gnupg_2.5.17.bb    |   2 +
 3 files changed, 235 insertions(+)
 create mode 100644 meta/recipes-support/gnupg/gnupg/CVE-2026-105712-regression.patch
 create mode 100644 meta/recipes-support/gnupg/gnupg/CVE-2026-105712.patch
meta/recipes-support/gnupg/gnupg/CVE-2026-105712-regression.patch new file +39 -0
new file mode 100644
index 0000000000..6097da38c3
@@ -0,0 +1,39 @@
+From 1bdd1f5bb4d192d9700dd6ab2540b0a940c23dd5 Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <[email protected]>
+Date: Tue, 14 Apr 2026 04:32:00 +0000
+Subject: [PATCH] tools:gpgtar: Fix for a case of non existing dir with -C.
+
+* tools/gpgtar-extract.c (gpgtar_extract): Call the
+check_output_directory function only when DIRNAME exists.
+
+--
+GnuPG-bug-id: 8159
+
+CVE: CVE-2026-105712
+Upstream-Status: Backport [https://github.com/gpg/gnupg/commit/1bdd1f5bb4d192d9700dd6ab2540b0a940c23dd5]
+
+Backport Changes:
+- Used gnupg_access() for the existence check because 2.5.17 does not
+  have the upstream COMPAT_NO_DIR_CHECK compatibility flag.
+
+Signed-off-by: NIIBE Yutaka <[email protected]>
+(cherry picked from commit 1bdd1f5bb4d192d9700dd6ab2540b0a940c23dd5)
+Signed-off-by: Deepak Rathore <[email protected]>
+---
+ tools/gpgtar-extract.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tools/gpgtar-extract.c b/tools/gpgtar-extract.c
+index 5ca80cb..a5a925c 100644
+--- a/tools/gpgtar-extract.c
++++ b/tools/gpgtar-extract.c
+@@ -504,7 +504,8 @@ gpgtar_extract (const char *filename, int decrypt)
+           goto leave;
+         }
+ 
+-      if (!check_output_directory (dirname))
++      if (gnupg_access (dirname, F_OK) == 0
++          && !check_output_directory (dirname))
+         {
+           err = gpg_error (GPG_ERR_INV_ARG);
+           goto leave;
meta/recipes-support/gnupg/gnupg/CVE-2026-105712.patch new file +194 -0

194 lines not on this page · raw message

meta/recipes-support/gnupg/gnupg_2.5.17.bb +2 -0
index 6b2af1c96c..04666ee8d7 100644
@@ -20,6 +20,8 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
            file://0002-use-pkgconfig-instead-of-npth-config.patch \
            file://0001-Woverride-init-is-not-needed-with-gcc-9.patch \
            file://CVE-2026-57062.patch \
+           file://CVE-2026-105712.patch \
+           file://CVE-2026-105712-regression.patch \
            "
 SRC_URI:append:class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch \
                                 file://relocate.patch"
Signature · 1 line
2.35.6