]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use
authorJouni Malinen <j@w1.fi>
Sun, 25 Oct 2015 13:45:50 +0000 (15:45 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 10 Nov 2015 16:40:54 +0000 (18:40 +0200)
WNM Sleep Mode Response frame is used to update GTK/IGTK only if PMF is
enabled. Verify that PMF is in use before using this field on station
side to avoid accepting unauthenticated key updates. (CVE-2015-5310)

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wnm_sta.c

index 3b45bf632fdbea8b29a941c53283733b52fb0742..9ab40c782d7f8d22cd511216d3bec041d73dab43 100644 (file)
@@ -189,6 +189,12 @@ static void wnm_sleep_mode_exit_success(struct wpa_supplicant *wpa_s,
        end = ptr + key_len_total;
        wpa_hexdump_key(MSG_DEBUG, "WNM: Key Data", ptr, key_len_total);
 
+       if (key_len_total && !wpa_sm_pmf_enabled(wpa_s->wpa)) {
+               wpa_msg(wpa_s, MSG_INFO,
+                       "WNM: Ignore Key Data in WNM-Sleep Mode Response - PMF not enabled");
+               return;
+       }
+
        while (end - ptr > 1) {
                if (2 + ptr[1] > end - ptr) {
                        wpa_printf(MSG_DEBUG, "WNM: Invalid Key Data element "