Skip to contentSkip to conversation

hostapd: patch CVE-2025-24912

PATCH New Ankur Tyagi 1 participant 1 message Oct 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hostapd: patch CVE-2025-24912

Details https://nvd.nist.gov/vuln/detail/CVE-2025-24912

---
 .../hostapd/hostapd/CVE-2025-24912_01.patch   | 80 +++++++++++++++++++
 .../hostapd/hostapd/CVE-2025-24912_02.patch   | 72 +++++++++++++++++
 .../hostapd/hostapd_2.10.bb                   |  2 +
 3 files changed, 154 insertions(+)
 create mode 100644 meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912_01.patch
 create mode 100644 meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912_02.patch
meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912_01.patch new file +80 -0
new file mode 100644
index 0000000000..5ba3308139
@@ -0,0 +1,80 @@
+From c77bc3f388b81fabc9fa6233caa618c724de8a28 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <[email protected]>
+Date: Sat, 25 Jan 2025 11:21:16 +0200
+Subject: [PATCH] RADIUS: Drop pending request only when accepting the response
+
+The case of an invalid authenticator in a RADIUS response could imply
+that the response is not from the correct RADIUS server and as such,
+such a response should be discarded without changing internal state for
+the pending request. The case of an unknown response (RADIUS_RX_UNKNOWN)
+is somewhat more complex since it could have been indicated before
+validating the authenticator. In any case, it seems better to change the
+state for the pending request only when we have fully accepted the
+response.
+
+Allowing the internal state of pending RADIUS request to change based on
+responses that are not fully validation could have allow at least a
+theoretical DoS attack if an attacker were to have means for injecting
+RADIUS messages to the network using the IP address of the real RADIUS
+server and being able to do so more quickly than the real server and
+with the matching identifier from the request header (i.e., either by
+flooding 256 responses quickly or by having means to capture the RADIUS
+request). These should not really be realistic options in a properly
+protected deployment, but nevertheless it is good to be more careful in
+processing RADIUS responses.
+
+Remove a pending RADIUS request from the internal list only when having
+fully accepted a matching RADIUS response, i.e., after one of the
+registered handlers has confirmed that the authenticator is valid and
+processing of the response has succeeded.
+
+CVE: CVE-2025-24912
+Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=726432d7622cc0088ac353d073b59628b590ea44]
+
+Signed-off-by: Jouni Malinen <[email protected]>
+(cherry picked from commit 726432d7622cc0088ac353d073b59628b590ea44)
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ src/radius/radius_client.c | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
+index ee9e46d2a..8f9332583 100644
+--- a/src/radius/radius_client.c
++++ b/src/radius/radius_client.c
+@@ -922,13 +922,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
+ 		       roundtrip / 100, roundtrip % 100);
+ 	rconf->round_trip_time = roundtrip;
+ 
+-	/* Remove ACKed RADIUS packet from retransmit list */
+-	if (prev_req)
+-		prev_req->next = req->next;
+-	else
+-		radius->msgs = req->next;
+-	radius->num_msgs--;
+-
+ 	for (i = 0; i < num_handlers; i++) {
+ 		RadiusRxResult res;
+ 		res = handlers[i].handler(msg, req->msg, req->shared_secret,
+@@ -939,6 +932,13 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
+ 			radius_msg_free(msg);
+ 			/* fall through */
+ 		case RADIUS_RX_QUEUED:
++			/* Remove ACKed RADIUS packet from retransmit list */
++			if (prev_req)
++				prev_req->next = req->next;
++			else
++				radius->msgs = req->next;
++			radius->num_msgs--;
++
+ 			radius_client_msg_free(req);
+ 			return;
+ 		case RADIUS_RX_INVALID_AUTHENTICATOR:
+@@ -960,7 +960,6 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
+ 		       msg_type, hdr->code, hdr->identifier,
+ 		       invalid_authenticator ? " [INVALID AUTHENTICATOR]" :
+ 		       "");
+-	radius_client_msg_free(req);
+ 
+  fail:
+ 	radius_msg_free(msg);
meta-oe/recipes-connectivity/hostapd/hostapd/CVE-2025-24912_02.patch new file +72 -0

72 lines not on this page · raw message

meta-oe/recipes-connectivity/hostapd/hostapd_2.10.bb +2 -0
index 5ef6ac64b2..0e241e48b0 100644
@@ -22,6 +22,8 @@ SRC_URI = " \
     file://0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch \
     file://0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch \
     file://CVE-2023-52160.patch \
+    file://CVE-2025-24912_01.patch \
+    file://CVE-2025-24912_02.patch \
 "