strongswan: patch CVE-2026-78123

Use patch[1] provided by strongSwan[2]

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-78123

[1]https://download.strongswan.org/security/CVE-2026-78123/strongswan-5.0.2-6.0.7_openssl_pkcs7_info_init.patch
[2]https://www.strongswan.org/blog/2026/09/07/strongswan-vulnerability-(cve-2026-78123).html

Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
(cherry picked from commit aa064e512a)
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
This commit is contained in:
Ankur Tyagi committed 2026-10-13 21:32:54 +13:00
1 parent a369135b46
commit 8ccc60a8be
2 files changed
+54 -1

No files matched your search

@@ -0,0 +1,51 @@
From 23707d346f1f85dba0419c43658a86a80a24f568 Mon Sep 17 00:00:00 2001
From: Tobias Brunner <tobias@strongswan.org>
Date: Mon, 1 Jun 2026 17:51:35 +0200
Subject: [PATCH] openssl: Fix undefined memory access when verifying PKCS#7
containers
If the signerInfo or recipientInfo structure doesn't contain
issuerAndSerialNumber but instead a subjectKeyIdentifier, then the called
functions will leave the passed name and serial numbers unchanged. While
openssl_x509_name2id() prevents a NULL-pointer dereference, it tries to
DER-encode the object at the passed pointer via i2d_X509_NAME().
Depending on the stack contents, this likely causes a segmentation fault.
Fixes: 3c820cdc232a ("Implement PKCS#7 decryption using openssl")
Fixes: c61723c69fb5 ("Implement OpenSSL PKCS#7 signed-data parsing and verification")
Fixes: CVE-2026-78123
CVE: CVE-2026-78123
Upstream-Status: Backport [https://github.com/strongswan/strongswan/commit/e59b4c96990635a482d6532f7905143f2541d8b5]
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
src/libstrongswan/plugins/openssl/openssl_pkcs7.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/libstrongswan/plugins/openssl/openssl_pkcs7.c b/src/libstrongswan/plugins/openssl/openssl_pkcs7.c
index d9abcf8..b15c8d7 100644
--- a/src/libstrongswan/plugins/openssl/openssl_pkcs7.c
+++ b/src/libstrongswan/plugins/openssl/openssl_pkcs7.c
@@ -222,8 +222,8 @@ static auth_cfg_t *verify_signature(CMS_SignerInfo *si,
auth_cfg_t *auth, *found = NULL;
identification_t *issuer, *serial;
chunk_t attrs = chunk_empty, sig, attr;
- X509_NAME *name;
- ASN1_INTEGER *snr;
+ X509_NAME *name = NULL;
+ ASN1_INTEGER *snr = NULL;
int i;
if (CMS_SignerInfo_get0_signer_id(si, NULL, &name, &snr) != 1)
@@ -628,8 +628,8 @@ static bool decrypt(private_openssl_pkcs7_t *this,
identification_t *serial, *issuer;
private_key_t *private;
X509_ALGOR *alg;
- X509_NAME *name;
- ASN1_INTEGER *sn;
+ X509_NAME *name = NULL;
+ ASN1_INTEGER *sn = NULL;
u_char zero = 0;
int oid;
@@ -8,7 +8,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS = "flex-native flex bison-native"
DEPENDS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', ' tpm2-tss', '', d)}"
SRC_URI = "https://download.strongswan.org/strongswan-${PV}.tar.bz2"
SRC_URI = "https://download.strongswan.org/strongswan-${PV}.tar.bz2 \
file://CVE-2026-78123.patch \
"
SRC_URI[sha256sum] = "e518e34e159514f4c6ba80d1f926cb151e0dd4e3a1d94213171234b8b9ae6f55"