aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/curl/patches/114-CVE-2018-1000301.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2018-08-10 21:39:06 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2018-08-10 22:56:31 +0200
commit9bc43f3e65bc8e0bb3d0c5ea8ff906111197afb9 (patch)
tree6c855135e0208b15092012d4c86363d19de846f6 /package/network/utils/curl/patches/114-CVE-2018-1000301.patch
parentb3983323a1f25c936ddfcc129c454b282e90eeed (diff)
downloadupstream-9bc43f3e65bc8e0bb3d0c5ea8ff906111197afb9.tar.gz
upstream-9bc43f3e65bc8e0bb3d0c5ea8ff906111197afb9.tar.bz2
upstream-9bc43f3e65bc8e0bb3d0c5ea8ff906111197afb9.zip
curl: fix some security problems
This fixes the following security problems: * CVE-2017-1000254: FTP PWD response parser out of bounds read * CVE-2017-1000257: IMAP FETCH response out of bounds read * CVE-2018-1000005: HTTP/2 trailer out-of-bounds read * CVE-2018-1000007: HTTP authentication leak in redirects * CVE-2018-1000120: FTP path trickery leads to NIL byte out of bounds write * CVE-2018-1000121: LDAP NULL pointer dereference * CVE-2018-1000122: RTSP RTP buffer over-read * CVE-2018-1000301: RTSP bad headers buffer over-read Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'package/network/utils/curl/patches/114-CVE-2018-1000301.patch')
-rw-r--r--package/network/utils/curl/patches/114-CVE-2018-1000301.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/package/network/utils/curl/patches/114-CVE-2018-1000301.patch b/package/network/utils/curl/patches/114-CVE-2018-1000301.patch
new file mode 100644
index 0000000000..993c985060
--- /dev/null
+++ b/package/network/utils/curl/patches/114-CVE-2018-1000301.patch
@@ -0,0 +1,39 @@
+From 8c7b3737d29ed5c0575bf592063de8a51450812d Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Sat, 24 Mar 2018 23:47:41 +0100
+Subject: [PATCH] http: restore buffer pointer when bad response-line is parsed
+
+... leaving the k->str could lead to buffer over-reads later on.
+
+CVE: CVE-2018-1000301
+Assisted-by: Max Dymond
+
+Detected by OSS-Fuzz.
+Bug: https://curl.haxx.se/docs/adv_2018-b138.html
+Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7105
+---
+ lib/http.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/lib/http.c
++++ b/lib/http.c
+@@ -2924,6 +2924,8 @@ CURLcode Curl_http_readwrite_headers(str
+ {
+ CURLcode result;
+ struct SingleRequest *k = &data->req;
++ ssize_t onread = *nread;
++ char *ostr = k->str;
+
+ /* header line within buffer loop */
+ do {
+@@ -2988,7 +2990,9 @@ CURLcode Curl_http_readwrite_headers(str
+ else {
+ /* this was all we read so it's all a bad header */
+ k->badheader = HEADER_ALLBAD;
+- *nread = (ssize_t)rest_length;
++ *nread = onread;
++ k->str = ostr;
++ return CURLE_OK;
+ }
+ break;
+ }