aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2019-03-05 08:31:19 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2019-03-05 08:40:08 +0000
commitd3a946561011a260c6b7a31fa0714a943e38cdfa (patch)
tree476f3caeeb36dd5edcf9251a2ae8e4dfc6ec1f18
parent07fc0a9367151053d9b6e8ab68fdb3c7501a4873 (diff)
downloadalpine_aports-d3a946561011a260c6b7a31fa0714a943e38cdfa.tar.bz2
alpine_aports-d3a946561011a260c6b7a31fa0714a943e38cdfa.tar.xz
alpine_aports-d3a946561011a260c6b7a31fa0714a943e38cdfa.zip
main/curl: security fixes
CVE-2018-16890, CVE-2019-3822, CVE-2019-3823 Fixes #9994
-rw-r--r--main/curl/APKBUILD14
-rw-r--r--main/curl/CVE-2018-16890.patch26
-rw-r--r--main/curl/CVE-2019-3822.patch35
-rw-r--r--main/curl/CVE-2019-3823.patch31
4 files changed, 104 insertions, 2 deletions
diff --git a/main/curl/APKBUILD b/main/curl/APKBUILD
index d13c3e072e..20dbf82626 100644
--- a/main/curl/APKBUILD
+++ b/main/curl/APKBUILD
@@ -4,7 +4,7 @@
4# Maintainer: Natanael Copa <ncopa@alpinelinux.org> 4# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
5pkgname=curl 5pkgname=curl
6pkgver=7.61.1 6pkgver=7.61.1
7pkgrel=1 7pkgrel=2
8pkgdesc="URL retrival utility and library" 8pkgdesc="URL retrival utility and library"
9url="https://curl.haxx.se" 9url="https://curl.haxx.se"
10arch="all" 10arch="all"
@@ -19,10 +19,17 @@ source="https://curl.haxx.se/download/$pkgname-$pkgver.tar.xz
19 CVE-2018-16839.patch 19 CVE-2018-16839.patch
20 CVE-2018-16840.patch 20 CVE-2018-16840.patch
21 CVE-2018-16842.patch 21 CVE-2018-16842.patch
22 CVE-2018-16890.patch
23 CVE-2019-3822.patch
24 CVE-2019-3823.patch
22 " 25 "
23builddir="$srcdir/$pkgname-$pkgver" 26builddir="$srcdir/$pkgname-$pkgver"
24 27
25# secfixes: 28# secfixes:
29# 7.61.1-r2:
30# - CVE-2018-16890
31# - CVE-2019-3822
32# - CVE-2019-3823
26# 7.61.1-r1: 33# 7.61.1-r1:
27# - CVE-2018-16839 34# - CVE-2018-16839
28# - CVE-2018-16840 35# - CVE-2018-16840
@@ -121,4 +128,7 @@ sha512sums="e6f82a7292c70841162480c8880d25046bcfa64058f4ff76f7d398c85da569af1c24
121708527e73f9512c50e2250ca26786ba8994dc05fd2e362c1feb274e251219fb4bfc97e7e7722aa12424ccaf4c511d90d8820561c82a24f103b9ee2b743f4be28 use-OPENSSL_config.patch 128708527e73f9512c50e2250ca26786ba8994dc05fd2e362c1feb274e251219fb4bfc97e7e7722aa12424ccaf4c511d90d8820561c82a24f103b9ee2b743f4be28 use-OPENSSL_config.patch
1224a28e4dcf36bf8e2fc5658d7fcee311d29452f4bed1479bad02772a8b7969c9dc653480b85715a5fe2bd2c2a8ae59e94fe72ffc6d0fe765131010d8f64bdfaee CVE-2018-16839.patch 1294a28e4dcf36bf8e2fc5658d7fcee311d29452f4bed1479bad02772a8b7969c9dc653480b85715a5fe2bd2c2a8ae59e94fe72ffc6d0fe765131010d8f64bdfaee CVE-2018-16839.patch
123c1a684f17267b08f77625064ac62e4f06989c552d6d501565f8bebf31d3a96a613f0683376ec7cc16f6489554dcca4dcb1d428461159b82434c076df44ef5b38 CVE-2018-16840.patch 130c1a684f17267b08f77625064ac62e4f06989c552d6d501565f8bebf31d3a96a613f0683376ec7cc16f6489554dcca4dcb1d428461159b82434c076df44ef5b38 CVE-2018-16840.patch
124dcaca036eafaaae66eba99808d00ff6bed3c9e59c2c1239ca1ddcf54c9e1c53edabd543dc6925ded3cdf9efd39c0968353527ae5ed0b986cefba333fbc7fd1af CVE-2018-16842.patch" 131dcaca036eafaaae66eba99808d00ff6bed3c9e59c2c1239ca1ddcf54c9e1c53edabd543dc6925ded3cdf9efd39c0968353527ae5ed0b986cefba333fbc7fd1af CVE-2018-16842.patch
132573b896bd78e404002398bdf38d952ec6247af551ef7d6e34d52acbf004f8f4de60299e3a8f83be75e22dfb8731e466aea0253efec7116282afab32dbb1f66e8 CVE-2018-16890.patch
133959a55237752b254bc5f58308607f3cf0475e207a7400ff6be7942c48131787f1dec4c05be5b76865ae0adf81ebae77774085ad0c19dd342fb0307cfcfe24b6c CVE-2019-3822.patch
13473f0d06f9bbd6f0688e67310120d1e806752626c103b0a52bc4b4a1a77bbe248885778f39386fbfc38cb534cd12d18f205c091769558e6a04b50010cb9ba6a69 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 @@
1From a54ba07a3a01f21de64ecabaafcc01b40b9db5a4 Mon Sep 17 00:00:00 2001
2From: Daniel Stenberg <daniel@haxx.se>
3Date: Wed, 2 Jan 2019 20:33:08 +0100
4Subject: [PATCH 1/3] NTLM: fix size check condition for type2 received data
5
6Reported-by: Wenxiang Qian
7---
8 lib/vauth/ntlm.c | 7 ++++---
9 1 file changed, 4 insertions(+), 3 deletions(-)
10
11--- a/lib/vauth/ntlm.c
12+++ b/lib/vauth/ntlm.c
13@@ -180,10 +180,11 @@
14 target_info_len = Curl_read16_le(&buffer[40]);
15 target_info_offset = Curl_read32_le(&buffer[44]);
16 if(target_info_len > 0) {
17- if(((target_info_offset + target_info_len) > size) ||
18+ if((target_info_offset >= size) ||
19+ ((target_info_offset + target_info_len) > size) ||
20 (target_info_offset < 48)) {
21 infof(data, "NTLM handshake failure (bad type-2 message). "
22- "Target Info Offset Len is set incorrect by the peer\n");
23+ "Target Info Offset Len is set incorrect by the peer\n");
24 return CURLE_BAD_CONTENT_ENCODING;
25 }
26
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 @@
1From 50c9484278c63b958655a717844f0721263939cc Mon Sep 17 00:00:00 2001
2From: Daniel Stenberg <daniel@haxx.se>
3Date: Thu, 3 Jan 2019 12:59:28 +0100
4Subject: [PATCH] ntlm: fix *_type3_message size check to avoid buffer overflow
5
6Bug: https://curl.haxx.se/docs/CVE-2019-3822.html
7Reported-by: Wenxiang Qian
8CVE-2019-3822
9---
10 lib/vauth/ntlm.c | 11 +++++++----
11 1 file changed, 7 insertions(+), 4 deletions(-)
12
13diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c
14index 0ad4d972e3..6a8fc5ab3d 100644
15--- a/lib/vauth/ntlm.c
16+++ b/lib/vauth/ntlm.c
17@@ -779,11 +779,14 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
18 });
19
20 #ifdef USE_NTRESPONSES
21- if(size < (NTLM_BUFSIZE - ntresplen)) {
22- DEBUGASSERT(size == (size_t)ntrespoff);
23- memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen);
24- size += ntresplen;
25+ /* ntresplen + size should not be risking an integer overflow here */
26+ if(ntresplen + size > sizeof(ntlmbuf)) {
27+ failf(data, "incoming NTLM message too big");
28+ return CURLE_OUT_OF_MEMORY;
29 }
30+ DEBUGASSERT(size == (size_t)ntrespoff);
31+ memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen);
32+ size += ntresplen;
33
34 DEBUG_OUT({
35 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 @@
1From 89dd3f49e1248d7f39401ecc9eecb4e82885e629 Mon Sep 17 00:00:00 2001
2From: Daniel Gustafsson <daniel@yesql.se>
3Date: Sat, 19 Jan 2019 00:42:47 +0100
4Subject: [PATCH 3/3] smtp: avoid risk of buffer overflow in strtol
5
6If the incoming len 5, but the buffer does not have a termination
7after 5 bytes, the strtol() call may keep reading through the line
8buffer until is exceeds its boundary. Fix by ensuring that we are
9using a bounded read with a temporary buffer on the stack.
10
11Reported-by: Brian Carpenter (Geeknik Labs)
12---
13 lib/smtp.c | 8 ++++++--
14 1 file changed, 6 insertions(+), 2 deletions(-)
15
16--- a/lib/smtp.c
17+++ b/lib/smtp.c
18@@ -255,8 +255,12 @@
19 Section 4. Examples of RFC-4954 but some e-mail servers ignore this and
20 only send the response code instead as per Section 4.2. */
21 if(line[3] == ' ' || len == 5) {
22+ char tmpline[6];
23+
24 result = TRUE;
25- *resp = curlx_sltosi(strtol(line, NULL, 10));
26+ memset(tmpline, '\0', sizeof(tmpline));
27+ memcpy(tmpline, line, (len == 5 ? 5 : 3));
28+ *resp = curlx_sltosi(strtol(tmpline, NULL, 10));
29
30 /* Make sure real server never sends internal value */
31 if(*resp == 1)