diff -Nru wolfssl-5.5.4/debian/changelog wolfssl-5.5.4/debian/changelog --- wolfssl-5.5.4/debian/changelog 2026-06-29 10:14:22.000000000 -0600 +++ wolfssl-5.5.4/debian/changelog 2026-09-27 14:56:25.000000000 -0600 @@ -1,3 +1,19 @@ +wolfssl (5.5.4-2+deb12u4) bookworm; urgency=medium + + * Backport upstream security fixes. + * CVE-2026-93302: require trusted peer certificates to match byte for + byte. + * CVE-2026-93304: reject ChangeCipherSpec before ClientKeyExchange is + sent. + * CVE-2026-15442: fix use-after-free in TLS shutdown/ReceiveData + sequences. + * CVE-2026-94417: check the CRL when a certificate names no OCSP + responder. + * CVE-2026-89134: apply Subject CN name constraints unless a dNSName + SAN is present. + + -- Jacob Barthelmeh Sun, 27 Sep 2026 14:56:25 -0600 + wolfssl (5.5.4-2+deb12u3) bookworm-security; urgency=high * Backport upstream security fixes. (See #1140765, #1140815) diff -Nru wolfssl-5.5.4/debian/patches/CVE-2026-15442.patch wolfssl-5.5.4/debian/patches/CVE-2026-15442.patch --- wolfssl-5.5.4/debian/patches/CVE-2026-15442.patch 1969-12-31 17:00:00.000000000 -0700 +++ wolfssl-5.5.4/debian/patches/CVE-2026-15442.patch 2026-09-27 14:56:25.000000000 -0600 @@ -0,0 +1,22 @@ +Description: Backport for CVE-2026-15442 for (D)TLS shutdown during buffered reads +Origin: upstream, https://github.com/wolfSSL/wolfssl/commit/07d41740de70c56a45295446e1cd2b48124c6819 +Author: Josh Holtrop +Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2026-15442 +Forwarded: not-needed +--- +--- wolfssl-5.5.4.orig/src/ssl.c ++++ wolfssl-5.5.4/src/ssl.c +@@ -3677,6 +3677,13 @@ int wolfSSL_shutdown(WOLFSSL* ssl) + + /* call wolfSSL_shutdown again for bidirectional shutdown */ + if (ssl->options.sentNotify && !ssl->options.closeNotify) { ++ /* Drain buffered application data before growing the input buffer. */ ++ if (ssl->buffers.clearOutputBuffer.length > 0) { ++ WOLFSSL_MSG("Pending application data, read it before shutdown"); ++ ret = WOLFSSL_SHUTDOWN_NOT_DONE; ++ WOLFSSL_LEAVE("wolfSSL_shutdown", ret); ++ return ret; ++ } + ret = ProcessReply(ssl); + if (ret == ZERO_RETURN) { + /* simulate OpenSSL behavior */ diff -Nru wolfssl-5.5.4/debian/patches/CVE-2026-89134.patch wolfssl-5.5.4/debian/patches/CVE-2026-89134.patch --- wolfssl-5.5.4/debian/patches/CVE-2026-89134.patch 1969-12-31 17:00:00.000000000 -0700 +++ wolfssl-5.5.4/debian/patches/CVE-2026-89134.patch 2026-09-27 14:56:25.000000000 -0600 @@ -0,0 +1,42 @@ +Description: Backport for CVE-2026-89134 for X.509 DNS name-constraint checking on the Subject CN +Origin: backport, https://github.com/wolfSSL/wolfssl/commit/9a0a01ae87476462d3b58a7627bdb539da670ea9 +Author: Ruby Martin +Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2026-89134 +Forwarded: not-needed +--- +--- wolfssl-5.5.4.orig/wolfcrypt/src/asn.c ++++ wolfssl-5.5.4/wolfcrypt/src/asn.c +@@ -16823,19 +16823,26 @@ static int ConfirmNameConstraints(Signer + byte nameType = nameTypes[i]; + DNS_entry* name = NULL; + DNS_entry subjectDnsName; /* temporary node used for subject name */ ++ DNS_entry* dnsSan = NULL; /* scan for a dNSName SAN */ + + XMEMSET(&subjectDnsName, 0, sizeof(DNS_entry)); + switch (nameType) { + case ASN_DNS_TYPE: + name = cert->altNames; + +- /* When no SAN is present, apply DNS name constraints to the +- * Subject CN. */ +- if (cert->subjectCN != NULL && cert->altNames == NULL) { +- subjectDnsName.next = NULL; +- subjectDnsName.type = ASN_DNS_TYPE; +- subjectDnsName.len = cert->subjectCNLen; +- subjectDnsName.name = cert->subjectCN; ++ /* Fall back to the Subject CN only when no dNSName SAN is present. */ ++ if (cert->subjectCN != NULL) { ++ for (dnsSan = cert->altNames; dnsSan != NULL; ++ dnsSan = dnsSan->next) { ++ if (dnsSan->type == ASN_DNS_TYPE) ++ break; ++ } ++ if (dnsSan == NULL) { /* no dNSName SAN present */ ++ subjectDnsName.next = NULL; ++ subjectDnsName.type = ASN_DNS_TYPE; ++ subjectDnsName.len = cert->subjectCNLen; ++ subjectDnsName.name = cert->subjectCN; ++ } + } + break; + case ASN_RFC822_TYPE: diff -Nru wolfssl-5.5.4/debian/patches/CVE-2026-93302.patch wolfssl-5.5.4/debian/patches/CVE-2026-93302.patch --- wolfssl-5.5.4/debian/patches/CVE-2026-93302.patch 1969-12-31 17:00:00.000000000 -0700 +++ wolfssl-5.5.4/debian/patches/CVE-2026-93302.patch 2026-09-27 14:56:25.000000000 -0600 @@ -0,0 +1,51 @@ +Description: Backport for CVE-2026-93302 for WOLFSSL_TRUST_PEER_CERT use, enabled with --enable-distro +Origin: backport, https://github.com/wolfSSL/wolfssl/commit/22bcd51d553eaac1de37bee91fdac80cc47961e1 +Author: Juliusz Sosinowicz +Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2026-93302 +Forwarded: not-needed +--- +--- wolfssl-5.5.4.orig/src/ssl.c ++++ wolfssl-5.5.4/src/ssl.c +@@ -4967,16 +4967,10 @@ int MatchTrustedPeer(TrustedPeerCert* tp + if (tp == NULL || cert == NULL) + return BAD_FUNC_ARG; + +- /* subject key id or subject hash has been compared when searching +- tpTable for the cert from function GetTrustedPeer */ +- +- /* compare signatures */ +- if (tp->sigLen == cert->sigLength) { +- if (XMEMCMP(tp->sig, cert->signature, cert->sigLength)) { +- return WOLFSSL_FAILURE; +- } +- } +- else { ++ /* Require the whole certificate to match, not just name/SKID/signature. */ ++ if (cert->source == NULL || tp->sig == NULL || ++ tp->sigLen != cert->maxIdx || ++ XMEMCMP(tp->sig, cert->source, cert->maxIdx) != 0) { + return WOLFSSL_FAILURE; + } + +@@ -5103,9 +5097,9 @@ int AddTrustedPeer(WOLFSSL_CERT_MANAGER* + (void)ret; + } + else { +- /* add trusted peer signature */ +- peerCert->sigLen = cert->sigLength; +- peerCert->sig = (byte *)XMALLOC(cert->sigLength, cm->heap, ++ /* Store the whole certificate DER for an exact match in MatchTrustedPeer(). */ ++ peerCert->sigLen = cert->maxIdx; ++ peerCert->sig = (byte *)XMALLOC(cert->maxIdx, cm->heap, + DYNAMIC_TYPE_SIGNATURE); + if (peerCert->sig == NULL) { + FreeDecodedCert(cert); +@@ -5114,7 +5108,7 @@ int AddTrustedPeer(WOLFSSL_CERT_MANAGER* + FreeDer(&der); + return MEMORY_E; + } +- XMEMCPY(peerCert->sig, cert->signature, cert->sigLength); ++ XMEMCPY(peerCert->sig, cert->source, cert->maxIdx); + + /* add trusted peer name */ + peerCert->nameLen = cert->subjectCNLen; diff -Nru wolfssl-5.5.4/debian/patches/CVE-2026-93304.patch wolfssl-5.5.4/debian/patches/CVE-2026-93304.patch --- wolfssl-5.5.4/debian/patches/CVE-2026-93304.patch 1969-12-31 17:00:00.000000000 -0700 +++ wolfssl-5.5.4/debian/patches/CVE-2026-93304.patch 2026-09-27 14:56:25.000000000 -0600 @@ -0,0 +1,21 @@ +Description: Backport for CVE-2026-93304 for TLS 1.2/DTLS client ChangeCipherSpec ordering +Origin: upstream, https://github.com/wolfSSL/wolfssl/commit/caaedc578f0d3feb1cfce420267936382afcf98d +Author: Kareem +Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2026-93304 +Forwarded: not-needed +--- +--- wolfssl-5.5.4.orig/src/internal.c ++++ wolfssl-5.5.4/src/internal.c +@@ -15382,6 +15382,12 @@ static int SanityCheckMsgReceived(WOLFSS + WOLFSSL_ERROR_VERBOSE(OUT_OF_ORDER_E); + return OUT_OF_ORDER_E; + } ++ /* Reject an early CCS: no master secret until CKE is sent. */ ++ if (ssl->options.clientState < CLIENT_KEYEXCHANGE_COMPLETE) { ++ WOLFSSL_MSG("No ClientKeyExchange before ChangeCipher"); ++ WOLFSSL_ERROR_VERBOSE(OUT_OF_ORDER_E); ++ return OUT_OF_ORDER_E; ++ } + } + else { + if (ssl->msgsReceived.got_server_hello == 0) { diff -Nru wolfssl-5.5.4/debian/patches/CVE-2026-94417.patch wolfssl-5.5.4/debian/patches/CVE-2026-94417.patch --- wolfssl-5.5.4/debian/patches/CVE-2026-94417.patch 1969-12-31 17:00:00.000000000 -0700 +++ wolfssl-5.5.4/debian/patches/CVE-2026-94417.patch 2026-09-27 14:56:25.000000000 -0600 @@ -0,0 +1,72 @@ +Description: Backport for CVE-2026-94417 for combined OCSP and CRL revocation checking, enabled with --enable-distro +Origin: backport, https://github.com/wolfSSL/wolfssl/commit/faec5fd3d3e0826d71a8082c615db366b77c83e9 +Author: Tobias Frauenschläger +Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2026-94417 +Forwarded: not-needed +--- +--- wolfssl-5.5.4.orig/src/internal.c ++++ wolfssl-5.5.4/src/internal.c +@@ -13054,6 +13054,16 @@ static int ProcessPeerCertCheckKey(WOLFS + return ret; + } + ++#if defined(HAVE_OCSP) && defined(HAVE_CRL) ++/* True when the cert names no OCSP responder (OCSP then returns 0). */ ++static int OcspCertHasNoUrl(WOLFSSL* ssl, DecodedCert* cert) ++{ ++ if (SSL_CM(ssl)->ocspUseOverrideURL) ++ return 0; ++ return (cert->extAuthInfo == NULL || cert->extAuthInfoSz <= 0); ++} ++#endif ++ + int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx, + word32 totalSz) + { +@@ -13400,6 +13410,9 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* + #endif /* WOLFSSL_TRUST_PEER_CERT */ + ) { + int skipAddCA = 0; ++ #if defined(HAVE_OCSP) && defined(HAVE_CRL) ++ int ocspNoUrl = 0; ++ #endif + + /* select last certificate */ + args->certIdx = args->count - 1; +@@ -13477,6 +13490,10 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* + WOLFSSL_MSG("Doing Non Leaf OCSP check"); + ret = CheckCertOCSP_ex(SSL_CM(ssl)->ocsp, + args->dCert, NULL, ssl); ++ #ifdef HAVE_CRL ++ if (ret == 0 && OcspCertHasNoUrl(ssl, args->dCert)) ++ ocspNoUrl = 1; ++ #endif + #ifdef WOLFSSL_NONBLOCK_OCSP + if (ret == OCSP_WANT_READ) { + args->lastErr = ret; +@@ -13498,11 +13515,8 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* + #ifdef HAVE_OCSP + if (SSL_CM(ssl)->ocspEnabled && + SSL_CM(ssl)->ocspCheckAll) { +- /* If the cert status is unknown to the OCSP +- responder, do a CRL lookup. If any other +- error, skip the CRL lookup and fail the +- certificate. */ +- doCrlLookup = (ret == OCSP_CERT_UNKNOWN); ++ /* CRL lookup when OCSP status is unknown or no responder is named. */ ++ doCrlLookup = (ret == OCSP_CERT_UNKNOWN) || ocspNoUrl; + } + #endif /* HAVE_OCSP */ + +@@ -13864,6 +13878,11 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* + } + #endif + doLookup = (ret == OCSP_CERT_UNKNOWN); ++ #ifdef HAVE_CRL ++ /* No responder named: run the CRL check anyway. */ ++ if (ret == 0 && OcspCertHasNoUrl(ssl, args->dCert)) ++ doLookup = 1; ++ #endif + if (ret != 0) { + WOLFSSL_MSG("\tOCSP Lookup not ok"); + args->fatal = 0; diff -Nru wolfssl-5.5.4/debian/patches/series wolfssl-5.5.4/debian/patches/series --- wolfssl-5.5.4/debian/patches/series 2026-06-29 10:14:22.000000000 -0600 +++ wolfssl-5.5.4/debian/patches/series 2026-09-27 14:49:32.000000000 -0600 @@ -20,3 +20,8 @@ CVE-2026-55961.patch CVE-2026-7511.patch CVE-2026-5194.patch +CVE-2026-15442.patch +CVE-2026-93304.patch +CVE-2026-89134.patch +CVE-2026-94417.patch +CVE-2026-93302.patch