Skip to content

Commit

Permalink
kdc: CVE-2019-14870 Validate client attributes in protocol-transition
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
  • Loading branch information
iboukris authored and nicowilliams committed Nov 4, 2022
1 parent bdd1d02 commit fd43016
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kdc/krb5tgs.c
Expand Up @@ -2125,6 +2125,17 @@ tgs_build_reply(krb5_context context,
goto out;
}

/* Ignore require_pwchange and pw_end attributes (as Windows does),
* since S4U2Self is not password authentication. */
s4u2self_impersonated_client->entry.flags.require_pwchange = FALSE;
free(s4u2self_impersonated_client->entry.pw_end);
s4u2self_impersonated_client->entry.pw_end = NULL;

ret = kdc_check_flags(context, config, s4u2self_impersonated_client, tpn,
NULL, NULL, FALSE);
if (ret)
goto out;

/* If we were about to put a PAC into the ticket, we better fix it to be the right PAC */
if(rspac.data) {
krb5_pac p = NULL;
Expand Down
8 changes: 8 additions & 0 deletions tests/kdc/check-kdc.in
Expand Up @@ -811,6 +811,14 @@ echo "test impersonate unknown client"; > messages.log
${kgetcred_imp} --forward --impersonate=unknown@${R} ${ps} && \
{ ec=1 ; eval "${testfailed}"; }

echo "test impersonate account-expired client"; > messages.log
${kgetcred_imp} --forward --impersonate=account-expired@${R} ${ps} && \
{ ec=1 ; eval "${testfailed}"; }

echo "test impersonate pw-expired client"; > messages.log
${kgetcred_imp} --forward --impersonate=pw-expired@${R} ${ps} || \
{ ec=1 ; eval "${testfailed}"; }

echo "test delegate sensitive client"; > messages.log
${kgetcred_imp} --forward --impersonate=sensitive@${R} ${ps} || \
{ ec=1 ; eval "${testfailed}"; }
Expand Down

0 comments on commit fd43016

Please sign in to comment.