Skip to content

Commit 347a49c

Browse files
CBL-Mariner-Botcorvus-callidusjslobodzian
authored
[AUTO-CHERRYPICK] Patch openssl for CVE-2025-69419, CVE-2026-22795, and CVE-2026-22796 - branch 3.0-dev (#15698)
Co-authored-by: corvus-callidus <lyrydber@microsoft.com> Co-authored-by: jslobodzian <joslobo@microsoft.com>
1 parent 950b256 commit 347a49c

File tree

7 files changed

+149
-23
lines changed

7 files changed

+149
-23
lines changed

SPECS/openssl/CVE-2025-69419.patch

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From a26a90d38edec3748566129d824e664b54bee2e2 Mon Sep 17 00:00:00 2001
2+
From: Norbert Pocs <norbertp@openssl.org>
3+
Date: Thu, 11 Dec 2025 12:49:00 +0100
4+
Subject: [PATCH] Check return code of UTF8_putc
5+
6+
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
7+
8+
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
9+
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
10+
(Merged from https://github.com/openssl/openssl/pull/29376)
11+
---
12+
crypto/asn1/a_strex.c | 6 ++++--
13+
crypto/pkcs12/p12_utl.c | 5 +++++
14+
2 files changed, 9 insertions(+), 2 deletions(-)
15+
16+
diff --git a/crypto/asn1/a_strex.c b/crypto/asn1/a_strex.c
17+
index 683b8a06fc540..68c2e31a70a28 100644
18+
--- a/crypto/asn1/a_strex.c
19+
+++ b/crypto/asn1/a_strex.c
20+
@@ -198,8 +198,10 @@ static int do_buf(unsigned char *buf, int buflen,
21+
orflags = CHARTYPE_LAST_ESC_2253;
22+
if (type & BUF_TYPE_CONVUTF8) {
23+
unsigned char utfbuf[6];
24+
- int utflen;
25+
- utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c);
26+
+ int utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c);
27+
+
28+
+ if (utflen < 0)
29+
+ return -1; /* error happened with UTF8 */
30+
for (i = 0; i < utflen; i++) {
31+
/*
32+
* We don't need to worry about setting orflags correctly
33+
diff --git a/crypto/pkcs12/p12_utl.c b/crypto/pkcs12/p12_utl.c
34+
index 1669ef5b07939..9360f9930713f 100644
35+
--- a/crypto/pkcs12/p12_utl.c
36+
+++ b/crypto/pkcs12/p12_utl.c
37+
@@ -206,6 +206,11 @@ char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen)
38+
/* re-run the loop emitting UTF-8 string */
39+
for (asclen = 0, i = 0; i < unilen; ) {
40+
j = bmp_to_utf8(asctmp+asclen, uni+i, unilen-i);
41+
+ /* when UTF8_putc fails */
42+
+ if (j < 0) {
43+
+ OPENSSL_free(asctmp);
44+
+ return NULL;
45+
+ }
46+
if (j == 4) i += 4;
47+
else i += 2;
48+
asclen += j;

SPECS/openssl/CVE-2026-22796.patch

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
From eeee3cbd4d682095ed431052f00403004596373e Mon Sep 17 00:00:00 2001
2+
From: Bob Beck <beck@openssl.org>
3+
Date: Wed, 7 Jan 2026 11:29:48 -0700
4+
Subject: [PATCH] Ensure ASN1 types are checked before use.
5+
6+
Some of these were fixed by LibreSSL in commit https://github.com/openbsd/src/commit/aa1f637d454961d22117b4353f98253e984b3ba8
7+
this fix includes the other fixes in that commit, as well as fixes for others found by a scan
8+
for a similar unvalidated access paradigm in the tree.
9+
10+
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
11+
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
12+
Reviewed-by: Tomas Mraz <tomas@openssl.org>
13+
(Merged from https://github.com/openssl/openssl/pull/29582)
14+
15+
Fixes CVE-2026-22796, CVE-2026-22795
16+
---
17+
apps/s_client.c | 3 ++-
18+
crypto/pkcs12/p12_kiss.c | 10 ++++++++--
19+
crypto/pkcs7/pk7_doit.c | 2 ++
20+
3 files changed, 12 insertions(+), 3 deletions(-)
21+
22+
diff --git a/apps/s_client.c b/apps/s_client.c
23+
index c5b7384a290a4..1f52cf378fbbc 100644
24+
--- a/apps/s_client.c
25+
+++ b/apps/s_client.c
26+
@@ -2832,8 +2832,9 @@ int s_client_main(int argc, char **argv)
27+
goto end;
28+
}
29+
atyp = ASN1_generate_nconf(genstr, cnf);
30+
- if (atyp == NULL) {
31+
+ if (atyp == NULL || atyp->type != V_ASN1_SEQUENCE) {
32+
NCONF_free(cnf);
33+
+ ASN1_TYPE_free(atyp);
34+
BIO_printf(bio_err, "ASN1_generate_nconf failed\n");
35+
goto end;
36+
}
37+
diff --git a/crypto/pkcs12/p12_kiss.c b/crypto/pkcs12/p12_kiss.c
38+
index 10b581612dbb2..d0236e34fe9df 100644
39+
--- a/crypto/pkcs12/p12_kiss.c
40+
+++ b/crypto/pkcs12/p12_kiss.c
41+
@@ -196,11 +196,17 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
42+
ASN1_BMPSTRING *fname = NULL;
43+
ASN1_OCTET_STRING *lkid = NULL;
44+
45+
- if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName)))
46+
+ if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName))) {
47+
+ if (attrib->type != V_ASN1_BMPSTRING)
48+
+ return 0;
49+
fname = attrib->value.bmpstring;
50+
+ }
51+
52+
- if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID)))
53+
+ if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID))) {
54+
+ if (attrib->type != V_ASN1_OCTET_STRING)
55+
+ return 0;
56+
lkid = attrib->value.octet_string;
57+
+ }
58+
59+
switch (PKCS12_SAFEBAG_get_nid(bag)) {
60+
case NID_keyBag:
61+
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c
62+
index 74f863af8fa52..6353fec47c068 100644
63+
--- a/crypto/pkcs7/pk7_doit.c
64+
+++ b/crypto/pkcs7/pk7_doit.c
65+
@@ -1178,6 +1178,8 @@ ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk)
66+
ASN1_TYPE *astype;
67+
if ((astype = get_attribute(sk, NID_pkcs9_messageDigest)) == NULL)
68+
return NULL;
69+
+ if (astype->type != V_ASN1_OCTET_STRING)
70+
+ return NULL;
71+
return astype->value.octet_string;
72+
}
73+

SPECS/openssl/openssl.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Summary: Utilities from the general purpose cryptography library with TLS implementation
1010
Name: openssl
1111
Version: 3.3.5
12-
Release: 2%{?dist}
12+
Release: 3%{?dist}
1313
Vendor: Microsoft Corporation
1414
Distribution: Azure Linux
1515
Source: https://github.com/openssl/openssl/releases/download/openssl-%{version}/openssl-%{version}.tar.gz
@@ -75,6 +75,8 @@ Patch105: 0001-Fix-heap-buffer-overflow-in-BIO_f_linebuffer.patch
7575
Patch106: 0001-Fix-OCB-AES-NI-HW-stream-path-unauthenticated-unencr.patch
7676
Patch107: 0001-Verify-ASN1-object-s-types-before-attempting-to-acce.patch
7777
Patch108: 0001-Add-NULL-check-to-PKCS12_item_decrypt_d2i_ex.patch
78+
Patch109: CVE-2025-69419.patch
79+
Patch110: CVE-2026-22796.patch
7880

7981
License: Apache-2.0
8082
URL: http://www.openssl.org/
@@ -368,6 +370,9 @@ install -m644 %{SOURCE9} \
368370
%ldconfig_scriptlets libs
369371

370372
%changelog
373+
* Thu Jan 29 2026 Lynsey Rydberg <lyrydber@microsoft.com> - 3.3.5-3
374+
- Patch CVE-2025-69419, CVE-2026-22795, and CVE-2026-22796
375+
371376
* Tue Jan 27 2026 Lynsey Rydberg <lyrydber@microsoft.com> - 3.3.5-2
372377
- Patch CVE-2025-15467, CVE-2025-15468, CVE-2025-66199, CVE-2025-68160,
373378
CVE-2025-69418, CVE-2025-69420, and CVE-2025-69421

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ gtk-doc-1.33.2-1.azl3.noarch.rpm
170170
autoconf-2.72-2.azl3.noarch.rpm
171171
automake-1.16.5-2.azl3.noarch.rpm
172172
ocaml-srpm-macros-9-4.azl3.noarch.rpm
173-
openssl-3.3.5-2.azl3.aarch64.rpm
174-
openssl-devel-3.3.5-2.azl3.aarch64.rpm
175-
openssl-libs-3.3.5-2.azl3.aarch64.rpm
176-
openssl-perl-3.3.5-2.azl3.aarch64.rpm
177-
openssl-static-3.3.5-2.azl3.aarch64.rpm
173+
openssl-3.3.5-3.azl3.aarch64.rpm
174+
openssl-devel-3.3.5-3.azl3.aarch64.rpm
175+
openssl-libs-3.3.5-3.azl3.aarch64.rpm
176+
openssl-perl-3.3.5-3.azl3.aarch64.rpm
177+
openssl-static-3.3.5-3.azl3.aarch64.rpm
178178
libcap-2.69-12.azl3.aarch64.rpm
179179
libcap-devel-2.69-12.azl3.aarch64.rpm
180180
debugedit-5.0-2.azl3.aarch64.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ gtk-doc-1.33.2-1.azl3.noarch.rpm
170170
autoconf-2.72-2.azl3.noarch.rpm
171171
automake-1.16.5-2.azl3.noarch.rpm
172172
ocaml-srpm-macros-9-4.azl3.noarch.rpm
173-
openssl-3.3.5-2.azl3.x86_64.rpm
174-
openssl-devel-3.3.5-2.azl3.x86_64.rpm
175-
openssl-libs-3.3.5-2.azl3.x86_64.rpm
176-
openssl-perl-3.3.5-2.azl3.x86_64.rpm
177-
openssl-static-3.3.5-2.azl3.x86_64.rpm
173+
openssl-3.3.5-3.azl3.x86_64.rpm
174+
openssl-devel-3.3.5-3.azl3.x86_64.rpm
175+
openssl-libs-3.3.5-3.azl3.x86_64.rpm
176+
openssl-perl-3.3.5-3.azl3.x86_64.rpm
177+
openssl-static-3.3.5-3.azl3.x86_64.rpm
178178
libcap-2.69-12.azl3.x86_64.rpm
179179
libcap-devel-2.69-12.azl3.x86_64.rpm
180180
debugedit-5.0-2.azl3.x86_64.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,12 @@ npth-debuginfo-1.6-4.azl3.aarch64.rpm
287287
npth-devel-1.6-4.azl3.aarch64.rpm
288288
ntsysv-1.25-1.azl3.aarch64.rpm
289289
ocaml-srpm-macros-9-4.azl3.noarch.rpm
290-
openssl-3.3.5-2.azl3.aarch64.rpm
291-
openssl-debuginfo-3.3.5-2.azl3.aarch64.rpm
292-
openssl-devel-3.3.5-2.azl3.aarch64.rpm
293-
openssl-libs-3.3.5-2.azl3.aarch64.rpm
294-
openssl-perl-3.3.5-2.azl3.aarch64.rpm
295-
openssl-static-3.3.5-2.azl3.aarch64.rpm
290+
openssl-3.3.5-3.azl3.aarch64.rpm
291+
openssl-debuginfo-3.3.5-3.azl3.aarch64.rpm
292+
openssl-devel-3.3.5-3.azl3.aarch64.rpm
293+
openssl-libs-3.3.5-3.azl3.aarch64.rpm
294+
openssl-perl-3.3.5-3.azl3.aarch64.rpm
295+
openssl-static-3.3.5-3.azl3.aarch64.rpm
296296
p11-kit-0.25.0-1.azl3.aarch64.rpm
297297
p11-kit-debuginfo-0.25.0-1.azl3.aarch64.rpm
298298
p11-kit-devel-0.25.0-1.azl3.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,12 @@ npth-debuginfo-1.6-4.azl3.x86_64.rpm
295295
npth-devel-1.6-4.azl3.x86_64.rpm
296296
ntsysv-1.25-1.azl3.x86_64.rpm
297297
ocaml-srpm-macros-9-4.azl3.noarch.rpm
298-
openssl-3.3.5-2.azl3.x86_64.rpm
299-
openssl-debuginfo-3.3.5-2.azl3.x86_64.rpm
300-
openssl-devel-3.3.5-2.azl3.x86_64.rpm
301-
openssl-libs-3.3.5-2.azl3.x86_64.rpm
302-
openssl-perl-3.3.5-2.azl3.x86_64.rpm
303-
openssl-static-3.3.5-2.azl3.x86_64.rpm
298+
openssl-3.3.5-3.azl3.x86_64.rpm
299+
openssl-debuginfo-3.3.5-3.azl3.x86_64.rpm
300+
openssl-devel-3.3.5-3.azl3.x86_64.rpm
301+
openssl-libs-3.3.5-3.azl3.x86_64.rpm
302+
openssl-perl-3.3.5-3.azl3.x86_64.rpm
303+
openssl-static-3.3.5-3.azl3.x86_64.rpm
304304
p11-kit-0.25.0-1.azl3.x86_64.rpm
305305
p11-kit-debuginfo-0.25.0-1.azl3.x86_64.rpm
306306
p11-kit-devel-0.25.0-1.azl3.x86_64.rpm

0 commit comments

Comments
 (0)