mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 07:22:33 +00:00
dc1b578a4c
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>
38 lines
1.5 KiB
Diff
38 lines
1.5 KiB
Diff
From b780b30d1377adb10bbe774835f49e9b237fb9bb Mon Sep 17 00:00:00 2001
|
|
From: Daniel Stenberg <daniel@haxx.se>
|
|
Date: Wed, 2 Jan 2019 20:33:08 +0100
|
|
Subject: [PATCH] NTLM: fix size check condition for type2 received data
|
|
|
|
Bug: https://curl.haxx.se/docs/CVE-2018-16890.html
|
|
Reported-by: Wenxiang Qian
|
|
CVE-2018-16890
|
|
---
|
|
lib/vauth/ntlm.c | 7 ++++---
|
|
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
|
--- a/lib/vauth/ntlm.c
|
|
+++ b/lib/vauth/ntlm.c
|
|
@@ -5,7 +5,7 @@
|
|
* | (__| |_| | _ <| |___
|
|
* \___|\___/|_| \_\_____|
|
|
*
|
|
- * Copyright (C) 1998 - 2017, 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
|
|
@@ -182,10 +182,11 @@ static CURLcode ntlm_decode_type2_target
|
|
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;
|
|
}
|
|
|