]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
PKINIT null pointer deref [CVE-2013-1415]
authorXi Wang <xi.wang@gmail.com>
Thu, 14 Feb 2013 23:17:40 +0000 (18:17 -0500)
committerTom Yu <tlyu@mit.edu>
Mon, 22 Apr 2013 23:59:15 +0000 (19:59 -0400)
Don't dereference a null pointer when cleaning up.

The KDC plugin for PKINIT can dereference a null pointer when a
malformed packet causes processing to terminate early, leading to
a crash of the KDC process.  An attacker would need to have a valid
PKINIT certificate or have observed a successful PKINIT authentication,
or an unauthenticated attacker could execute the attack if anonymous
PKINIT is enabled.

CVSSv2 vector: AV:N/AC:M/Au:N/C:N/I:N/A:C/E:P/RL:O/RC:C

This is a minimal commit for pullup; style fixes in a followup.
[kaduk@mit.edu: reformat and edit commit message]

(cherry picked from commit c773d3c775e9b2d88bcdff5f8a8ba88d7ec4e8ed)

ticket: 7619 (new)
version_fixed: 1.9.5
status: resolved

src/plugins/preauth/pkinit/pkinit_crypto_openssl.c

index bb8f036daa517ef680aabb5e690e74873951d0ce..51103e803cf63c8634378d95e461be2f162137b6 100644 (file)
@@ -2883,7 +2883,7 @@ pkinit_check_kdc_pkid(krb5_context context,
     pkiDebug("found kdcPkId in AS REQ\n");
     is = d2i_PKCS7_ISSUER_AND_SERIAL(NULL, &p, (int)pkid_len);
     if (is == NULL)
-        goto cleanup;
+        return retval;
 
     status = X509_NAME_cmp(X509_get_issuer_name(kdc_cert), is->issuer);
     if (!status) {
@@ -2893,7 +2893,6 @@ pkinit_check_kdc_pkid(krb5_context context,
     }
 
     retval = 0;
-cleanup:
     X509_NAME_free(is->issuer);
     ASN1_INTEGER_free(is->serial);
     free(is);