]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix LDAP null deref on empty arg [CVE-2016-3119]
authorGreg Hudson <ghudson@mit.edu>
Mon, 14 Mar 2016 21:26:34 +0000 (17:26 -0400)
committerTom Yu <tlyu@mit.edu>
Wed, 6 Apr 2016 17:48:01 +0000 (13:48 -0400)
In the LDAP KDB module's process_db_args(), strtok_r() may return NULL
if there is an empty string in the db_args array.  Check for this case
and avoid dereferencing a null pointer.

CVE-2016-3119:

In MIT krb5 1.6 and later, an authenticated attacker with permission
to modify a principal entry can cause kadmind to dereference a null
pointer by supplying an empty DB argument to the modify_principal
command, if kadmind is configured to use the LDAP KDB module.

    CVSSv2 Vector: AV:N/AC:H/Au:S/C:N/I:N/A:C/E:H/RL:OF/RC:ND

(cherry picked from commit 08c642c09c38a9c6454ab43a9b53b2a89b9eef99)

ticket: 8383
version_fixed: 1.13.5
status: resolved
tags: -pullup

src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c

index eab9e3f6a27e70499bec0dd5070b8fd330d98c82..d96dec08f3bfa6896cf3010d898c2f6d45f27ec0 100644 (file)
@@ -267,6 +267,7 @@ process_db_args(krb5_context context, char **db_args, xargs_t *xargs,
     if (db_args) {
         for (i=0; db_args[i]; ++i) {
             arg = strtok_r(db_args[i], "=", &arg_val);
+            arg = (arg != NULL) ? arg : "";
             if (strcmp(arg, TKTPOLICY_ARG) == 0) {
                 dptr = &xargs->tktpolicydn;
             } else {