<html><body>
<h3>Signed-off-by: Kevin Weng <t-keweng@microsoft.com></h3>
<pre>.../curl/curl/CVE-2018-16890.patch | 50 +++++++++++++++++
.../curl/curl/CVE-2019-3822.patch | 47 ++++++++++++++++
.../curl/curl/CVE-2019-3823.patch | 55 +++++++++++++++++++
meta/recipes-support/curl/curl_7.61.0.bb | 3 +
4 files changed, 155 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2018-16890.patch
create mode 100644 meta/recipes-support/curl/curl/CVE-2019-3822.patch
create mode 100644 meta/recipes-support/curl/curl/CVE-2019-3823.patch</pre>
<p>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 @@ +From 53d3c2f92b4a7561b1006494badf8cf2ef9110c0 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg <daniel@haxx.se> +Date: Wed, 2 Jan 2019 20:33:08 +0100 +Subject: [PATCH 1/3] NTLM: fix size check condition for type2 received data + +Bug: <a href="https://u12060237.ct.sendgrid.net/wf/click?upn=ZUEdHBk4v9DOmlXxaQIXsuYawlW3mAc8KSIVCn7Sr15C6jasXKgfgJg3JjJc2B5tUGp03H07-2B9S6u-2FfoRsGaNA-3D-3D_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FT1vYL7RdHUXx5bTSyf-2BcHR-2FH99gGD0yxa2eDYEjnkkZ3q-2B67vtyhjRXye3X5wFj1YopTSAk5Ghi5zGLTSp0R-2BesqjMnZSBIQte-2FKY-2FwgQTg-2FQqDB3i-2BIdjRqTFYWHhWmQLTLv9u3mf-2FFNv-2BigQqkM7KcsUfyc29SOElH5SnNKCZpVtPS-2F8fNlROczCSn5Z8u">https://curl.haxx.se/docs/CVE-2018-16890.html</a> +Reported-by: Wenxiang Qian +CVE-2018-16890 + +Upstream-Status: Backport +[<a href="https://u12060237.ct.sendgrid.net/wf/click?upn=ZUEdHBk4v9DOmlXxaQIXsm-2BOxbx-2BokIEd78jiad-2F22EvF-2F5AbNKhGzn8FPX-2FD9Za_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FT1vYL7RdHUXx5bTSyf-2BcHR-2FH99gGD0yxa2eDYEjnkkbfyP9Hb4AT9te9JryfAuIA1BGpUIhQBgDhTQ-2FhwIlJUb9jEhlFXvRJuPqnZcFuWlOi2aUEuGkSAxP6h16UqA68h4LTavtE4TwLnozPPXJxP6v6Ih6A5zS8WEPqSjBL3gPYKE4qdTP41X9n-2BjlWFFxi">https://github.com/curl/curl/commit</a> +/b780b30d1377adb10bbe774835f49e9b237fb9bb] + +CVE: CVE-2018-16890 + +Signed-off-by: Kevin Weng <t-keweng@microsoft.com> +--- + lib/vauth/ntlm.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c +index cdb8d8f0d..0212756ab 100644 +--- a/lib/vauth/ntlm.c ++++ b/lib/vauth/ntlm.c +@@ -5,7 +5,7 @@ + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * +- * Copyright © 1998 – 2017, Daniel Stenberg, <daniel@haxx.se>, et al. ++ * Copyright © 1998 – 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -182,10 +182,11 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data, + target_info_len = Curl_read16_le(&buffer[40]); + target_info_offset = Curl_read32_le(&buffer[44]); + if(target_info_len > 0) { +- if(((target_info_offset + target_info_len) > size) || ++ if((target_info_offset >= size) || ++ ((target_info_offset + target_info_len) > size) || + (target_info_offset < 48)) { + infof(data, "NTLM handshake failure (bad type-2 message). " +- "Target Info Offset Len is set incorrect by the peer\n"); ++ "Target Info Offset Len is set incorrect by the peer\n"); + return CURLE_BAD_CONTENT_ENCODING; + } + +-- +2.22.0 + 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 @@ +From 761b51f66c7b1cd2cd6c71b807bfdb6a27c49b30 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg <daniel@haxx.se> +Date: Thu, 3 Jan 2019 12:59:28 +0100 +Subject: [PATCH 2/3] ntlm: fix *_type3_message size check to avoid buffer + overflow + +Bug: <a href="https://u12060237.ct.sendgrid.net/wf/click?upn=ZUEdHBk4v9DOmlXxaQIXsuYawlW3mAc8KSIVCn7Sr16swIdigko5fNDjNRt0Dh6FfGTpPs9ibM6aBry51kJrnw-3D-3D_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FT1vYL7RdHUXx5bTSyf-2BcHR-2FH99gGD0yxa2eDYEjnkkYGziql-2B9pL3R79OqEV4EwDBPfhNzGW2Kj2khXqXBvySHejML2tqsm3n-2Byqs7M98agA15zl3wmWYD2k4Xy3nqLO8yKg-2FG8vr33vz9iwN634IWrpHNe-2BTHJcgMf1-2Bwsxnec5yhfz3TtwAL2JUtNzAc89">https://curl.haxx.se/docs/CVE-2019-3822.html</a> +Reported-by: Wenxiang Qian +CVE-2019-3822 + +Upstream-Status: Backport +[<a href="https://u12060237.ct.sendgrid.net/wf/click?upn=ZUEdHBk4v9DOmlXxaQIXsm-2BOxbx-2BokIEd78jiad-2F22EvF-2F5AbNKhGzn8FPX-2FD9Za_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FT1vYL7RdHUXx5bTSyf-2BcHR-2FH99gGD0yxa2eDYEjnkkYtqXAfPxKeCYVZpz9z3vmGmbOcH-2Fphxgb6yEvSk5klvAyOQIx-2FrYQ2nAN1okiWOfghFTAhIrq44lBSFHfarVXkexltyyKjQ-2FbKtwlpHNG7smSGXE4o2MZR9Jfjh7iBekOVbGLyx7EgEDxYP5aOlBfp">https://github.com/curl/curl/commit</a> +/50c9484278c63b958655a717844f0721263939cc] + +CVE: CVE-2019-3822 + +Signed-off-by: Kevin Weng <t-keweng@microsoft.com> +--- + lib/vauth/ntlm.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c +index 0212756ab..3be0403d9 100644 +--- a/lib/vauth/ntlm.c ++++ b/lib/vauth/ntlm.c +@@ -777,11 +777,14 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy <strong>data, + }); + + #ifdef USE_NTRESPONSES +- if(size < (NTLM_BUFSIZE – ntresplen)) { +- DEBUGASSERT(size == (size_t)ntrespoff); +- memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen); +- size += ntresplen; ++ /</strong> ntresplen + size should not be risking an integer overflow here */ ++ if(ntresplen + size > sizeof(ntlmbuf)) { ++ failf(data, "incoming NTLM message too big"); ++ return CURLE_OUT_OF_MEMORY; + } ++ DEBUGASSERT(size == (size_t)ntrespoff); ++ memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen); ++ size += ntresplen; + + DEBUG_OUT({ + fprintf(stderr, "\n ntresp="); +-- +2.22.0 + 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 @@ +From 40f6c913f63cdbfa81daa7ac7f1c7415bb99edeb Mon Sep 17 00:00:00 2001 +From: Daniel Gustafsson <daniel@yesql.se> +Date: Sat, 19 Jan 2019 00:42:47 +0100 +Subject: [PATCH 3/3] smtp: avoid risk of buffer overflow in strtol + +If the incoming len 5, but the buffer does not have a termination +after 5 bytes, the strtol() call may keep reading through the line +buffer until is exceeds its boundary. Fix by ensuring that we are +using a bounded read with a temporary buffer on the stack. + +Bug: <a href="https://u12060237.ct.sendgrid.net/wf/click?upn=ZUEdHBk4v9DOmlXxaQIXsuYawlW3mAc8KSIVCn7Sr17bxD3qQbRJHwN3rEunY9YFM-2FGFwQQ-2BqqtWua0S2Yp0TA-3D-3D_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FT1vYL7RdHUXx5bTSyf-2BcHR-2FH99gGD0yxa2eDYEjnkkbuXWq8yA76NLdDMCKi4Nu5OZakSVClfIp1ZphWmBXTiRG51fUpCm2XxKf8LIT9LkhLsSgy1s3SkXQD7uENB-2FkAaTfDBWqSmtfNY40WPIebHLIji4b4QWMFszHTJsXO-2BG2X-2FdG0o0UF6UaxtpDS-2BYXG">https://curl.haxx.se/docs/CVE-2019-3823.html</a> +Reported-by: Brian Carpenter (Geeknik Labs) +CVE-2019-3823 + +Upstream-Status: Backport +[<a href="https://u12060237.ct.sendgrid.net/wf/click?upn=ZUEdHBk4v9DOmlXxaQIXsm-2BOxbx-2BokIEd78jiad-2F22EvF-2F5AbNKhGzn8FPX-2FD9Za_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FT1vYL7RdHUXx5bTSyf-2BcHR-2FH99gGD0yxa2eDYEjnkka3lrOWKES2RhRNheyFy5a9Uj-2Bgs0-2B68XtHbmfc-2F4wp-2FJKOyd-2BtWEubGB5iubDUOoYdXNbBmn0gKTuQbdtDr1q9S-2FqL-2F5s-2Bt-2Bod29utAe53W5mZ2m-2BiAyhjI2fDKtM6DQ4wbp6oxCc5C5jxRr0uGr-2Bm">https://github.com/curl/curl/commit</a> +/39df4073e5413fcdbb5a38da0c1ce6f1c0ceb484] + +CVE: CVE-2019-3823 + +Signed-off-by: Kevin Weng <t-keweng@microsoft.com> +--- + lib/smtp.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/lib/smtp.c b/lib/smtp.c +index ecf10a41a..1b9f92d30 100644 +--- a/lib/smtp.c ++++ b/lib/smtp.c +@@ -5,7 +5,7 @@ + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * +- * Copyright © 1998 – 2018, Daniel Stenberg, <daniel@haxx.se>, et al. ++ * Copyright © 1998 – 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -207,8 +207,12 @@ static bool smtp_endofresp(struct connectdata <strong>conn, char *line, size_t len, + Section 4. Examples of RFC-4954 but some e-mail servers ignore this and + only send the response code instead as per Section 4.2. */ + if(line[3] == ' ' || len == 5) { ++ char tmpline[6]; ++ + result = TRUE; +- *resp = curlx_sltosi(strtol(line, NULL, 10)); ++ memset(tmpline, ‘\0’, sizeof(tmpline)); ++ memcpy(tmpline, line, (len == 5 ? 5 : 3)); ++ *resp = curlx_sltosi(strtol(tmpline, NULL, 10)); + + /</strong> Make sure real server never sends internal value */ + if(*resp == 1) +-- +2.22.0 + 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 = "<a href="https://u12060237.ct.sendgrid.net/wf/click?upn=a3Po4i5toNpKG6uRFNTh8Mij1UJJ0s7eaefE5fjBvMpSFvFRqQNhCuPSRxSZtLzB_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FT1vYL7RdHUXx5bTSyf-2BcHR-2FH99gGD0yxa2eDYEjnkkZoD1Q-2BmgT4opZq5-2FiFTHajI9w7ddyyjuTK-2ByDmxxVRpu3toZ3MoQ2RZ7-2BlbDPmO25TsPZucV9ocAX-2FzRsy2Xji2s4X2mC04o1s7ZLGSSQDOZ18OklrWnj6T79ueMuEjSJhqfEjbHr6bGD-2FqUmdEa86">http://curl.haxx.se/download/curl-$</a>{PV}.tar.bz2 \</p>
<pre>file://CVE-2018-16842.patch \
file://CVE-2019-5435.patch \
file://CVE-2019-5436.patch \</pre>
<p>+ <a href="file://CVE-2018-16890.patch">file://CVE-2018-16890.patch</a> \ + <a href="file://CVE-2019-3822.patch">file://CVE-2019-3822.patch</a> \ + <a href="file://CVE-2019-3823.patch">file://CVE-2019-3823.patch</a> \</p>
<pre>"
SRC_URI[md5sum] = "31d0a9f48dc796a7db351898a1e5058a"</pre>
<p>— 2.22.0</p>
<img src="https://u12060237.ct.sendgrid.net/wf/open?upn=TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FT1vYL7RdHUXx5bTSyf-2BcHR-2FH99gGD0yxa2eDYEjnkkbF3N0T58QoqYjHR-2B4RBBGWvN9Jn2C5umu65lQgGOQDoCQzScGeU89FgWMa6QrgUvPavfyrP9NQ5aAz0JukbRr9UhBQzRkoR8NE8f0erz-2FgQOPY-2BcdK8mNbxmeT7QETM2mK-2F3Yf7-2BfhZ8ghFH1ENUb9" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>