svn rev #25370: branches/krb5-1-8/src/plugins/kdb/ db2/ ldap/libkdb_ldap/

tlyu@MIT.EDU tlyu at MIT.EDU
Tue Oct 18 14:54:13 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25370
Commit By: tlyu
Log Message:
ticket: 6983
subject: SA-2011-006 KDC denial of service [CVE-2011-1527 CVE-2011-1528 CVE-2011-1529]
version_fixed: 1.8.4
status: resolved

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


Changed Files:
U   branches/krb5-1-8/src/plugins/kdb/db2/lockout.c
U   branches/krb5-1-8/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c
U   branches/krb5-1-8/src/plugins/kdb/ldap/libkdb_ldap/lockout.c
Modified: branches/krb5-1-8/src/plugins/kdb/db2/lockout.c
===================================================================
--- branches/krb5-1-8/src/plugins/kdb/db2/lockout.c	2011-10-18 18:52:37 UTC (rev 25369)
+++ branches/krb5-1-8/src/plugins/kdb/db2/lockout.c	2011-10-18 18:54:13 UTC (rev 25370)
@@ -158,13 +158,23 @@
         return 0;
     }
 
+    if (entry == NULL)
+        return 0;
+
     code = lookup_lockout_policy(context, entry, &max_fail,
                                  &failcnt_interval,
                                  &lockout_duration);
     if (code != 0)
         return code;
 
-    assert (!locked_check_p(context, stamp, max_fail, lockout_duration, entry));
+    /*
+     * 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;
 
     if (status == 0 && (entry->attributes & KRB5_KDB_REQUIRES_PRE_AUTH)) {
         /*

Modified: branches/krb5-1-8/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c
===================================================================
--- branches/krb5-1-8/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c	2011-10-18 18:52:37 UTC (rev 25369)
+++ branches/krb5-1-8/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c	2011-10-18 18:54:13 UTC (rev 25370)
@@ -131,6 +131,7 @@
     CHECK_LDAP_HANDLE(ldap_context);
 
     if (is_principal_in_realm(ldap_context, searchfor) != 0) {
+        st = KRB5_KDB_NOENTRY;
         *more = 0;
         krb5_set_error_message (context, st, "Principal does not belong to realm");
         goto cleanup;

Modified: branches/krb5-1-8/src/plugins/kdb/ldap/libkdb_ldap/lockout.c
===================================================================
--- branches/krb5-1-8/src/plugins/kdb/ldap/libkdb_ldap/lockout.c	2011-10-18 18:52:37 UTC (rev 25369)
+++ branches/krb5-1-8/src/plugins/kdb/ldap/libkdb_ldap/lockout.c	2011-10-18 18:54:13 UTC (rev 25370)
@@ -150,16 +150,26 @@
         return 0;
     }
 
+    if (entry == NULL)
+        return 0;
+
     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;
+
     entry->mask = 0;
 
-    assert (!locked_check_p(context, stamp, max_fail, lockout_duration, entry));
-
     if (status == 0 && (entry->attributes & KRB5_KDB_REQUIRES_PRE_AUTH)) {
         /*
          * Only mark the authentication as successful if the entry




More information about the cvs-krb5 mailing list