From 0693ebd20ec3349c1e208b10824b31feb93c124e Mon Sep 17 00:00:00 2001 From: Azure Linux Security Servicing Account Date: Mon, 9 Feb 2026 11:16:42 +0000 Subject: [PATCH 1/3] Patch hvloader for CVE-2026-22795, CVE-2025-69421, CVE-2025-69420, CVE-2025-69419 --- SPECS/hvloader/CVE-2025-69419.patch | 56 +++++++++++++++++++++ SPECS/hvloader/CVE-2025-69420.patch | 50 +++++++++++++++++++ SPECS/hvloader/CVE-2025-69421.patch | 37 ++++++++++++++ SPECS/hvloader/CVE-2026-22795.patch | 77 +++++++++++++++++++++++++++++ SPECS/hvloader/hvloader.spec | 9 +++- 5 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 SPECS/hvloader/CVE-2025-69419.patch create mode 100644 SPECS/hvloader/CVE-2025-69420.patch create mode 100644 SPECS/hvloader/CVE-2025-69421.patch create mode 100644 SPECS/hvloader/CVE-2026-22795.patch diff --git a/SPECS/hvloader/CVE-2025-69419.patch b/SPECS/hvloader/CVE-2025-69419.patch new file mode 100644 index 00000000000..28d3b23a8f5 --- /dev/null +++ b/SPECS/hvloader/CVE-2025-69419.patch @@ -0,0 +1,56 @@ +From 7c55e722e1ee27020d9e52df9a194c2e3a5ab4de Mon Sep 17 00:00:00 2001 +From: AllSpark +Date: Mon, 9 Feb 2026 11:04:29 +0000 +Subject: [PATCH] Check return code of UTF8_putc: handle failure in ASN.1 + string conversion and PKCS12 UTF-8 emission per upstream patch. Preserves + comments from patch. + +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/36ecb4960872a4ce04bf6f1e1f4e78d75ec0c0c7.patch +--- + .../Library/OpensslLib/openssl/crypto/asn1/a_strex.c | 6 ++++-- + .../OpensslLib/openssl/crypto/pkcs12/p12_utl.c | 11 +++++++++-- + 2 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/a_strex.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/a_strex.c +index 284dde27..843b0f94 100644 +--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/a_strex.c ++++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/a_strex.c +@@ -203,8 +203,10 @@ static int do_buf(unsigned char *buf, int buflen, + orflags = CHARTYPE_LAST_ESC_2253; + if (type & BUF_TYPE_CONVUTF8) { + unsigned char utfbuf[6]; +- int utflen; +- utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c); ++ int utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c); ++ ++ if (utflen < 0) ++ return -1; /* error happened with UTF8 */ + for (i = 0; i < utflen; i++) { + /* + * We don't need to worry about setting orflags correctly +diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_utl.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_utl.c +index 43b9e3a5..1c6b59d5 100644 +--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_utl.c ++++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_utl.c +@@ -207,8 +207,15 @@ char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen) + /* re-run the loop emitting UTF-8 string */ + for (asclen = 0, i = 0; i < unilen; ) { + j = bmp_to_utf8(asctmp+asclen, uni+i, unilen-i); +- if (j == 4) i += 4; +- else i += 2; ++ /* when UTF8_putc fails */ ++ if (j < 0) { ++ OPENSSL_free(asctmp); ++ return NULL; ++ } ++ if (j == 4) ++ i += 4; ++ else ++ i += 2; + asclen += j; + } + +-- +2.45.4 + diff --git a/SPECS/hvloader/CVE-2025-69420.patch b/SPECS/hvloader/CVE-2025-69420.patch new file mode 100644 index 00000000000..abb47fdbeea --- /dev/null +++ b/SPECS/hvloader/CVE-2025-69420.patch @@ -0,0 +1,50 @@ +From dbb834e047a19711836cb61561d9273e89f320fa Mon Sep 17 00:00:00 2001 +From: AllSpark +Date: Mon, 9 Feb 2026 11:04:59 +0000 +Subject: [PATCH] Verify ASN1 object's types before attempting to access them + as a particular type +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Issue was reported in ossl_ess_get_signing_cert but is also present in ossl_ess_get_signing_cert_v2. + +Fixes: https://github.com/openssl/srt/issues/61 +Fixes CVE-2025-69420 + +Reviewed-by: Norbert Pocs +Reviewed-by: Saša Nedvědický +Reviewed-by: Tomas Mraz +MergeDate: Mon Jan 26 19:53:36 2026 +(cherry picked from commit ea8fc4c345fbd749048809c9f7c881ea656b0b94) +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/41be0f216404f14457bbf3b9cc488dba60b49296.patch +--- + .../Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c +index 7fe3d27e..5d452d26 100644 +--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c ++++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c +@@ -262,7 +262,7 @@ static ESS_SIGNING_CERT *ess_get_signing_cert(PKCS7_SIGNER_INFO *si) + ASN1_TYPE *attr; + const unsigned char *p; + attr = PKCS7_get_signed_attribute(si, NID_id_smime_aa_signingCertificate); +- if (!attr) ++ if (attr == NULL || attr->type != V_ASN1_SEQUENCE) + return NULL; + p = attr->value.sequence->data; + return d2i_ESS_SIGNING_CERT(NULL, &p, attr->value.sequence->length); +@@ -274,7 +274,7 @@ static ESS_SIGNING_CERT_V2 *ess_get_signing_cert_v2(PKCS7_SIGNER_INFO *si) + const unsigned char *p; + + attr = PKCS7_get_signed_attribute(si, NID_id_smime_aa_signingCertificateV2); +- if (attr == NULL) ++ if (attr == NULL || attr->type != V_ASN1_SEQUENCE) + return NULL; + p = attr->value.sequence->data; + return d2i_ESS_SIGNING_CERT_V2(NULL, &p, attr->value.sequence->length); +-- +2.45.4 + diff --git a/SPECS/hvloader/CVE-2025-69421.patch b/SPECS/hvloader/CVE-2025-69421.patch new file mode 100644 index 00000000000..97d3c5bad9a --- /dev/null +++ b/SPECS/hvloader/CVE-2025-69421.patch @@ -0,0 +1,37 @@ +From d69f898077165b522ae19bf1a24b10c7a5367835 Mon Sep 17 00:00:00 2001 +From: AllSpark +Date: Mon, 9 Feb 2026 11:05:00 +0000 +Subject: [PATCH] PKCS12_item_decrypt_d2i(): Check oct argument for NULL + +Backport of upstream fix to validate ASN1_OCTET_STRING argument before use. +Prevents NULL dereference when oct is NULL. + +Inspired by upstream patch for PKCS12_item_decrypt_d2i_ex(). + +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/4e254b48ad93cc092be3dd62d97015f33f73133a.patch +--- + .../Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c +index 3c860584..85835734 100644 +--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c ++++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c +@@ -88,6 +88,13 @@ void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it, + void *ret; + int outlen; + ++ ++ /* Check oct for NULL to avoid dereferencing a NULL pointer */ ++ if (oct == NULL) { ++ PKCS12err(PKCS12_F_PKCS12_ITEM_DECRYPT_D2I, ERR_R_PASSED_NULL_PARAMETER); ++ return NULL; ++ } ++ + if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length, + &out, &outlen, 0)) { + PKCS12err(PKCS12_F_PKCS12_ITEM_DECRYPT_D2I, +-- +2.45.4 + diff --git a/SPECS/hvloader/CVE-2026-22795.patch b/SPECS/hvloader/CVE-2026-22795.patch new file mode 100644 index 00000000000..66858966f29 --- /dev/null +++ b/SPECS/hvloader/CVE-2026-22795.patch @@ -0,0 +1,77 @@ +From 1cbd2e0aef0cc6f6b6300408835cd6a3078c1ac4 Mon Sep 17 00:00:00 2001 +From: Bob Beck +Date: Wed, 7 Jan 2026 11:29:48 -0700 +Subject: [PATCH] Ensure ASN1 types are checked before use. + +Some of these were fixed by LibreSSL in commit https://github.com/openbsd/src/commit/aa1f637d454961d22117b4353f98253e984b3ba8 +this fix includes the other fixes in that commit, as well as fixes for others found by a scan +for a similar unvalidated access paradigm in the tree. + +Reviewed-by: Kurt Roeckx +Reviewed-by: Shane Lontis +Reviewed-by: Tomas Mraz +(Merged from https://github.com/openssl/openssl/pull/29582) + +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/openssl/openssl/commit/572844beca95068394c916626a6d3a490f831a49.patch +--- + CryptoPkg/Library/OpensslLib/openssl/apps/s_client.c | 3 ++- + .../OpensslLib/openssl/crypto/pkcs12/p12_kiss.c | 10 ++++++++-- + .../Library/OpensslLib/openssl/crypto/pkcs7/pk7_doit.c | 2 ++ + 3 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/CryptoPkg/Library/OpensslLib/openssl/apps/s_client.c b/CryptoPkg/Library/OpensslLib/openssl/apps/s_client.c +index 00effc80..6e8cc6e9 100644 +--- a/CryptoPkg/Library/OpensslLib/openssl/apps/s_client.c ++++ b/CryptoPkg/Library/OpensslLib/openssl/apps/s_client.c +@@ -2698,8 +2698,9 @@ int s_client_main(int argc, char **argv) + goto end; + } + atyp = ASN1_generate_nconf(genstr, cnf); +- if (atyp == NULL) { ++ if (atyp == NULL || atyp->type != V_ASN1_SEQUENCE) { + NCONF_free(cnf); ++ ASN1_TYPE_free(atyp); + BIO_printf(bio_err, "ASN1_generate_nconf failed\n"); + goto end; + } +diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_kiss.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_kiss.c +index 7ab98385..d90404dd 100644 +--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_kiss.c ++++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_kiss.c +@@ -183,11 +183,17 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, + ASN1_BMPSTRING *fname = NULL; + ASN1_OCTET_STRING *lkid = NULL; + +- if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName))) ++ if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName))) { ++ if (attrib->type != V_ASN1_BMPSTRING) ++ return 0; + fname = attrib->value.bmpstring; ++ } + +- if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID))) ++ if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID))) { ++ if (attrib->type != V_ASN1_OCTET_STRING) ++ return 0; + lkid = attrib->value.octet_string; ++ } + + switch (PKCS12_SAFEBAG_get_nid(bag)) { + case NID_keyBag: +diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs7/pk7_doit.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs7/pk7_doit.c +index f63fbc50..4e0eb1e8 100644 +--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs7/pk7_doit.c ++++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs7/pk7_doit.c +@@ -1092,6 +1092,8 @@ ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk) + ASN1_TYPE *astype; + if ((astype = get_attribute(sk, NID_pkcs9_messageDigest)) == NULL) + return NULL; ++ if (astype->type != V_ASN1_OCTET_STRING) ++ return NULL; + return astype->value.octet_string; + } + +-- +2.45.4 + diff --git a/SPECS/hvloader/hvloader.spec b/SPECS/hvloader/hvloader.spec index 7bffc311d60..52b31aa23df 100644 --- a/SPECS/hvloader/hvloader.spec +++ b/SPECS/hvloader/hvloader.spec @@ -4,7 +4,7 @@ Summary: HvLoader.efi is an EFI application for loading an external hypervisor loader. Name: hvloader Version: 1.0.1 -Release: 16%{?dist} +Release: 17%{?dist} License: MIT Vendor: Microsoft Corporation Distribution: Mariner @@ -37,6 +37,10 @@ Patch19: CVE-2024-38796.patch Patch20: CVE-2025-3770.patch Patch21: CVE-2025-2296.patch Patch22: CVE-2025-2295.patch +Patch23: CVE-2025-69419.patch +Patch24: CVE-2025-69420.patch +Patch25: CVE-2025-69421.patch +Patch26: CVE-2026-22795.patch BuildRequires: bc BuildRequires: gcc @@ -82,6 +86,9 @@ cp ./Build/MdeModule/RELEASE_GCC5/X64/MdeModulePkg/Application/%{name_github}-%{ /boot/efi/HvLoader.efi %changelog +* Mon Feb 09 2026 Azure Linux Security Servicing Account - 1.0.1-17 +- Patch for CVE-2026-22795, CVE-2025-69421, CVE-2025-69420, CVE-2025-69419 + * Tue Jan 06 2026 Azure Linux Security Servicing Account - 1.0.1-16 - Patch for CVE-2025-2295 From 577640ad654e0cba51f24bdb707168ce1adcf3f3 Mon Sep 17 00:00:00 2001 From: BinduSri-6522866 Date: Mon, 9 Feb 2026 11:59:12 +0000 Subject: [PATCH 2/3] added correct patch links --- SPECS/hvloader/CVE-2025-69419.patch | 2 +- SPECS/hvloader/CVE-2025-69420.patch | 2 +- SPECS/hvloader/CVE-2025-69421.patch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SPECS/hvloader/CVE-2025-69419.patch b/SPECS/hvloader/CVE-2025-69419.patch index 28d3b23a8f5..49ea6929836 100644 --- a/SPECS/hvloader/CVE-2025-69419.patch +++ b/SPECS/hvloader/CVE-2025-69419.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Check return code of UTF8_putc: handle failure in ASN.1 comments from patch. Signed-off-by: Azure Linux Security Servicing Account -Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/36ecb4960872a4ce04bf6f1e1f4e78d75ec0c0c7.patch +Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/41be0f216404f14457bbf3b9cc488dba60b49296.patch --- .../Library/OpensslLib/openssl/crypto/asn1/a_strex.c | 6 ++++-- .../OpensslLib/openssl/crypto/pkcs12/p12_utl.c | 11 +++++++++-- diff --git a/SPECS/hvloader/CVE-2025-69420.patch b/SPECS/hvloader/CVE-2025-69420.patch index abb47fdbeea..277703525b4 100644 --- a/SPECS/hvloader/CVE-2025-69420.patch +++ b/SPECS/hvloader/CVE-2025-69420.patch @@ -18,7 +18,7 @@ Reviewed-by: Tomas Mraz MergeDate: Mon Jan 26 19:53:36 2026 (cherry picked from commit ea8fc4c345fbd749048809c9f7c881ea656b0b94) Signed-off-by: Azure Linux Security Servicing Account -Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/41be0f216404f14457bbf3b9cc488dba60b49296.patch +Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/ea8fc4c345fbd749048809c9f7c881ea656b0b94.patch --- .../Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPECS/hvloader/CVE-2025-69421.patch b/SPECS/hvloader/CVE-2025-69421.patch index 97d3c5bad9a..257ec5bd46c 100644 --- a/SPECS/hvloader/CVE-2025-69421.patch +++ b/SPECS/hvloader/CVE-2025-69421.patch @@ -9,7 +9,7 @@ Prevents NULL dereference when oct is NULL. Inspired by upstream patch for PKCS12_item_decrypt_d2i_ex(). Signed-off-by: Azure Linux Security Servicing Account -Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/4e254b48ad93cc092be3dd62d97015f33f73133a.patch +Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/2c13bf15286328641a805eb3b7c97e27d42881fb.patch --- .../Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c | 7 +++++++ 1 file changed, 7 insertions(+) From 73fb370f4b2665fc8eadd9eed85e08a44ac162b0 Mon Sep 17 00:00:00 2001 From: Kanishk Bansal Date: Mon, 9 Feb 2026 13:11:26 +0000 Subject: [PATCH 3/3] Bump release for consistency with hvloader spec Signed-off-by: Kanishk Bansal --- SPECS-SIGNED/hvloader-signed/hvloader-signed.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SPECS-SIGNED/hvloader-signed/hvloader-signed.spec b/SPECS-SIGNED/hvloader-signed/hvloader-signed.spec index 8e5ccefa1e0..2692926f426 100644 --- a/SPECS-SIGNED/hvloader-signed/hvloader-signed.spec +++ b/SPECS-SIGNED/hvloader-signed/hvloader-signed.spec @@ -6,7 +6,7 @@ Summary: Signed HvLoader.efi for %{buildarch} systems Name: hvloader-signed-%{buildarch} Version: 1.0.1 -Release: 16%{?dist} +Release: 17%{?dist} License: MIT Vendor: Microsoft Corporation Distribution: Mariner @@ -69,6 +69,9 @@ popd /boot/efi/HvLoader.efi %changelog +* Mon Feb 09 2026 Azure Linux Security Servicing Account - 1.0.1-17 +- Bump release for consistency with hvloader spec. + * Tue Jan 06 2026 Azure Linux Security Servicing Account - 1.0.1-16 - Bump release for consistency with hvloader spec.