0012-EAP-pwd-server-Detect-reflection-attacks.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From d63edfa90243e9a7de6ae5c275032f2cc79fef95 Mon Sep 17 00:00:00 2001
  2. From: Mathy Vanhoef <mathy.vanhoef@nyu.edu>
  3. Date: Sun, 31 Mar 2019 17:26:01 +0200
  4. Subject: [PATCH 12/14] EAP-pwd server: Detect reflection attacks
  5. When processing an EAP-pwd Commit frame, verify that the peer's scalar
  6. and elliptic curve element differ from the one sent by the server. This
  7. prevents reflection attacks where the adversary reflects the scalar and
  8. element sent by the server. (CVE-2019-9497)
  9. The vulnerability allows an adversary to complete the EAP-pwd handshake
  10. as any user. However, the adversary does not learn the negotiated
  11. session key, meaning the subsequent 4-way handshake would fail. As a
  12. result, this cannot be abused to bypass authentication unless EAP-pwd is
  13. used in non-WLAN cases without any following key exchange that would
  14. require the attacker to learn the MSK.
  15. Signed-off-by: Mathy Vanhoef <mathy.vanhoef@nyu.edu>
  16. ---
  17. src/eap_server/eap_server_pwd.c | 9 +++++++++
  18. 1 file changed, 9 insertions(+)
  19. diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c
  20. index 74979da..16057e9 100644
  21. --- a/src/eap_server/eap_server_pwd.c
  22. +++ b/src/eap_server/eap_server_pwd.c
  23. @@ -753,6 +753,15 @@ eap_pwd_process_commit_resp(struct eap_sm *sm, struct eap_pwd_data *data,
  24. }
  25. }
  26. + /* detect reflection attacks */
  27. + if (crypto_bignum_cmp(data->my_scalar, data->peer_scalar) == 0 ||
  28. + crypto_ec_point_cmp(data->grp->group, data->my_element,
  29. + data->peer_element) == 0) {
  30. + wpa_printf(MSG_INFO,
  31. + "EAP-PWD (server): detected reflection attack!");
  32. + goto fin;
  33. + }
  34. +
  35. /* compute the shared key, k */
  36. if ((crypto_ec_point_mul(data->grp->group, data->grp->pwe,
  37. data->peer_scalar, K) < 0) ||
  38. --
  39. 2.7.4