diff options
author | Andrii Bordunov via Openembedded-core <openembedded-core@lists.openembedded.org> | 2019-08-13 23:25:52 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-08 22:52:27 +0100 |
commit | 1b628384281a809ea8a23904fb628fdafa52e0d2 (patch) | |
tree | 19131d1bb3f62fc425e546bab1294704a3ab0e53 | |
parent | 20ee17a579f89c2cdf39496b5bfd20d815414a3c (diff) | |
download | poky-1b628384281a809ea8a23904fb628fdafa52e0d2.tar.gz |
curl: fix CVE-2018-16890 CVE-2019-3822 CVE-2019-3823
(From OE-Core rev: 75a4b4d8fb14414bbe2e38be8ccda0af94ef9b40)
Signed-off-by: Kevin Weng <t-keweng@microsoft.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-support/curl/curl/CVE-2018-16890.patch | 50 | ||||
-rw-r--r-- | meta/recipes-support/curl/curl/CVE-2019-3822.patch | 47 | ||||
-rw-r--r-- | meta/recipes-support/curl/curl/CVE-2019-3823.patch | 55 | ||||
-rw-r--r-- | meta/recipes-support/curl/curl_7.61.0.bb | 3 |
4 files changed, 155 insertions, 0 deletions
diff --git a/meta/recipes-support/curl/curl/CVE-2018-16890.patch b/meta/recipes-support/curl/curl/CVE-2018-16890.patch new file mode 100644 index 0000000000..3776f362bc --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2018-16890.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 53d3c2f92b4a7561b1006494badf8cf2ef9110c0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Stenberg <daniel@haxx.se> | ||
3 | Date: Wed, 2 Jan 2019 20:33:08 +0100 | ||
4 | Subject: [PATCH 1/3] NTLM: fix size check condition for type2 received data | ||
5 | |||
6 | Bug: https://curl.haxx.se/docs/CVE-2018-16890.html | ||
7 | Reported-by: Wenxiang Qian | ||
8 | CVE-2018-16890 | ||
9 | |||
10 | Upstream-Status: Backport | ||
11 | [https://github.com/curl/curl/commit | ||
12 | /b780b30d1377adb10bbe774835f49e9b237fb9bb] | ||
13 | |||
14 | CVE: CVE-2018-16890 | ||
15 | |||
16 | Signed-off-by: Kevin Weng <t-keweng@microsoft.com> | ||
17 | --- | ||
18 | lib/vauth/ntlm.c | 7 ++++--- | ||
19 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
20 | |||
21 | diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c | ||
22 | index cdb8d8f0d..0212756ab 100644 | ||
23 | --- a/lib/vauth/ntlm.c | ||
24 | +++ b/lib/vauth/ntlm.c | ||
25 | @@ -5,7 +5,7 @@ | ||
26 | * | (__| |_| | _ <| |___ | ||
27 | * \___|\___/|_| \_\_____| | ||
28 | * | ||
29 | - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
30 | + * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
31 | * | ||
32 | * This software is licensed as described in the file COPYING, which | ||
33 | * you should have received as part of this distribution. The terms | ||
34 | @@ -182,10 +182,11 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data, | ||
35 | target_info_len = Curl_read16_le(&buffer[40]); | ||
36 | target_info_offset = Curl_read32_le(&buffer[44]); | ||
37 | if(target_info_len > 0) { | ||
38 | - if(((target_info_offset + target_info_len) > size) || | ||
39 | + if((target_info_offset >= size) || | ||
40 | + ((target_info_offset + target_info_len) > size) || | ||
41 | (target_info_offset < 48)) { | ||
42 | infof(data, "NTLM handshake failure (bad type-2 message). " | ||
43 | - "Target Info Offset Len is set incorrect by the peer\n"); | ||
44 | + "Target Info Offset Len is set incorrect by the peer\n"); | ||
45 | return CURLE_BAD_CONTENT_ENCODING; | ||
46 | } | ||
47 | |||
48 | -- | ||
49 | 2.22.0 | ||
50 | |||
diff --git a/meta/recipes-support/curl/curl/CVE-2019-3822.patch b/meta/recipes-support/curl/curl/CVE-2019-3822.patch new file mode 100644 index 0000000000..4f612ddd5e --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2019-3822.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 761b51f66c7b1cd2cd6c71b807bfdb6a27c49b30 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Stenberg <daniel@haxx.se> | ||
3 | Date: Thu, 3 Jan 2019 12:59:28 +0100 | ||
4 | Subject: [PATCH 2/3] ntlm: fix *_type3_message size check to avoid buffer | ||
5 | overflow | ||
6 | |||
7 | Bug: https://curl.haxx.se/docs/CVE-2019-3822.html | ||
8 | Reported-by: Wenxiang Qian | ||
9 | CVE-2019-3822 | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | [https://github.com/curl/curl/commit | ||
13 | /50c9484278c63b958655a717844f0721263939cc] | ||
14 | |||
15 | CVE: CVE-2019-3822 | ||
16 | |||
17 | Signed-off-by: Kevin Weng <t-keweng@microsoft.com> | ||
18 | --- | ||
19 | lib/vauth/ntlm.c | 11 +++++++---- | ||
20 | 1 file changed, 7 insertions(+), 4 deletions(-) | ||
21 | |||
22 | diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c | ||
23 | index 0212756ab..3be0403d9 100644 | ||
24 | --- a/lib/vauth/ntlm.c | ||
25 | +++ b/lib/vauth/ntlm.c | ||
26 | @@ -777,11 +777,14 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, | ||
27 | }); | ||
28 | |||
29 | #ifdef USE_NTRESPONSES | ||
30 | - if(size < (NTLM_BUFSIZE - ntresplen)) { | ||
31 | - DEBUGASSERT(size == (size_t)ntrespoff); | ||
32 | - memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen); | ||
33 | - size += ntresplen; | ||
34 | + /* ntresplen + size should not be risking an integer overflow here */ | ||
35 | + if(ntresplen + size > sizeof(ntlmbuf)) { | ||
36 | + failf(data, "incoming NTLM message too big"); | ||
37 | + return CURLE_OUT_OF_MEMORY; | ||
38 | } | ||
39 | + DEBUGASSERT(size == (size_t)ntrespoff); | ||
40 | + memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen); | ||
41 | + size += ntresplen; | ||
42 | |||
43 | DEBUG_OUT({ | ||
44 | fprintf(stderr, "\n ntresp="); | ||
45 | -- | ||
46 | 2.22.0 | ||
47 | |||
diff --git a/meta/recipes-support/curl/curl/CVE-2019-3823.patch b/meta/recipes-support/curl/curl/CVE-2019-3823.patch new file mode 100644 index 0000000000..194e6e6430 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2019-3823.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 40f6c913f63cdbfa81daa7ac7f1c7415bb99edeb Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Gustafsson <daniel@yesql.se> | ||
3 | Date: Sat, 19 Jan 2019 00:42:47 +0100 | ||
4 | Subject: [PATCH 3/3] smtp: avoid risk of buffer overflow in strtol | ||
5 | |||
6 | If the incoming len 5, but the buffer does not have a termination | ||
7 | after 5 bytes, the strtol() call may keep reading through the line | ||
8 | buffer until is exceeds its boundary. Fix by ensuring that we are | ||
9 | using a bounded read with a temporary buffer on the stack. | ||
10 | |||
11 | Bug: https://curl.haxx.se/docs/CVE-2019-3823.html | ||
12 | Reported-by: Brian Carpenter (Geeknik Labs) | ||
13 | CVE-2019-3823 | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | [https://github.com/curl/curl/commit | ||
17 | /39df4073e5413fcdbb5a38da0c1ce6f1c0ceb484] | ||
18 | |||
19 | CVE: CVE-2019-3823 | ||
20 | |||
21 | Signed-off-by: Kevin Weng <t-keweng@microsoft.com> | ||
22 | --- | ||
23 | lib/smtp.c | 8 ++++++-- | ||
24 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/lib/smtp.c b/lib/smtp.c | ||
27 | index ecf10a41a..1b9f92d30 100644 | ||
28 | --- a/lib/smtp.c | ||
29 | +++ b/lib/smtp.c | ||
30 | @@ -5,7 +5,7 @@ | ||
31 | * | (__| |_| | _ <| |___ | ||
32 | * \___|\___/|_| \_\_____| | ||
33 | * | ||
34 | - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
35 | + * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
36 | * | ||
37 | * This software is licensed as described in the file COPYING, which | ||
38 | * you should have received as part of this distribution. The terms | ||
39 | @@ -207,8 +207,12 @@ static bool smtp_endofresp(struct connectdata *conn, char *line, size_t len, | ||
40 | Section 4. Examples of RFC-4954 but some e-mail servers ignore this and | ||
41 | only send the response code instead as per Section 4.2. */ | ||
42 | if(line[3] == ' ' || len == 5) { | ||
43 | + char tmpline[6]; | ||
44 | + | ||
45 | result = TRUE; | ||
46 | - *resp = curlx_sltosi(strtol(line, NULL, 10)); | ||
47 | + memset(tmpline, '\0', sizeof(tmpline)); | ||
48 | + memcpy(tmpline, line, (len == 5 ? 5 : 3)); | ||
49 | + *resp = curlx_sltosi(strtol(tmpline, NULL, 10)); | ||
50 | |||
51 | /* Make sure real server never sends internal value */ | ||
52 | if(*resp == 1) | ||
53 | -- | ||
54 | 2.22.0 | ||
55 | |||
diff --git a/meta/recipes-support/curl/curl_7.61.0.bb b/meta/recipes-support/curl/curl_7.61.0.bb index 1027f75e9e..c1e4342df5 100644 --- a/meta/recipes-support/curl/curl_7.61.0.bb +++ b/meta/recipes-support/curl/curl_7.61.0.bb | |||
@@ -13,6 +13,9 @@ SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \ | |||
13 | file://CVE-2018-16842.patch \ | 13 | file://CVE-2018-16842.patch \ |
14 | file://CVE-2019-5435.patch \ | 14 | file://CVE-2019-5435.patch \ |
15 | file://CVE-2019-5436.patch \ | 15 | file://CVE-2019-5436.patch \ |
16 | file://CVE-2018-16890.patch \ | ||
17 | file://CVE-2019-3822.patch \ | ||
18 | file://CVE-2019-3823.patch \ | ||
16 | " | 19 | " |
17 | 20 | ||
18 | SRC_URI[md5sum] = "31d0a9f48dc796a7db351898a1e5058a" | 21 | SRC_URI[md5sum] = "31d0a9f48dc796a7db351898a1e5058a" |