Skip to content

Commit

Permalink
SCRAM: Client does not check low iteration counter #811
Browse files Browse the repository at this point in the history
Using mechanism SCRAM, a client does not abort authentication
when the given iteration counter is lower than 4096.

A hostile server can send a small iteration counter (e.g. 1) and
forces the client to send a ClientProof that is calculated with
lowest computation time. Thus the hostile server can recover the
client's password faster with an offline dictionary or brute-force attack.

This fix compares the iteration counter with the recommended minimum
of 4096 and aborts the authentication if the server violates the
recommended minimum.

Signed-off-by: Guido Kiener <[email protected]>
  • Loading branch information
GuidoKiener authored and quanah committed Oct 23, 2023
1 parent 97dcfb1 commit 813cece
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/scram.c
Original file line number Diff line number Diff line change
Expand Up @@ -2455,8 +2455,11 @@ scram_client_mech_step2(client_context_t *text,
}

if (text->iteration_count < MIN_ITERATION_COUNTER) {
SETERROR(params->utils, "iteration-count is too small, refusing to compute");
result = SASL_BADPROT;
goto cleanup;
}

if (text->iteration_count > MAX_ITERATION_COUNTER) {
SETERROR(params->utils, "iteration-count is too big, refusing to compute");
result = SASL_BADPROT;
Expand Down

0 comments on commit 813cece

Please sign in to comment.