Skip to contentSkip to conversation

curl: fix CVE-2026-80230

PATCH New Jaipaul Cheernam 1 participant 1 message Oct 16

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 curl: fix CVE-2026-80230

Backport the upstream fix [1] as mentioned in [2]

[1] https://github.com/curl/curl/commit/5267ed859d545534d0c21
[2] https://curl.se/docs/CVE-2026-80230.html

---
Note: SRC_URI indentation is corrected by devtool

 .../curl/curl/CVE-2026-80230.patch            | 63 +++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       | 68 +++++++++----------
 2 files changed, 97 insertions(+), 34 deletions(-)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-80230.patch
meta/recipes-support/curl/curl/CVE-2026-80230.patch new file +63 -0
new file mode 100644
index 0000000000..0473c0922d
@@ -0,0 +1,63 @@
+From c14852aaf58042b71f98cf5aebea8d7821f6e5e1 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Mon, 24 Aug 2026 23:37:49 +0200
+Subject: [PATCH] openssl: no server cert is only okay if also not pinned
+
+Reported-by: Stanislav Fort
+Closes #22660
+
+CVE: CVE-2026-80230
+Upstream-Status: Backport [https://github.com/curl/curl/commit/5267ed859d545534d0c21]
+
+Note: logic lives in servercert() in 8.7.1, not in ossl_check_pinned_key
+Macro CURL_EASY_STR is not available in 8.7.1 used direct data struct
+strict is set based on verifypeer and verifyhost by calling function
+
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/vtls/openssl.c | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
+index 3e130c5..481528b 100644
+--- a/lib/vtls/openssl.c
++++ b/lib/vtls/openssl.c
+@@ -4202,6 +4202,18 @@ static void infof_certstack(struct Curl_easy *data, const SSL *ssl)
+ #define infof_certstack(data, ssl)
+ #endif
+ 
++static const char *pinned(struct Curl_cfilter *cf,
++                          struct Curl_easy *data)
++{
++  (void)cf;
++  return
++#ifndef CURL_DISABLE_PROXY
++    Curl_ssl_cf_is_proxy(cf) ?
++    data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] :
++#endif
++    data->set.str[STRING_SSL_PINNEDPUBLICKEY];
++}
++
+ /*
+  * Get the server cert, verify it and show it, etc., only call failf() if the
+  * 'strict' argument is TRUE as otherwise all this is for informational
+@@ -4248,7 +4260,7 @@ static CURLcode servercert(struct Curl_cfilter *cf,
+   backend->server_cert = SSL_get1_peer_certificate(backend->handle);
+   if(!backend->server_cert) {
+     BIO_free(mem);
+-    if(!strict)
++    if(!strict && !pinned(cf, data))
+       return CURLE_OK;
+ 
+     failf(data, "SSL: couldn't get peer certificate");
+@@ -4424,9 +4436,7 @@ static CURLcode servercert(struct Curl_cfilter *cf,
+     /* when not strict, we don't bother about the verify cert problems */
+     result = CURLE_OK;
+ 
+-  ptr = Curl_ssl_cf_is_proxy(cf)?
+-    data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]:
+-    data->set.str[STRING_SSL_PINNEDPUBLICKEY];
++  ptr = pinned(cf, data);
+   if(!result && ptr) {
+     result = ossl_pkp_pin_peer_pubkey(data, backend->server_cert, ptr);
+     if(result)
meta/recipes-support/curl/curl_8.7.1.bb +34 -34

74 lines not on this page · raw message