diff options
3 files changed, 92 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd/0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch b/meta-oe/recipes-connectivity/hostapd/hostapd/0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch new file mode 100644 index 0000000000..5780f27f8b --- /dev/null +++ b/meta-oe/recipes-connectivity/hostapd/hostapd/0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From 364c2da8741f0979dae497551e70b94c0e6c8636 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jouni Malinen <j@w1.fi> | ||
| 3 | Date: Sun, 7 Jul 2024 11:46:49 +0300 | ||
| 4 | Subject: [PATCH 1/3] SAE: Check for invalid Rejected Groups element length | ||
| 5 | explicitly | ||
| 6 | |||
| 7 | Instead of practically ignoring an odd octet at the end of the element, | ||
| 8 | check for such invalid case explicitly. This is needed to avoid a | ||
| 9 | potential group downgrade attack. | ||
| 10 | |||
| 11 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 12 | |||
| 13 | CVE: CVE-2024-3596 | ||
| 14 | Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=364c2da8741f0979dae497551e70b94c0e6c8636] | ||
| 15 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 16 | --- | ||
| 17 | src/ap/ieee802_11.c | 12 ++++++++++-- | ||
| 18 | 1 file changed, 10 insertions(+), 2 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c | ||
| 21 | index db4104928..1a62e30cc 100644 | ||
| 22 | --- a/src/ap/ieee802_11.c | ||
| 23 | +++ b/src/ap/ieee802_11.c | ||
| 24 | @@ -1258,7 +1258,7 @@ static int check_sae_rejected_groups(struct hostapd_data *hapd, | ||
| 25 | struct sae_data *sae) | ||
| 26 | { | ||
| 27 | const struct wpabuf *groups; | ||
| 28 | - size_t i, count; | ||
| 29 | + size_t i, count, len; | ||
| 30 | const u8 *pos; | ||
| 31 | |||
| 32 | if (!sae->tmp) | ||
| 33 | @@ -1268,7 +1268,15 @@ static int check_sae_rejected_groups(struct hostapd_data *hapd, | ||
| 34 | return 0; | ||
| 35 | |||
| 36 | pos = wpabuf_head(groups); | ||
| 37 | - count = wpabuf_len(groups) / 2; | ||
| 38 | + len = wpabuf_len(groups); | ||
| 39 | + if (len & 1) { | ||
| 40 | + wpa_printf(MSG_DEBUG, | ||
| 41 | + "SAE: Invalid length of the Rejected Groups element payload: %zu", | ||
| 42 | + len); | ||
| 43 | + return 1; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + count = len / 2; | ||
| 47 | for (i = 0; i < count; i++) { | ||
| 48 | int enabled; | ||
| 49 | u16 group; | ||
| 50 | -- | ||
| 51 | 2.30.2 | ||
| 52 | |||
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd/0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch b/meta-oe/recipes-connectivity/hostapd/hostapd/0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch new file mode 100644 index 0000000000..5e9e8bc01d --- /dev/null +++ b/meta-oe/recipes-connectivity/hostapd/hostapd/0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From 9716bf1160beb677e965d9e6475d6c9e162e8374 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jouni Malinen <j@w1.fi> | ||
| 3 | Date: Tue, 9 Jul 2024 23:34:34 +0300 | ||
| 4 | Subject: [PATCH 3/3] SAE: Reject invalid Rejected Groups element in the parser | ||
| 5 | |||
| 6 | There is no need to depend on all uses (i.e., both hostapd and | ||
| 7 | wpa_supplicant) to verify that the length of the Rejected Groups field | ||
| 8 | in the Rejected Groups element is valid (i.e., a multiple of two octets) | ||
| 9 | since the common parser can reject the message when detecting this. | ||
| 10 | |||
| 11 | Signed-off-by: Jouni Malinen <j@w1.fi> | ||
| 12 | |||
| 13 | Upstream-Status: Backport [https://w1.fi/cgit/hostap/commit/?id=9716bf1160beb677e965d9e6475d6c9e162e8374] | ||
| 14 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 15 | --- | ||
| 16 | src/common/sae.c | 6 ++++++ | ||
| 17 | 1 file changed, 6 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/src/common/sae.c b/src/common/sae.c | ||
| 20 | index c0f154e91..620bdf753 100644 | ||
| 21 | --- a/src/common/sae.c | ||
| 22 | +++ b/src/common/sae.c | ||
| 23 | @@ -2076,6 +2076,12 @@ static int sae_parse_rejected_groups(struct sae_data *sae, | ||
| 24 | return WLAN_STATUS_UNSPECIFIED_FAILURE; | ||
| 25 | epos++; /* skip ext ID */ | ||
| 26 | len--; | ||
| 27 | + if (len & 1) { | ||
| 28 | + wpa_printf(MSG_DEBUG, | ||
| 29 | + "SAE: Invalid length of the Rejected Groups element payload: %u", | ||
| 30 | + len); | ||
| 31 | + return WLAN_STATUS_UNSPECIFIED_FAILURE; | ||
| 32 | + } | ||
| 33 | |||
| 34 | wpabuf_free(sae->tmp->peer_rejected_groups); | ||
| 35 | sae->tmp->peer_rejected_groups = wpabuf_alloc(len); | ||
| 36 | -- | ||
| 37 | 2.30.2 | ||
| 38 | |||
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb b/meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb index 8edfecffa2..798f1ea909 100644 --- a/meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb +++ b/meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb | |||
| @@ -20,6 +20,8 @@ SRC_URI = " \ | |||
| 20 | file://CVE-2024-3596_06.patch \ | 20 | file://CVE-2024-3596_06.patch \ |
| 21 | file://CVE-2024-3596_07.patch \ | 21 | file://CVE-2024-3596_07.patch \ |
| 22 | file://CVE-2024-3596_08.patch \ | 22 | file://CVE-2024-3596_08.patch \ |
| 23 | file://0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch \ | ||
| 24 | file://0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch \ | ||
| 23 | " | 25 | " |
| 24 | 26 | ||
| 25 | 27 | ||
