aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/curl/patches/405-CVE-2019-3823.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2019-05-17 22:40:26 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2019-05-30 12:15:20 +0200
commitdc1b578a4cc1d7ec154a58baf3a813846c5adf9d (patch)
treee78010a927c172ef05b54d75bd178a451235a1bb /package/network/utils/curl/patches/405-CVE-2019-3823.patch
parent40ed8389efbb4011c83b6d343412a54634d0c731 (diff)
downloadupstream-dc1b578a4cc1d7ec154a58baf3a813846c5adf9d.tar.gz
upstream-dc1b578a4cc1d7ec154a58baf3a813846c5adf9d.tar.bz2
upstream-dc1b578a4cc1d7ec154a58baf3a813846c5adf9d.zip
curl: Fix multiple security problems
This fixes the following security problems: * CVE-2018-14618: NTLM password overflow via integer overflow * CVE-2018-16839: SASL password overflow via integer overflow * CVE-2018-16840: use-after-free in handle close * CVE-2018-16842: warning message out-of-buffer read * CVE-2019-3823: SMTP end-of-response out-of-bounds read * CVE-2019-3822: NTLMv2 type-3 header stack buffer overflow * CVE-2018-16890: NTLM type-2 out-of-bounds buffer read Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'package/network/utils/curl/patches/405-CVE-2019-3823.patch')
-rw-r--r--package/network/utils/curl/patches/405-CVE-2019-3823.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/package/network/utils/curl/patches/405-CVE-2019-3823.patch b/package/network/utils/curl/patches/405-CVE-2019-3823.patch
new file mode 100644
index 0000000000..58b0e1b599
--- /dev/null
+++ b/package/network/utils/curl/patches/405-CVE-2019-3823.patch
@@ -0,0 +1,42 @@
+From 39df4073e5413fcdbb5a38da0c1ce6f1c0ceb484 Mon Sep 17 00:00:00 2001
+From: Daniel Gustafsson <daniel@yesql.se>
+Date: Sat, 19 Jan 2019 00:42:47 +0100
+Subject: [PATCH] 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: https://curl.haxx.se/docs/CVE-2019-3823.html
+Reported-by: Brian Carpenter (Geeknik Labs)
+CVE-2019-3823
+---
+ lib/smtp.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/lib/smtp.c
++++ b/lib/smtp.c
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 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 connec
+ 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)