|
|
f036d1 |
From 81c0e81531623251a0e78f7779c049f530abe733 Mon Sep 17 00:00:00 2001
|
|
|
f036d1 |
From: Daniel Stenberg <daniel@haxx.se>
|
|
|
f036d1 |
Date: Wed, 2 Jan 2019 20:33:08 +0100
|
|
|
f036d1 |
Subject: [PATCH] NTLM: fix size check condition for type2 received data
|
|
|
f036d1 |
|
|
|
f036d1 |
Bug: https://curl.haxx.se/docs/CVE-2018-16890.html
|
|
|
f036d1 |
Reported-by: Wenxiang Qian
|
|
|
f036d1 |
CVE-2018-16890
|
|
|
f036d1 |
|
|
|
f036d1 |
Upstream-commit: b780b30d1377adb10bbe774835f49e9b237fb9bb
|
|
|
f036d1 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
f036d1 |
---
|
|
|
f036d1 |
lib/vauth/ntlm.c | 5 +++--
|
|
|
f036d1 |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
f036d1 |
|
|
|
f036d1 |
diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c
|
|
|
f036d1 |
index cdb8d8f..b614cda 100644
|
|
|
f036d1 |
--- a/lib/vauth/ntlm.c
|
|
|
f036d1 |
+++ b/lib/vauth/ntlm.c
|
|
|
f036d1 |
@@ -182,10 +182,11 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data,
|
|
|
f036d1 |
target_info_len = Curl_read16_le(&buffer[40]);
|
|
|
f036d1 |
target_info_offset = Curl_read32_le(&buffer[44]);
|
|
|
f036d1 |
if(target_info_len > 0) {
|
|
|
f036d1 |
- if(((target_info_offset + target_info_len) > size) ||
|
|
|
f036d1 |
+ if((target_info_offset >= size) ||
|
|
|
f036d1 |
+ ((target_info_offset + target_info_len) > size) ||
|
|
|
f036d1 |
(target_info_offset < 48)) {
|
|
|
f036d1 |
infof(data, "NTLM handshake failure (bad type-2 message). "
|
|
|
f036d1 |
- "Target Info Offset Len is set incorrect by the peer\n");
|
|
|
f036d1 |
+ "Target Info Offset Len is set incorrect by the peer\n");
|
|
|
f036d1 |
return CURLE_BAD_CONTENT_ENCODING;
|
|
|
f036d1 |
}
|
|
|
f036d1 |
|
|
|
f036d1 |
--
|
|
|
f036d1 |
2.17.2
|
|
|
f036d1 |
|