diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2019-03-05 08:31:19 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2019-03-05 08:31:19 +0000 |
commit | 5ba18f0ca5e2e4f2371cf806a531c993d2b9689b (patch) | |
tree | 4f89d424090d26ee56bd5ee120d471363b5fa4a0 | |
parent | b8900ad55b74d12382103f2da89b3d11fb538003 (diff) | |
download | aports-5ba18f0ca5e2e4f2371cf806a531c993d2b9689b.tar.bz2 aports-5ba18f0ca5e2e4f2371cf806a531c993d2b9689b.tar.xz |
main/curl: security fixes
-rw-r--r-- | main/curl/APKBUILD | 14 | ||||
-rw-r--r-- | main/curl/CVE-2018-16890.patch | 26 | ||||
-rw-r--r-- | main/curl/CVE-2019-3822.patch | 35 | ||||
-rw-r--r-- | main/curl/CVE-2019-3823.patch | 31 |
4 files changed, 104 insertions, 2 deletions
diff --git a/main/curl/APKBUILD b/main/curl/APKBUILD index 64776ac480..9c805f3588 100644 --- a/main/curl/APKBUILD +++ b/main/curl/APKBUILD @@ -4,7 +4,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=curl pkgver=7.61.1 -pkgrel=1 +pkgrel=2 pkgdesc="URL retrival utility and library" url="https://curl.haxx.se" arch="all" @@ -20,10 +20,17 @@ source="https://curl.haxx.se/download/$pkgname-$pkgver.tar.xz CVE-2018-16839.patch CVE-2018-16840.patch CVE-2018-16842.patch + CVE-2018-16890.patch + CVE-2019-3822.patch + CVE-2019-3823.patch " builddir="$srcdir/$pkgname-$pkgver" # secfixes: +# 7.61.1-r2: +# - CVE-2018-16890 +# - CVE-2019-3822 +# - CVE-2019-3823 # 7.61.1-r1: # - CVE-2018-16839 # - CVE-2018-16840 @@ -121,4 +128,7 @@ sha512sums="e6f82a7292c70841162480c8880d25046bcfa64058f4ff76f7d398c85da569af1c24 708527e73f9512c50e2250ca26786ba8994dc05fd2e362c1feb274e251219fb4bfc97e7e7722aa12424ccaf4c511d90d8820561c82a24f103b9ee2b743f4be28 use-OPENSSL_config.patch 4a28e4dcf36bf8e2fc5658d7fcee311d29452f4bed1479bad02772a8b7969c9dc653480b85715a5fe2bd2c2a8ae59e94fe72ffc6d0fe765131010d8f64bdfaee CVE-2018-16839.patch c1a684f17267b08f77625064ac62e4f06989c552d6d501565f8bebf31d3a96a613f0683376ec7cc16f6489554dcca4dcb1d428461159b82434c076df44ef5b38 CVE-2018-16840.patch -dcaca036eafaaae66eba99808d00ff6bed3c9e59c2c1239ca1ddcf54c9e1c53edabd543dc6925ded3cdf9efd39c0968353527ae5ed0b986cefba333fbc7fd1af CVE-2018-16842.patch" +dcaca036eafaaae66eba99808d00ff6bed3c9e59c2c1239ca1ddcf54c9e1c53edabd543dc6925ded3cdf9efd39c0968353527ae5ed0b986cefba333fbc7fd1af CVE-2018-16842.patch +573b896bd78e404002398bdf38d952ec6247af551ef7d6e34d52acbf004f8f4de60299e3a8f83be75e22dfb8731e466aea0253efec7116282afab32dbb1f66e8 CVE-2018-16890.patch +959a55237752b254bc5f58308607f3cf0475e207a7400ff6be7942c48131787f1dec4c05be5b76865ae0adf81ebae77774085ad0c19dd342fb0307cfcfe24b6c CVE-2019-3822.patch +73f0d06f9bbd6f0688e67310120d1e806752626c103b0a52bc4b4a1a77bbe248885778f39386fbfc38cb534cd12d18f205c091769558e6a04b50010cb9ba6a69 CVE-2019-3823.patch" diff --git a/main/curl/CVE-2018-16890.patch b/main/curl/CVE-2018-16890.patch new file mode 100644 index 0000000000..9509c14058 --- /dev/null +++ b/main/curl/CVE-2018-16890.patch @@ -0,0 +1,26 @@ +From a54ba07a3a01f21de64ecabaafcc01b40b9db5a4 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 + +Reported-by: Wenxiang Qian +--- + lib/vauth/ntlm.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/lib/vauth/ntlm.c ++++ b/lib/vauth/ntlm.c +@@ -180,10 +180,11 @@ + 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; + } + diff --git a/main/curl/CVE-2019-3822.patch b/main/curl/CVE-2019-3822.patch new file mode 100644 index 0000000000..938926b1d3 --- /dev/null +++ b/main/curl/CVE-2019-3822.patch @@ -0,0 +1,35 @@ +From 50c9484278c63b958655a717844f0721263939cc Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg <daniel@haxx.se> +Date: Thu, 3 Jan 2019 12:59:28 +0100 +Subject: [PATCH] ntlm: fix *_type3_message size check to avoid buffer overflow + +Bug: https://curl.haxx.se/docs/CVE-2019-3822.html +Reported-by: Wenxiang Qian +CVE-2019-3822 +--- + 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 0ad4d972e3..6a8fc5ab3d 100644 +--- a/lib/vauth/ntlm.c ++++ b/lib/vauth/ntlm.c +@@ -779,11 +779,14 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, + }); + + #ifdef USE_NTRESPONSES +- if(size < (NTLM_BUFSIZE - ntresplen)) { +- DEBUGASSERT(size == (size_t)ntrespoff); +- memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen); +- size += ntresplen; ++ /* 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="); diff --git a/main/curl/CVE-2019-3823.patch b/main/curl/CVE-2019-3823.patch new file mode 100644 index 0000000000..0023b9b0b3 --- /dev/null +++ b/main/curl/CVE-2019-3823.patch @@ -0,0 +1,31 @@ +From 89dd3f49e1248d7f39401ecc9eecb4e82885e629 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. + +Reported-by: Brian Carpenter (Geeknik Labs) +--- + lib/smtp.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/lib/smtp.c ++++ b/lib/smtp.c +@@ -255,8 +255,12 @@ + 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)); + + /* Make sure real server never sends internal value */ + if(*resp == 1) |