xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-support/curl/curl/CVE-2022-43551.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 9e71901634e276dd050481c4320f046bebb1bc28 Mon Sep 17 00:00:00 2001
2From: Daniel Stenberg <daniel@haxx.se>
3Date: Mon, 19 Dec 2022 08:36:55 +0100
4Subject: [PATCH] http: use the IDN decoded name in HSTS checks
5
6Otherwise it stores the info HSTS into the persistent cache for the IDN
7name which will not match when the HSTS status is later checked for
8using the decoded name.
9
10Reported-by: Hiroki Kurosawa
11
12Closes #10111
13
14CVE: CVE-2022-43551
15Upstream-Status: Backport [https://github.com/curl/curl/commit/9e71901634e276dd050481c4320f046bebb1bc28]
16Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
17Comments: Hunk refresh to remove patch-fuzz warning
18
19---
20 lib/http.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/lib/http.c b/lib/http.c
24index 85528a2218eee..a784745a8d505 100644
25--- a/lib/http.c
26+++ b/lib/http.c
27@@ -3652,7 +3652,7 @@ CURLcode Curl_http_header(struct Curl_easy *data, struct connectdata *conn,
28   else if(data->hsts && checkprefix("Strict-Transport-Security:", headp) &&
29           (conn->handler->flags & PROTOPT_SSL)) {
30     CURLcode check =
31-      Curl_hsts_parse(data->hsts, data->state.up.hostname,
32+      Curl_hsts_parse(data->hsts, conn->host.name,
33                       headp + strlen("Strict-Transport-Security:"));
34     if(check)
35       infof(data, "Illegal STS header skipped");
36