gnupg: fix CVE-2026-57062
PATCH 1/2 gnupg: fix CVE-2026-57062
gpgsm accepts AES-GCM authentication tags shorter than 12 bytes. Backport the upstream fix, as done for wrynose. It applies to 2.4.9 unchanged.
AI-Generated: Uses Claude
Signed-off-by Prasanth R <[email protected]>
--- .../gnupg/gnupg/CVE-2026-57062.patch | 43 +++++++++++++++++++ meta/recipes-support/gnupg/gnupg_2.4.9.bb | 1 + 2 files changed, 44 insertions(+) create mode 100644 meta/recipes-support/gnupg/gnupg/CVE-2026-57062.patch
meta/recipes-support/gnupg/gnupg/CVE-2026-57062.patch new file +43 -0
@@ -0,0 +1,43 @@ +From 09d686f5ca09f1161f1e433473968d15b563687f Mon Sep 17 00:00:00 2001 +From: Werner Koch <[email protected]> +Date: Thu, 18 Jun 2026 10:51:34 +0200 +Subject: [PATCH] gpgsm: Require a minimum tag length for GCM decryption. + +* sm/decrypt.c (gpgsm_decrypt): Require a minimum authtaglen. +-- + +Reported-by: Thai Duong <[email protected]> +This is similar to OpenSSL's +CVE-id: CVE-2026-34182 + +CVE: CVE-2026-57062 +Upstream-Status: Backport [https://github.com/gpg/gnupg/commit/4c7e68cf3d335328821bdbb70db309a60d0e4fd4] + +Signed-off-by: Roland Kovacs <[email protected]> +--- + sm/decrypt.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/sm/decrypt.c b/sm/decrypt.c +index c4bc57657..09ed7f8a7 100644 +--- a/sm/decrypt.c ++++ b/sm/decrypt.c +@@ -1399,7 +1399,14 @@ gpgsm_decrypt (ctrl_t ctrl, estream_t in_fp, estream_t out_fp) + } + if (DBG_CRYPTO) + log_printhex (authtag, authtaglen, "Authtag ...:"); +- rc = gcry_cipher_checktag (dfparm.hd, authtag, authtaglen); ++ if (authtaglen < 12) ++ { ++ log_info ("authentication tag is too short (%zu octets)\n", ++ authtaglen); ++ rc = gpg_error (GPG_ERR_CHECKSUM); ++ } ++ else ++ rc = gcry_cipher_checktag (dfparm.hd, authtag, authtaglen); + xfree (authtag); + if (rc) + log_error ("data is not authentic: %s\n", gpg_strerror (rc)); +-- +2.34.1 +
meta/recipes-support/gnupg/gnupg_2.4.9.bb +1 -0
@@ -20,6 +20,7 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://0001-Woverride-init-is-not-needed-with-gcc-9.patch \ file://CVE-2026-24882-0001.patch \ file://CVE-2026-24882-0002.patch \ + file://CVE-2026-57062.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.34.1
PATCH 2/2 gnupg: fix CVE-2026-105712
gpgtar does not check the output directory given with --directory. Backport the upstream fix and its follow-up, as done for wrynose. The follow-up uses gnupg_access() since 2.4.9 lacks COMPAT_NO_DIR_CHECK.
AI-Generated: Uses Claude
Signed-off-by Prasanth R <[email protected]>
---
Tested on qemux86-64: gpgtar refuses a non-empty or symlinked --directory, an empty one still works, and --dry-run into a non-existing directory still succeeds.
.../gnupg/CVE-2026-105712-regression.patch | 40 ++++ .../gnupg/gnupg/CVE-2026-105712.patch | 194 ++++++++++++++++++ meta/recipes-support/gnupg/gnupg_2.4.9.bb | 2 + 3 files changed, 236 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 +40 -0
@@ -0,0 +1,40 @@ +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.4.9 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]> +Signed-off-by: Prasanth R <[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.4.9.bb +2 -0
@@ -21,6 +21,8 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://CVE-2026-24882-0001.patch \ file://CVE-2026-24882-0002.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.34.1