[pkg-wpa-devel] r1961 - in /wpa/tags/1.0-3+deb7u3/debian: ./ patches/ patches/2015-2/ patches/2015-3/ patches/2015-4/ patches/2015-5/

slh-guest at users.alioth.debian.org slh-guest at users.alioth.debian.org
Mon Nov 23 02:40:59 UTC 2015


Author: slh-guest
Date: Mon Nov 23 02:40:58 2015
New Revision: 1961

URL: http://svn.debian.org/wsvn/?sc=1&rev=1961
Log:
* Non-maintainer upload by the Security Team.
* Add patch to address CVE-2015-4141.
  CVE-2015-4141: WPS UPnP vulnerability with HTTP chunked transfer
  encoding. (Closes: #787372)
* Add patch to address CVE-2015-4142.
  CVE-2015-4142: Integer underflow in AP mode WMM Action frame processing.
  (Closes: #787373)
* Add patches to address CVE-2015-4143.
  CVE-2015-4143: EAP-pwd missing payload length validation. (Closes: #787371)
* Add patch to address 2015-5 vulnerability.
  NFC: Fix payload length validation in NDEF record parser.
  Note that this issue does not affect the binary packages distributed in
  Debian in Wheezy as CONFIG_WPS_NFC=y is not set in the build
  configuration. (Closes: #795740)

Added:
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-2/
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-2/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-3/
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-3/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-5/
    wpa/tags/1.0-3+deb7u3/debian/patches/2015-5/0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch
Modified:
    wpa/tags/1.0-3+deb7u3/debian/changelog
    wpa/tags/1.0-3+deb7u3/debian/patches/series

Modified: wpa/tags/1.0-3+deb7u3/debian/changelog
URL: http://svn.debian.org/wsvn/wpa/tags/1.0-3%2Bdeb7u3/debian/changelog?rev=1961&op=diff
==============================================================================
--- wpa/tags/1.0-3+deb7u3/debian/changelog	(original)
+++ wpa/tags/1.0-3+deb7u3/debian/changelog	Mon Nov 23 02:40:58 2015
@@ -1,3 +1,22 @@
+wpa (1.0-3+deb7u3) wheezy-security; urgency=high
+
+  * Non-maintainer upload by the Security Team.
+  * Add patch to address CVE-2015-4141.
+    CVE-2015-4141: WPS UPnP vulnerability with HTTP chunked transfer
+    encoding. (Closes: #787372)
+  * Add patch to address CVE-2015-4142.
+    CVE-2015-4142: Integer underflow in AP mode WMM Action frame processing.
+    (Closes: #787373)
+  * Add patches to address CVE-2015-4143.
+    CVE-2015-4143: EAP-pwd missing payload length validation. (Closes: #787371)
+  * Add patch to address 2015-5 vulnerability.
+    NFC: Fix payload length validation in NDEF record parser.
+    Note that this issue does not affect the binary packages distributed in
+    Debian in Wheezy as CONFIG_WPS_NFC=y is not set in the build
+    configuration. (Closes: #795740)
+
+ -- Salvatore Bonaccorso <carnil at debian.org>  Sat, 31 Oct 2015 12:08:04 +0100
+
 wpa (1.0-3+deb7u2) wheezy-security; urgency=high
 
   * import "P2P: Validate SSID element length before copying it

Added: wpa/tags/1.0-3+deb7u3/debian/patches/2015-2/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
URL: http://svn.debian.org/wsvn/wpa/tags/1.0-3%2Bdeb7u3/debian/patches/2015-2/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch?rev=1961&op=file
==============================================================================
--- wpa/tags/1.0-3+deb7u3/debian/patches/2015-2/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch	(added)
+++ wpa/tags/1.0-3+deb7u3/debian/patches/2015-2/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch	Mon Nov 23 02:40:58 2015
@@ -0,0 +1,49 @@
+From 5acd23f4581da58683f3cf5e36cb71bbe4070bd7 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Tue, 28 Apr 2015 17:08:33 +0300
+Subject: [PATCH] WPS: Fix HTTP chunked transfer encoding parser
+
+strtoul() return value may end up overflowing the int h->chunk_size and
+resulting in a negative value to be stored as the chunk_size. This could
+result in the following memcpy operation using a very large length
+argument which would result in a buffer overflow and segmentation fault.
+
+This could have been used to cause a denial service by any device that
+has been authorized for network access (either wireless or wired). This
+would affect both the WPS UPnP functionality in a WPS AP (hostapd with
+upnp_iface parameter set in the configuration) and WPS ER
+(wpa_supplicant with WPS_ER_START control interface command used).
+
+Validate the parsed chunk length value to avoid this. In addition to
+rejecting negative values, we can also reject chunk size that would be
+larger than the maximum configured body length.
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ src/wps/httpread.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/wps/httpread.c b/src/wps/httpread.c
+index 2f08f37..d2855e3 100644
+--- a/src/wps/httpread.c
++++ b/src/wps/httpread.c
+@@ -533,6 +533,13 @@ static void httpread_read_handler(int sd, void *eloop_ctx, void *sock_ctx)
+ 					if (!isxdigit(*cbp))
+ 						goto bad;
+ 					h->chunk_size = strtoul(cbp, NULL, 16);
++					if (h->chunk_size < 0 ||
++					    h->chunk_size > h->max_bytes) {
++						wpa_printf(MSG_DEBUG,
++							   "httpread: Invalid chunk size %d",
++							   h->chunk_size);
++						goto bad;
++					}
+ 					/* throw away chunk header
+ 					 * so we have only real data
+ 					 */
+-- 
+1.9.1
+

Added: wpa/tags/1.0-3+deb7u3/debian/patches/2015-3/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch
URL: http://svn.debian.org/wsvn/wpa/tags/1.0-3%2Bdeb7u3/debian/patches/2015-3/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch?rev=1961&op=file
==============================================================================
--- wpa/tags/1.0-3+deb7u3/debian/patches/2015-3/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch	(added)
+++ wpa/tags/1.0-3+deb7u3/debian/patches/2015-3/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch	Mon Nov 23 02:40:58 2015
@@ -0,0 +1,41 @@
+From ef566a4d4f74022e1fdb0a2addfe81e6de9f4aae Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Wed, 29 Apr 2015 02:21:53 +0300
+Subject: [PATCH] AP WMM: Fix integer underflow in WMM Action frame parser
+
+The length of the WMM Action frame was not properly validated and the
+length of the information elements (int left) could end up being
+negative. This would result in reading significantly past the stack
+buffer while parsing the IEs in ieee802_11_parse_elems() and while doing
+so, resulting in segmentation fault.
+
+This can result in an invalid frame being used for a denial of service
+attack (hostapd process killed) against an AP with a driver that uses
+hostapd for management frame processing (e.g., all mac80211-based
+drivers).
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ src/ap/wmm.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/ap/wmm.c b/src/ap/wmm.c
+index 6d4177c..314e244 100644
+--- a/src/ap/wmm.c
++++ b/src/ap/wmm.c
+@@ -274,6 +274,9 @@ void hostapd_wmm_action(struct hostapd_data *hapd,
+ 		return;
+ 	}
+ 
++	if (left < 0)
++		return; /* not a valid WMM Action frame */
++
+ 	/* extract the tspec info element */
+ 	if (ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) {
+ 		hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
+-- 
+1.9.1
+

Added: wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch
URL: http://svn.debian.org/wsvn/wpa/tags/1.0-3%2Bdeb7u3/debian/patches/2015-4/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch?rev=1961&op=file
==============================================================================
--- wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch	(added)
+++ wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch	Mon Nov 23 02:40:58 2015
@@ -0,0 +1,76 @@
+From dd2f043c9c43d156494e33d7ce22db96e6ef42c7 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Fri, 1 May 2015 16:37:45 +0300
+Subject: [PATCH 1/5] EAP-pwd peer: Fix payload length validation for Commit
+ and Confirm
+
+The length of the received Commit and Confirm message payloads was not
+checked before reading them. This could result in a buffer read
+overflow when processing an invalid message.
+
+Fix this by verifying that the payload is of expected length before
+processing it. In addition, enforce correct state transition sequence to
+make sure there is no unexpected behavior if receiving a Commit/Confirm
+message before the previous exchanges have been completed.
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ src/eap_peer/eap_pwd.c | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+--- a/src/eap_peer/eap_pwd.c
++++ b/src/eap_peer/eap_pwd.c
+@@ -15,6 +15,7 @@
+ #include "includes.h"
+ 
+ #include "common.h"
++#include "crypto/sha256.h"
+ #include "eap_peer/eap_i.h"
+ #include "eap_common/eap_pwd_common.h"
+ 
+@@ -265,6 +266,23 @@ eap_pwd_perform_commit_exchange(struct e
+ 	BIGNUM *mask = NULL, *x = NULL, *y = NULL, *cofactor = NULL;
+ 	u16 offset;
+ 	u8 *ptr, *scalar = NULL, *element = NULL;
++	size_t prime_len, order_len;
++
++	if (data->state != PWD_Commit_Req) {
++		ret->ignore = TRUE;
++		goto fin;
++	}
++
++	prime_len = BN_num_bytes(data->grp->prime);
++	order_len = BN_num_bytes(data->grp->order);
++
++	if (payload_len != 2 * prime_len + order_len) {
++		wpa_printf(MSG_INFO,
++			   "EAP-pwd: Unexpected Commit payload length %u (expected %u)",
++			   (unsigned int) payload_len,
++			   (unsigned int) (2 * prime_len + order_len));
++		goto fin;
++	}
+ 
+ 	if (((data->private_value = BN_new()) == NULL) ||
+ 	    ((data->my_element = EC_POINT_new(data->grp->group)) == NULL) ||
+@@ -467,6 +485,18 @@ eap_pwd_perform_confirm_exchange(struct
+ 	u8 conf[SHA256_DIGEST_LENGTH], *cruft = NULL, *ptr;
+ 	int offset;
+ 
++	if (data->state != PWD_Confirm_Req) {
++		ret->ignore = TRUE;
++		goto fin;
++	}
++
++	if (payload_len != SHA256_MAC_LEN) {
++		wpa_printf(MSG_INFO,
++			   "EAP-pwd: Unexpected Confirm payload length %u (expected %u)",
++			   (unsigned int) payload_len, SHA256_MAC_LEN);
++		goto fin;
++	}
++
+ 	/*
+ 	 * first build up the ciphersuite which is group | random_function |
+ 	 *	prf

Added: wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch
URL: http://svn.debian.org/wsvn/wpa/tags/1.0-3%2Bdeb7u3/debian/patches/2015-4/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch?rev=1961&op=file
==============================================================================
--- wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch	(added)
+++ wpa/tags/1.0-3+deb7u3/debian/patches/2015-4/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch	Mon Nov 23 02:40:58 2015
@@ -0,0 +1,69 @@
+From e28a58be26184c2a23f80b410e0997ef1bd5d578 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Fri, 1 May 2015 16:40:44 +0300
+Subject: [PATCH 2/5] EAP-pwd server: Fix payload length validation for Commit
+ and Confirm
+
+The length of the received Commit and Confirm message payloads was not
+checked before reading them. This could result in a buffer read
+overflow when processing an invalid message.
+
+Fix this by verifying that the payload is of expected length before
+processing it. In addition, enforce correct state transition sequence to
+make sure there is no unexpected behavior if receiving a Commit/Confirm
+message before the previous exchanges have been completed.
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ src/eap_server/eap_server_pwd.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+--- a/src/eap_server/eap_server_pwd.c
++++ b/src/eap_server/eap_server_pwd.c
+@@ -15,6 +15,7 @@
+ #include "includes.h"
+ 
+ #include "common.h"
++#include "crypto/sha256.h"
+ #include "eap_server/eap_i.h"
+ #include "eap_common/eap_pwd_common.h"
+ 
+@@ -518,9 +519,21 @@ eap_pwd_process_commit_resp(struct eap_s
+ 	BIGNUM *x = NULL, *y = NULL, *cofactor = NULL;
+ 	EC_POINT *K = NULL, *point = NULL;
+ 	int res = 0;
++	size_t prime_len, order_len;
+ 
+ 	wpa_printf(MSG_DEBUG, "EAP-pwd: Received commit response");
+ 
++	prime_len = BN_num_bytes(data->grp->prime);
++	order_len = BN_num_bytes(data->grp->order);
++
++	if (payload_len != 2 * prime_len + order_len) {
++		wpa_printf(MSG_INFO,
++			   "EAP-pwd: Unexpected Commit payload length %u (expected %u)",
++			   (unsigned int) payload_len,
++			   (unsigned int) (2 * prime_len + order_len));
++		goto fin;
++	}
++
+ 	if (((data->peer_scalar = BN_new()) == NULL) ||
+ 	    ((data->k = BN_new()) == NULL) ||
+ 	    ((cofactor = BN_new()) == NULL) ||
+@@ -636,6 +649,13 @@ eap_pwd_process_confirm_resp(struct eap_
+ 	u8 conf[SHA256_DIGEST_LENGTH], *cruft = NULL, *ptr;
+ 	int offset;
+ 
++	if (payload_len != SHA256_MAC_LEN) {
++		wpa_printf(MSG_INFO,
++			   "EAP-pwd: Unexpected Confirm payload length %u (expected %u)",
++			   (unsigned int) payload_len, SHA256_MAC_LEN);
++		goto fin;
++	}
++
+ 	/* build up the ciphersuite: group | random_function | prf */
+ 	grp = htons(data->group_num);
+ 	ptr = (u8 *) &cs;

Added: wpa/tags/1.0-3+deb7u3/debian/patches/2015-5/0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch
URL: http://svn.debian.org/wsvn/wpa/tags/1.0-3%2Bdeb7u3/debian/patches/2015-5/0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch?rev=1961&op=file
==============================================================================
--- wpa/tags/1.0-3+deb7u3/debian/patches/2015-5/0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch	(added)
+++ wpa/tags/1.0-3+deb7u3/debian/patches/2015-5/0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch	Mon Nov 23 02:40:58 2015
@@ -0,0 +1,56 @@
+From df9079e72760ceb7ebe7fb11538200c516bdd886 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Tue, 7 Jul 2015 21:57:28 +0300
+Subject: [PATCH] NFC: Fix payload length validation in NDEF record parser
+
+It was possible for the 32-bit record->total_length value to end up
+wrapping around due to integer overflow if the longer form of payload
+length field is used and record->payload_length gets a value close to
+2^32. This could result in ndef_parse_record() accepting a too large
+payload length value and the record type filter reading up to about 20
+bytes beyond the end of the buffer and potentially killing the process.
+This could also result in an attempt to allocate close to 2^32 bytes of
+heap memory and if that were to succeed, a buffer read overflow of the
+same length which would most likely result in the process termination.
+In case of record->total_length ending up getting the value 0, there
+would be no buffer read overflow, but record parsing would result in an
+infinite loop in ndef_parse_records().
+
+Any of these error cases could potentially be used for denial of service
+attacks over NFC by using a malformed NDEF record on an NFC Tag or
+sending them during NFC connection handover if the application providing
+the NDEF message to hostapd/wpa_supplicant did no validation of the
+received records. While such validation is likely done in the NFC stack
+that needs to parse the NFC messages before further processing,
+hostapd/wpa_supplicant better be prepared for any data being included
+here.
+
+Fix this by validating record->payload_length value in a way that
+detects integer overflow. (CID 122668)
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ src/wps/ndef.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/src/wps/ndef.c
++++ b/src/wps/ndef.c
+@@ -52,6 +52,8 @@ static int ndef_parse_record(u8 *data, u
+ 		if (size < 6)
+ 			return -1;
+ 		record->payload_length = ntohl(*(u32 *)pos);
++		if (record->payload_length > size - 6)
++			return -1;
+ 		pos += sizeof(u32);
+ 	}
+ 
+@@ -72,7 +74,8 @@ static int ndef_parse_record(u8 *data, u
+ 	pos += record->payload_length;
+ 
+ 	record->total_length = pos - data;
+-	if (record->total_length > size)
++	if (record->total_length > size ||
++	    record->total_length < record->payload_length)
+ 		return -1;
+ 	return 0;
+ }

Modified: wpa/tags/1.0-3+deb7u3/debian/patches/series
URL: http://svn.debian.org/wsvn/wpa/tags/1.0-3%2Bdeb7u3/debian/patches/series?rev=1961&op=diff
==============================================================================
--- wpa/tags/1.0-3+deb7u3/debian/patches/series	(original)
+++ wpa/tags/1.0-3+deb7u3/debian/patches/series	Mon Nov 23 02:40:58 2015
@@ -11,3 +11,8 @@
 CVE-2014-3686/0002-wpa_cli-Use-os_exec-for-action-script-execution.patch
 CVE-2014-3686/0003-hostapd_cli-Use-os_exec-for-action-script-execution.patch
 wpasupplicant_P2P-Validate-SSID-element-length-before-copying-it-C.patch
+2015-2/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
+2015-3/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch
+2015-4/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch
+2015-4/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch
+2015-5/0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch




More information about the Pkg-wpa-devel mailing list