Compare commits
10 Commits
651a4711bb
...
69cf330272
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69cf330272 | ||
|
|
eb2a3bbd7c | ||
|
|
506d336225 | ||
|
|
3f7e2bb7e9 | ||
|
|
1c0874b674 | ||
|
|
3626aa2810 | ||
|
|
038fb4fe2e | ||
|
|
5bfb6ed22a | ||
|
|
0b035d9347 | ||
|
|
f64d61dc7c |
206
backport-CVE-2024-8096-gtls-fix-OCSP-stapling-management.patch
Normal file
206
backport-CVE-2024-8096-gtls-fix-OCSP-stapling-management.patch
Normal file
@ -0,0 +1,206 @@
|
||||
From aeb1a281cab13c7ba791cb104e556b20e713941f Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Tue, 20 Aug 2024 16:14:39 +0200
|
||||
Subject: [PATCH] gtls: fix OCSP stapling management
|
||||
|
||||
Reported-by: Hiroki Kurosawa
|
||||
Closes #14642
|
||||
|
||||
Conflict:NA
|
||||
Reference:https://github.com/curl/curl/commit/aeb1a281cab13c7ba791cb104e556b20e713941f
|
||||
---
|
||||
lib/vtls/gtls.c | 146 ++++++++++++++++++++++++------------------------
|
||||
1 file changed, 73 insertions(+), 73 deletions(-)
|
||||
|
||||
diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
|
||||
index 03d6fcc03..c7589d9d3 100644
|
||||
--- a/lib/vtls/gtls.c
|
||||
+++ b/lib/vtls/gtls.c
|
||||
@@ -850,6 +850,13 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf,
|
||||
init_flags |= GNUTLS_NO_TICKETS;
|
||||
#endif
|
||||
|
||||
+#if defined(GNUTLS_NO_STATUS_REQUEST)
|
||||
+ if(!config->verifystatus)
|
||||
+ /* Disable the "status_request" TLS extension, enabled by default since
|
||||
+ GnuTLS 3.8.0. */
|
||||
+ init_flags |= GNUTLS_NO_STATUS_REQUEST;
|
||||
+#endif
|
||||
+
|
||||
rc = gnutls_init(>ls->session, init_flags);
|
||||
if(rc != GNUTLS_E_SUCCESS) {
|
||||
failf(data, "gnutls_init() failed: %d", rc);
|
||||
@@ -1321,104 +1328,97 @@ Curl_gtls_verifyserver(struct Curl_easy *data,
|
||||
infof(data, " server certificate verification SKIPPED");
|
||||
|
||||
if(config->verifystatus) {
|
||||
- if(gnutls_ocsp_status_request_is_checked(session, 0) == 0) {
|
||||
- gnutls_datum_t status_request;
|
||||
- gnutls_ocsp_resp_t ocsp_resp;
|
||||
+ gnutls_datum_t status_request;
|
||||
+ gnutls_ocsp_resp_t ocsp_resp;
|
||||
+ gnutls_ocsp_cert_status_t status;
|
||||
+ gnutls_x509_crl_reason_t reason;
|
||||
|
||||
- gnutls_ocsp_cert_status_t status;
|
||||
- gnutls_x509_crl_reason_t reason;
|
||||
+ rc = gnutls_ocsp_status_request_get(session, &status_request);
|
||||
|
||||
- rc = gnutls_ocsp_status_request_get(session, &status_request);
|
||||
+ if(rc == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
|
||||
+ failf(data, "No OCSP response received");
|
||||
+ return CURLE_SSL_INVALIDCERTSTATUS;
|
||||
+ }
|
||||
|
||||
- infof(data, " server certificate status verification FAILED");
|
||||
+ if(rc < 0) {
|
||||
+ failf(data, "Invalid OCSP response received");
|
||||
+ return CURLE_SSL_INVALIDCERTSTATUS;
|
||||
+ }
|
||||
|
||||
- if(rc == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
|
||||
- failf(data, "No OCSP response received");
|
||||
- return CURLE_SSL_INVALIDCERTSTATUS;
|
||||
- }
|
||||
+ gnutls_ocsp_resp_init(&ocsp_resp);
|
||||
|
||||
- if(rc < 0) {
|
||||
- failf(data, "Invalid OCSP response received");
|
||||
- return CURLE_SSL_INVALIDCERTSTATUS;
|
||||
- }
|
||||
+ rc = gnutls_ocsp_resp_import(ocsp_resp, &status_request);
|
||||
+ if(rc < 0) {
|
||||
+ failf(data, "Invalid OCSP response received");
|
||||
+ return CURLE_SSL_INVALIDCERTSTATUS;
|
||||
+ }
|
||||
|
||||
- gnutls_ocsp_resp_init(&ocsp_resp);
|
||||
+ (void)gnutls_ocsp_resp_get_single(ocsp_resp, 0, NULL, NULL, NULL, NULL,
|
||||
+ &status, NULL, NULL, NULL, &reason);
|
||||
|
||||
- rc = gnutls_ocsp_resp_import(ocsp_resp, &status_request);
|
||||
- if(rc < 0) {
|
||||
- failf(data, "Invalid OCSP response received");
|
||||
- return CURLE_SSL_INVALIDCERTSTATUS;
|
||||
- }
|
||||
+ switch(status) {
|
||||
+ case GNUTLS_OCSP_CERT_GOOD:
|
||||
+ break;
|
||||
|
||||
- (void)gnutls_ocsp_resp_get_single(ocsp_resp, 0, NULL, NULL, NULL, NULL,
|
||||
- &status, NULL, NULL, NULL, &reason);
|
||||
+ case GNUTLS_OCSP_CERT_REVOKED: {
|
||||
+ const char *crl_reason;
|
||||
|
||||
- switch(status) {
|
||||
- case GNUTLS_OCSP_CERT_GOOD:
|
||||
+ switch(reason) {
|
||||
+ default:
|
||||
+ case GNUTLS_X509_CRLREASON_UNSPECIFIED:
|
||||
+ crl_reason = "unspecified reason";
|
||||
break;
|
||||
|
||||
- case GNUTLS_OCSP_CERT_REVOKED: {
|
||||
- const char *crl_reason;
|
||||
-
|
||||
- switch(reason) {
|
||||
- default:
|
||||
- case GNUTLS_X509_CRLREASON_UNSPECIFIED:
|
||||
- crl_reason = "unspecified reason";
|
||||
- break;
|
||||
-
|
||||
- case GNUTLS_X509_CRLREASON_KEYCOMPROMISE:
|
||||
- crl_reason = "private key compromised";
|
||||
- break;
|
||||
-
|
||||
- case GNUTLS_X509_CRLREASON_CACOMPROMISE:
|
||||
- crl_reason = "CA compromised";
|
||||
- break;
|
||||
-
|
||||
- case GNUTLS_X509_CRLREASON_AFFILIATIONCHANGED:
|
||||
- crl_reason = "affiliation has changed";
|
||||
- break;
|
||||
+ case GNUTLS_X509_CRLREASON_KEYCOMPROMISE:
|
||||
+ crl_reason = "private key compromised";
|
||||
+ break;
|
||||
|
||||
- case GNUTLS_X509_CRLREASON_SUPERSEDED:
|
||||
- crl_reason = "certificate superseded";
|
||||
- break;
|
||||
+ case GNUTLS_X509_CRLREASON_CACOMPROMISE:
|
||||
+ crl_reason = "CA compromised";
|
||||
+ break;
|
||||
|
||||
- case GNUTLS_X509_CRLREASON_CESSATIONOFOPERATION:
|
||||
- crl_reason = "operation has ceased";
|
||||
- break;
|
||||
+ case GNUTLS_X509_CRLREASON_AFFILIATIONCHANGED:
|
||||
+ crl_reason = "affiliation has changed";
|
||||
+ break;
|
||||
|
||||
- case GNUTLS_X509_CRLREASON_CERTIFICATEHOLD:
|
||||
- crl_reason = "certificate is on hold";
|
||||
- break;
|
||||
+ case GNUTLS_X509_CRLREASON_SUPERSEDED:
|
||||
+ crl_reason = "certificate superseded";
|
||||
+ break;
|
||||
|
||||
- case GNUTLS_X509_CRLREASON_REMOVEFROMCRL:
|
||||
- crl_reason = "will be removed from delta CRL";
|
||||
- break;
|
||||
+ case GNUTLS_X509_CRLREASON_CESSATIONOFOPERATION:
|
||||
+ crl_reason = "operation has ceased";
|
||||
+ break;
|
||||
|
||||
- case GNUTLS_X509_CRLREASON_PRIVILEGEWITHDRAWN:
|
||||
- crl_reason = "privilege withdrawn";
|
||||
- break;
|
||||
+ case GNUTLS_X509_CRLREASON_CERTIFICATEHOLD:
|
||||
+ crl_reason = "certificate is on hold";
|
||||
+ break;
|
||||
|
||||
- case GNUTLS_X509_CRLREASON_AACOMPROMISE:
|
||||
- crl_reason = "AA compromised";
|
||||
- break;
|
||||
- }
|
||||
+ case GNUTLS_X509_CRLREASON_REMOVEFROMCRL:
|
||||
+ crl_reason = "will be removed from delta CRL";
|
||||
+ break;
|
||||
|
||||
- failf(data, "Server certificate was revoked: %s", crl_reason);
|
||||
+ case GNUTLS_X509_CRLREASON_PRIVILEGEWITHDRAWN:
|
||||
+ crl_reason = "privilege withdrawn";
|
||||
break;
|
||||
- }
|
||||
|
||||
- default:
|
||||
- case GNUTLS_OCSP_CERT_UNKNOWN:
|
||||
- failf(data, "Server certificate status is unknown");
|
||||
+ case GNUTLS_X509_CRLREASON_AACOMPROMISE:
|
||||
+ crl_reason = "AA compromised";
|
||||
break;
|
||||
}
|
||||
|
||||
- gnutls_ocsp_resp_deinit(ocsp_resp);
|
||||
+ failf(data, "Server certificate was revoked: %s", crl_reason);
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
- return CURLE_SSL_INVALIDCERTSTATUS;
|
||||
+ default:
|
||||
+ case GNUTLS_OCSP_CERT_UNKNOWN:
|
||||
+ failf(data, "Server certificate status is unknown");
|
||||
+ break;
|
||||
}
|
||||
- else
|
||||
- infof(data, " server certificate status verification OK");
|
||||
+
|
||||
+ gnutls_ocsp_resp_deinit(ocsp_resp);
|
||||
+ if(status != GNUTLS_OCSP_CERT_GOOD)
|
||||
+ return CURLE_SSL_INVALIDCERTSTATUS;
|
||||
}
|
||||
else
|
||||
infof(data, " server certificate status verification SKIPPED");
|
||||
--
|
||||
2.33.0
|
||||
|
||||
82
backport-CVE-2024-9681.patch
Normal file
82
backport-CVE-2024-9681.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From a94973805df96269bf3f3bf0a20ccb9887313316 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Wed, 9 Oct 2024 10:04:35 +0200
|
||||
Subject: [PATCH] hsts: improve subdomain handling
|
||||
|
||||
- on load, only replace existing HSTS entries if there is a full host
|
||||
match
|
||||
|
||||
- on matching, prefer a full host match and secondary the longest tail
|
||||
subdomain match
|
||||
|
||||
Closes #15210
|
||||
Conflict:Context adapt
|
||||
Reference:https://github.com/curl/curl/commit/a94973805df96269bf3f3bf0a20ccb9887313316
|
||||
---
|
||||
lib/hsts.c | 14 ++++++++++----
|
||||
tests/data/test1660 | 2 +-
|
||||
2 files changed, 11 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/lib/hsts.c b/lib/hsts.c
|
||||
index d5e883f51ef0f7..12052ce53c1c5a 100644
|
||||
--- a/lib/hsts.c
|
||||
+++ b/lib/hsts.c
|
||||
@@ -249,11 +249,13 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname,
|
||||
struct stsentry *Curl_hsts(struct hsts *h, const char *hostname,
|
||||
bool subdomain)
|
||||
{
|
||||
+ struct stsentry *bestsub = NULL;
|
||||
if(h) {
|
||||
time_t now = time(NULL);
|
||||
size_t hlen = strlen(hostname);
|
||||
struct Curl_llist_element *e;
|
||||
struct Curl_llist_element *n;
|
||||
+ size_t blen = 0;
|
||||
|
||||
if((hlen > MAX_HSTS_HOSTLEN) || !hlen)
|
||||
return NULL;
|
||||
@@ -275,15 +277,19 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname,
|
||||
if((subdomain && sts->includeSubDomains) && (ntail < hlen)) {
|
||||
size_t offs = hlen - ntail;
|
||||
if((hostname[offs-1] == '.') &&
|
||||
- strncasecompare(&hostname[offs], sts->host, ntail))
|
||||
- return sts;
|
||||
+ strncasecompare(&hostname[offs], sts->host, ntail) &&
|
||||
+ (ntail > blen)) {
|
||||
+ /* save the tail match with the longest tail */
|
||||
+ bestsub = sts;
|
||||
+ blen = ntail;
|
||||
+ }
|
||||
}
|
||||
/* avoid strcasecompare because the host name is not null terminated */
|
||||
if((hlen == ntail) && strncasecompare(hostname, sts->host, hlen))
|
||||
return sts;
|
||||
}
|
||||
}
|
||||
- return NULL; /* no match */
|
||||
+ return bestsub;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -435,7 +441,7 @@ static CURLcode hsts_add(struct hsts *h, char *line)
|
||||
e = Curl_hsts(h, p, subdomain);
|
||||
if(!e)
|
||||
result = hsts_create(h, p, subdomain, expires);
|
||||
- else {
|
||||
+ else if(strcasecompare(p, e->host)) {
|
||||
/* the same host name, use the largest expire time */
|
||||
if(expires > e->expires)
|
||||
e->expires = expires;
|
||||
diff --git a/tests/data/test1660 b/tests/data/test1660
|
||||
index f86126d19cf269..4b6f9615c9d517 100644
|
||||
--- a/tests/data/test1660
|
||||
+++ b/tests/data/test1660
|
||||
@@ -52,7 +52,7 @@ this.example [this.example]: 1548400797
|
||||
Input 12: error 43
|
||||
Input 13: error 43
|
||||
Input 14: error 43
|
||||
-3.example.com [example.com]: 1569905261 includeSubDomains
|
||||
+3.example.com [3.example.com]: 1569905261 includeSubDomains
|
||||
3.example.com [example.com]: 1569905261 includeSubDomains
|
||||
foo.example.com [example.com]: 1569905261 includeSubDomains
|
||||
'foo.xample.com' is not HSTS
|
||||
71
backport-cookie-treat-cookie-name-case-sensitively.patch
Normal file
71
backport-cookie-treat-cookie-name-case-sensitively.patch
Normal file
@ -0,0 +1,71 @@
|
||||
From 9919149aef67014150e2a1c75a7aa2c79204e30d Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Wed, 6 Nov 2024 11:26:25 +0100
|
||||
Subject: [PATCH] cookie: treat cookie name case sensitively
|
||||
|
||||
Extend test 31 to verify
|
||||
|
||||
Reported-by: delogicsreal on github
|
||||
Fixes #15492
|
||||
Closes #15493
|
||||
|
||||
Conflict:context adapt
|
||||
Reference:https://github.com/curl/curl/commit/9919149aef67014150e2a1c75a7aa2c79204e30d
|
||||
---
|
||||
lib/cookie.c | 4 ++--
|
||||
tests/data/test31 | 3 +++
|
||||
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/cookie.c b/lib/cookie.c
|
||||
index ca8c3c596..e37d58f1d 100644
|
||||
--- a/lib/cookie.c
|
||||
+++ b/lib/cookie.c
|
||||
@@ -989,7 +989,7 @@ replace_existing(struct Curl_easy *data,
|
||||
myhash = cookiehash(co->domain);
|
||||
clist = c->cookies[myhash];
|
||||
while(clist) {
|
||||
- if(strcasecompare(clist->name, co->name)) {
|
||||
+ if(!strcmp(clist->name, co->name)) {
|
||||
/* the names are identical */
|
||||
bool matching_domains = FALSE;
|
||||
|
||||
@@ -1029,7 +1029,7 @@ replace_existing(struct Curl_easy *data,
|
||||
}
|
||||
}
|
||||
|
||||
- if(!replace_co && strcasecompare(clist->name, co->name)) {
|
||||
+ if(!replace_co && !strcmp(clist->name, co->name)) {
|
||||
/* the names are identical */
|
||||
|
||||
if(clist->domain && co->domain) {
|
||||
diff --git a/tests/data/test31 b/tests/data/test31
|
||||
index d9d073996..2d411b5cd 100644
|
||||
--- a/tests/data/test31
|
||||
+++ b/tests/data/test31
|
||||
@@ -26,6 +26,7 @@ Set-Cookie: blankdomain=sure; domain=; path=/
|
||||
%if !hyper
|
||||
Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure
|
||||
Set-Cookie:ismatch=this ; domain=test31.curl; path=/silly/
|
||||
+Set-Cookie:ISMATCH=this ; domain=test31.curl; path=/silly/
|
||||
Set-Cookie: overwrite=this ; domain=test31.curl; path=/overwrite/
|
||||
Set-Cookie: overwrite=this2 ; domain=test31.curl; path=/overwrite
|
||||
Set-Cookie: sec1value=secure1 ; domain=test31.curl; path=/secure1/ ; secure
|
||||
@@ -75,6 +76,7 @@ Set-Cookie: securewithspace=after ; secure =
|
||||
%else
|
||||
Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure
|
||||
Set-Cookie: ismatch=this ; domain=test31.curl; path=/silly/
|
||||
+Set-Cookie:ISMATCH=this ; domain=test31.curl; path=/silly/
|
||||
Set-Cookie: overwrite=this ; domain=test31.curl; path=/overwrite/
|
||||
Set-Cookie: overwrite=this2 ; domain=test31.curl; path=/overwrite
|
||||
Set-Cookie: sec1value=secure1 ; domain=test31.curl; path=/secure1/ ; secure
|
||||
@@ -181,6 +183,7 @@ test31.curl FALSE /we/want/ FALSE 2118138987 nodomain value
|
||||
#HttpOnly_.test31.curl TRUE /p2/ FALSE 0 httpo2 value2
|
||||
#HttpOnly_.test31.curl TRUE /p1/ FALSE 0 httpo1 value1
|
||||
.test31.curl TRUE /overwrite FALSE 0 overwrite this2
|
||||
+.test31.curl TRUE /silly/ FALSE 0 ISMATCH this
|
||||
.test31.curl TRUE /silly/ FALSE 0 ismatch this
|
||||
test31.curl FALSE / FALSE 0 blankdomain sure
|
||||
</file>
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
From 48f61e781a01e6a8dbc4a347e280644b1c68ab6a Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Wed, 11 Sep 2024 14:12:41 +0200
|
||||
Subject: [PATCH] multi: check that the multi handle is valid in
|
||||
curl_multi_assign
|
||||
|
||||
By requiring that the multi handle is fine, it can detect bad usage
|
||||
better and by that avoid crashes. Like in the #14860 case, which is an
|
||||
application calling curl_multi_assign() with a NULL pointer multi
|
||||
handle.
|
||||
|
||||
Reported-by: Carlo Cabrera
|
||||
Fixes #14860
|
||||
Closes #14862
|
||||
|
||||
Conflict:NA
|
||||
Reference:https://github.com/curl/curl/commit/48f61e781a01e6a8dbc4a347e280644b1c68ab6a
|
||||
---
|
||||
lib/multi.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/lib/multi.c b/lib/multi.c
|
||||
index 062d09cc0..78e5c0a1e 100644
|
||||
--- a/lib/multi.c
|
||||
+++ b/lib/multi.c
|
||||
@@ -3688,6 +3688,8 @@ CURLMcode curl_multi_assign(struct Curl_multi *multi, curl_socket_t s,
|
||||
void *hashp)
|
||||
{
|
||||
struct Curl_sh_entry *there = NULL;
|
||||
+ if(!GOOD_MULTI_HANDLE(multi))
|
||||
+ return CURLM_BAD_HANDLE;
|
||||
|
||||
there = sh_getentry(&multi->sockhash, s);
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
69
backport-pre-CVE-2024-9681.patch
Normal file
69
backport-pre-CVE-2024-9681.patch
Normal file
@ -0,0 +1,69 @@
|
||||
From 60d8663afb0fb7f113604404c50840dfe9320039 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Tue, 8 Oct 2024 11:20:40 +0200
|
||||
Subject: [PATCH] hsts: avoid the local buffer and memcpy on lookup
|
||||
|
||||
Closes #15190
|
||||
Conflict:Context adapt
|
||||
Reference:https://github.com/curl/curl/commit/60d8663afb0fb7f113604404c50840dfe9320039
|
||||
---
|
||||
lib/hsts.c | 22 +++++++++-------------
|
||||
1 file changed, 9 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/lib/hsts.c b/lib/hsts.c
|
||||
index 7ecf004..f5e5bbf 100644
|
||||
--- a/lib/hsts.c
|
||||
+++ b/lib/hsts.c
|
||||
@@ -250,7 +250,6 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname,
|
||||
bool subdomain)
|
||||
{
|
||||
if(h) {
|
||||
- char buffer[MAX_HSTS_HOSTLEN + 1];
|
||||
time_t now = time(NULL);
|
||||
size_t hlen = strlen(hostname);
|
||||
struct Curl_llist_element *e;
|
||||
@@ -258,15 +257,13 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname,
|
||||
|
||||
if((hlen > MAX_HSTS_HOSTLEN) || !hlen)
|
||||
return NULL;
|
||||
- memcpy(buffer, hostname, hlen);
|
||||
if(hostname[hlen-1] == '.')
|
||||
/* remove the trailing dot */
|
||||
--hlen;
|
||||
- buffer[hlen] = 0;
|
||||
- hostname = buffer;
|
||||
|
||||
for(e = h->list.head; e; e = n) {
|
||||
struct stsentry *sts = e->ptr;
|
||||
+ size_t ntail;
|
||||
n = e->next;
|
||||
if(sts->expires <= now) {
|
||||
/* remove expired entries */
|
||||
@@ -274,16 +271,15 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname,
|
||||
hsts_free(sts);
|
||||
continue;
|
||||
}
|
||||
- if(subdomain && sts->includeSubDomains) {
|
||||
- size_t ntail = strlen(sts->host);
|
||||
- if(ntail < hlen) {
|
||||
- size_t offs = hlen - ntail;
|
||||
- if((hostname[offs-1] == '.') &&
|
||||
- strncasecompare(&hostname[offs], sts->host, ntail))
|
||||
- return sts;
|
||||
- }
|
||||
+ ntail = strlen(sts->host);
|
||||
+ if((subdomain && sts->includeSubDomains) && (ntail < hlen)) {
|
||||
+ size_t offs = hlen - ntail;
|
||||
+ if((hostname[offs-1] == '.') &&
|
||||
+ strncasecompare(&hostname[offs], sts->host, ntail))
|
||||
+ return sts;
|
||||
}
|
||||
- if(strcasecompare(hostname, sts->host))
|
||||
+ /* avoid strcasecompare because the host name is not null terminated */
|
||||
+ if((hlen == ntail) && strncasecompare(hostname, sts->host, hlen))
|
||||
return sts;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
From b049388d473a9a0189f3180e57e04a39a3793382 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Stenberg <daniel@haxx.se>
|
||||
Date: Tue, 4 Jun 2024 17:00:05 +0200
|
||||
Subject: [PATCH] url: allow DoH transfers to override max connection limit
|
||||
|
||||
When reaching the set maximum limit of allowed connections, allow a new
|
||||
connection anyway if the transfer is created for the (internal) purpose
|
||||
of doing a DoH name resolve. Otherwise, unrelated "normal" transfers can
|
||||
starve out new DoH requests making it impossible to name resolve for new
|
||||
transfers.
|
||||
|
||||
Bug: https://curl.se/mail/lib-2024-06/0001.html
|
||||
Reported-by: kartatz
|
||||
Closes #13880
|
||||
|
||||
Conflict:NA
|
||||
Reference:https://github.com/curl/curl/commit/b049388d473a9a0189f3180e57e04a39a3793382
|
||||
---
|
||||
lib/url.c | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/url.c b/lib/url.c
|
||||
index 41e35e153..4eabf0c87 100644
|
||||
--- a/lib/url.c
|
||||
+++ b/lib/url.c
|
||||
@@ -3662,10 +3662,16 @@ static CURLcode create_conn(struct Curl_easy *data,
|
||||
conn_candidate = Curl_conncache_extract_oldest(data);
|
||||
if(conn_candidate)
|
||||
Curl_disconnect(data, conn_candidate, FALSE);
|
||||
- else {
|
||||
- infof(data, "No connections available in cache");
|
||||
- connections_available = FALSE;
|
||||
- }
|
||||
+ else
|
||||
+#ifndef CURL_DISABLE_DOH
|
||||
+ if(data->set.dohfor)
|
||||
+ infof(data, "Allowing DoH to override max connection limit");
|
||||
+ else
|
||||
+#endif
|
||||
+ {
|
||||
+ infof(data, "No connections available in cache");
|
||||
+ connections_available = FALSE;
|
||||
+ }
|
||||
}
|
||||
|
||||
if(!connections_available) {
|
||||
--
|
||||
2.33.0
|
||||
|
||||
38
curl.spec
38
curl.spec
@ -7,7 +7,7 @@
|
||||
|
||||
Name: curl
|
||||
Version: 8.4.0
|
||||
Release: 8
|
||||
Release: 13
|
||||
Summary: Curl is used in command lines or scripts to transfer data
|
||||
License: curl
|
||||
URL: https://curl.se/
|
||||
@ -32,6 +32,12 @@ Patch23: backport-multi-avoid-memory-leak-risk.patch
|
||||
Patch24: backport-tool_cfgable-free-proxy_-cipher13_list-on-exit.patch
|
||||
Patch25: backport-CVE-2024-7264-x509asn1-clean-up-GTime2str.patch
|
||||
Patch26: backport-CVE-2024-7264-x509asn1-unittests-and-fixes-fo.patch
|
||||
Patch27: backport-CVE-2024-8096-gtls-fix-OCSP-stapling-management.patch
|
||||
Patch28: backport-url-allow-DoH-transfers-to-override-max-connection-limit.patch
|
||||
Patch29: backport-pre-CVE-2024-9681.patch
|
||||
Patch30: backport-CVE-2024-9681.patch
|
||||
Patch31: backport-multi-check-that-the-multi-handle-is-valid-in-curl_m.patch
|
||||
Patch32: backport-cookie-treat-cookie-name-case-sensitively.patch
|
||||
|
||||
BuildRequires: automake brotli-devel coreutils gcc groff krb5-devel
|
||||
BuildRequires: libidn2-devel libnghttp2-devel libpsl-devel
|
||||
@ -217,6 +223,36 @@ rm -rf ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Mon Dec 09 2024 zhouyihang <zhouyihang3@h-partners.com> - 8.4.0-13
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:cookie: treat cookie name case sensitively
|
||||
|
||||
* Sat Nov 30 2024 zhouyihang <zhouyihang3@h-partners.com> - 8.4.0-12
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:multi: check that the multi handle is valid in curl_multi_assign
|
||||
|
||||
* Mon Nov 11 2024 yanglu <yanglu72@h-partners.com> - 8.4.0-11
|
||||
- Type:CVE
|
||||
- CVE:CVE-2024-9681
|
||||
- SUG:NA
|
||||
- DESC:fix CVE-2024-9681
|
||||
|
||||
* Fri Sep 20 2024 zhouyihang <zhouyihang3@h-partners.com> - 8.4.0-10
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:url: allow DoH transfers to override max connection limit
|
||||
|
||||
* Thu Sep 12 2024 zhouyihang <zhouyihang3@h-partners.com> - 8.4.0-9
|
||||
- Type:CVE
|
||||
- CVE:CVE-2024-8096
|
||||
- SUG:NA
|
||||
- DESC:fix CVE-2024-8096
|
||||
|
||||
* Thu Sep 05 2024 zhouyihang <zhouyihang3@h-partners.com> - 8.4.0-8
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user