Skip to content

Commit

Permalink
SA-2011-006 KDC denial of service [CVE-2011-1527 CVE-2011-1528 CVE-20…
Browse files Browse the repository at this point in the history
…11-1529]

Fix null pointer dereference and assertion failure conditions that
could cause a denial of service.

ticket: 6982
version_fixed: 1.9.2
status: resolved

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-9@25369 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information
tlyu committed Oct 18, 2011
1 parent 879fd42 commit 1a28d1d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/plugins/kdb/db2/lockout.c
Expand Up @@ -169,13 +169,25 @@ krb5_db2_lockout_audit(krb5_context context,
return 0;
}

if (entry == NULL)
return 0;

if (!db_ctx->disable_lockout) {
code = lookup_lockout_policy(context, entry, &max_fail,
&failcnt_interval, &lockout_duration);
if (code != 0)
return code;
}

/*
* Don't continue to modify the DB for an already locked account.
* (In most cases, status will be KRB5KDC_ERR_CLIENT_REVOKED, and
* this check is unneeded, but in rare cases, we can fail with an
* integrity error or preauth failure before a policy check.)
*/
if (locked_check_p(context, stamp, max_fail, lockout_duration, entry))
return 0;

/* Only mark the authentication as successful if the entry
* required preauthentication, otherwise we have no idea. */
if (status == 0 && (entry->attributes & KRB5_KDB_REQUIRES_PRE_AUTH)) {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c
Expand Up @@ -105,6 +105,7 @@ krb5_ldap_get_principal(krb5_context context, krb5_const_principal searchfor,
CHECK_LDAP_HANDLE(ldap_context);

if (is_principal_in_realm(ldap_context, searchfor) != 0) {
st = KRB5_KDB_NOENTRY;
krb5_set_error_message (context, st, "Principal does not belong to realm");
goto cleanup;
}
Expand Down
14 changes: 12 additions & 2 deletions src/plugins/kdb/ldap/libkdb_ldap/lockout.c
Expand Up @@ -165,6 +165,9 @@ krb5_ldap_lockout_audit(krb5_context context,
return 0;
}

if (entry == NULL)
return 0;

if (!ldap_context->disable_lockout) {
code = lookup_lockout_policy(context, entry, &max_fail,
&failcnt_interval,
Expand All @@ -173,9 +176,16 @@ krb5_ldap_lockout_audit(krb5_context context,
return code;
}

entry->mask = 0;
/*
* Don't continue to modify the DB for an already locked account.
* (In most cases, status will be KRB5KDC_ERR_CLIENT_REVOKED, and
* this check is unneeded, but in rare cases, we can fail with an
* integrity error or preauth failure before a policy check.)
*/
if (locked_check_p(context, stamp, max_fail, lockout_duration, entry))
return 0;

assert (!locked_check_p(context, stamp, max_fail, lockout_duration, entry));
entry->mask = 0;

/* Only mark the authentication as successful if the entry
* required preauthentication, otherwise we have no idea. */
Expand Down

0 comments on commit 1a28d1d

Please sign in to comment.