Blame SOURCES/freeradius-CVE-2019-13456-10-iterations.patch

a7bcdb
From 3ea2a5a026e73d81cd9a3e9bbd4300c433004bfa Mon Sep 17 00:00:00 2001
a7bcdb
From: Mathy Vanhoef <mathy.vanhoef@nyu.edu>
a7bcdb
Date: Wed, 5 Jun 2019 19:21:06 +0000
a7bcdb
Subject: [PATCH] EAP-pwd: fix side-channel leak where 1 in 2018 handshakes
a7bcdb
 fail
a7bcdb
a7bcdb
Previously the Hunting and Pecking algorithm of EAP-pwd aborted when
a7bcdb
more than 10 iterations are needed. Every iteration has a 50% chance
a7bcdb
of finding the password element. This means one in every 2048 handshakes
a7bcdb
will fail, in which case an error frame is sent to the client. This
a7bcdb
event leaks information that can be abused in an offline password
a7bcdb
brute-force attack. More precisely, the adversary learns that all 10
a7bcdb
iterations failed for the given random EAP-pwd token. Using the same
a7bcdb
techniques as in the Dragonblood attack, this can be used to brute-force
a7bcdb
the password.
a7bcdb
a7bcdb
This patch fixes the above issue by executing enough iterations such that
a7bcdb
the password element is always found eventually.
a7bcdb
a7bcdb
Note that timing and cache leaks remain a risk against the current
a7bcdb
implementation of EAP-pwd.
a7bcdb
---
a7bcdb
 src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c | 2 +-
a7bcdb
 1 file changed, 1 insertion(+), 1 deletion(-)
a7bcdb
a7bcdb
diff --git a/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c b/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
a7bcdb
index c54f08c030..d94851c3aa 100644
a7bcdb
--- a/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
a7bcdb
+++ b/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
a7bcdb
@@ -192,7 +192,7 @@ int compute_password_element (pwd_session_t *session, uint16_t grp_num,
a7bcdb
 	}
a7bcdb
 	ctr = 0;
a7bcdb
 	while (1) {
a7bcdb
-		if (ctr > 10) {
a7bcdb
+		if (ctr > 100) {
a7bcdb
 			DEBUG("unable to find random point on curve for group %d, something's fishy", grp_num);
a7bcdb
 			goto fail;
a7bcdb
 		}