]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix null deref in SPNEGO acceptor [CVE-2014-4344]
authorGreg Hudson <ghudson@mit.edu>
Tue, 15 Jul 2014 16:56:01 +0000 (12:56 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 21 Jul 2014 16:53:18 +0000 (12:53 -0400)
When processing a continuation token, acc_ctx_cont was dereferencing
the initial byte of the token without checking the length.  This could
result in a null dereference.

CVE-2014-4344:

In MIT krb5 1.5 and newer, an unauthenticated or partially
authenticated remote attacker can cause a NULL dereference and
application crash during a SPNEGO negotiation by sending an empty
token as the second or later context token from initiator to acceptor.
The attacker must provide at least one valid context token in the
security context negotiation before sending the empty token.  This can
be done by an unauthenticated attacker by forcing SPNEGO to
renegotiate the underlying mechanism, or by using IAKERB to wrap an
unauthenticated AS-REQ as the first token.

    CVSSv2 Vector: AV:N/AC:L/Au:N/C:N/I:N/A:C/E:POC/RL:OF/RC:C

[kaduk@mit.edu: CVE summary, CVSSv2 vector]

ticket: 7970 (new)
subject: NULL dereference in SPNEGO acceptor for continuation tokens [CVE-2014-4344]
target_version: 1.12.2
tags: pullup

src/lib/gssapi/spnego/spnego_mech.c

index 8f829d8c5920f1ac530d68fa9bbb307011e5eeaa..2aa6810a9ce2dc4e1e2417b1d77cab0c7bb2fde5 100644 (file)
@@ -1468,7 +1468,7 @@ acc_ctx_cont(OM_uint32 *minstat,
 
        ptr = bufstart = buf->value;
 #define REMAIN (buf->length - (ptr - bufstart))
-       if (REMAIN > INT_MAX)
+       if (REMAIN == 0 || REMAIN > INT_MAX)
                return GSS_S_DEFECTIVE_TOKEN;
 
        /*