Skip to content

Commit

Permalink
EAP-pwd: fix side-channel leak where 1 in 2018 handshakes fail
Browse files Browse the repository at this point in the history
Previously the Hunting and Pecking algorithm of EAP-pwd aborted when
more than 10 iterations are needed. Every iteration has a 50% chance
of finding the password element. This means one in every 2048 handshakes
will fail, in which case an error frame is sent to the client. This
event leaks information that can be abused in an offline password
brute-force attack. More precisely, the adversary learns that all 10
iterations failed for the given random EAP-pwd token. Using the same
techniques as in the Dragonblood attack, this can be used to brute-force
the password.

This patch fixes the above issue by executing enough iterations such that
the password element is always found eventually.

Note that timing and cache leaks remain a risk against the current
implementation of EAP-pwd.
  • Loading branch information
vanhoefm authored and alandekok committed Jun 24, 2019
1 parent bc334d1 commit 3ea2a5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ int compute_password_element (pwd_session_t *session, uint16_t grp_num,
}
ctr = 0;
while (1) {
if (ctr > 10) {
if (ctr > 100) {
DEBUG("unable to find random point on curve for group %d, something's fishy", grp_num);
goto fail;
}
Expand Down

1 comment on commit 3ea2a5a

@Beyond-My
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 100?

Please sign in to comment.