SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   Application (Security)  >   Kerberos Vendors:   MIT
(MIT Issues Fix) Re: Heimdal Kerberos 'kadmind' Buffer Overflow Lets Remote Users Execute Arbitrary Code With Root Privileges
SecurityTracker Alert ID:  1005473
SecurityTracker URL:  http://securitytracker.com/id/1005473
CVE Reference:   GENERIC-MAP-NOMATCH   (Links to External Site)
Date:  Oct 24 2002
Impact:   Execution of arbitrary code via network, Root access via network
Fix Available:  Yes  Vendor Confirmed:  Yes  
Version(s): MIT Kerberos 5, up to and including krb5-1.2.6; MIT Kerberos 4
Description:   A buffer overflow vulnerability was reported in 'kadmind', the administrative access server for the Kerberos database in the Heimdal distribution. A remote user may be able to execute arbitrary code on the system with root level privileges.

It is reported that kadmind in Heimdal releases earlier than 0.5.1 has a buffer overflow in the kerberos version 4 compatibility code. If compiled with support for the Kerberos 4 kadmin protocol, kadmind is vulnerable.

A remote user can cause arbitrary code to be executed with root level privileges.

To determine if kadmind is vulnerable you can run:

# /usr/heimdal/libexec/kadmind --version
kadmind (Heimdal 0.5.1, KTH-KRB 1.2)
Copyright (c) 1999-2002 Kungliga Tekniska H gskolan
Send bug-reports to heimdal-bugs@pdc.kth.se

Non-vulnerable versions reportedly include Heimdal 0.5.1 and binaries that do *not* show a Kerberos 4 version string (KTH-KRB 1.2 in the example).

Impact:   A remote user can execute arbitrary code with root privileges to gain root access on the system.
Solution:   MIT has released a patch to src/kadmin/v4server/kadm_ser_wrap.c, available in the Source Message and at:

http://web.mit.edu/kerberos/www/advisories/2002-002-kadm4_patch.txt

The patch was generated against krb5-1.2.6; patches to other releases may apply with some offset.

Vendor URL:  web.mit.edu/kerberos/www/advisories/index.html (Links to External Site)
Cause:   Boundary error
Underlying OS:  Linux (Any), UNIX (Any)

Message History:   This archive entry is a follow-up to the message listed below.
Oct 22 2002 Heimdal Kerberos 'kadmind' Buffer Overflow Lets Remote Users Execute Arbitrary Code With Root Privileges



 Source Message Contents

Subject:  MITKRB5-SA-2002-002: Buffer overflow in kadmind4


-----BEGIN PGP SIGNED MESSAGE-----

		 MIT krb5 Security Advisory 2002-002

2002-10-22

Topic: Buffer overflow in kadmind4

Severity: CRITICAL - Remote user can gain root access to KDC host.

SUMMARY
=======

A stack buffer overflow in the implementation of the Kerberos v4
compatibility administration daemon (kadmind4) in the MIT krb5
distribution can be exploited to gain unauthorized root access to a
KDC host.  The attacker does not need to authenticate to the daemon to
successfully perform this attack.  At least one exploit is known to
exist in the wild.

The kadmind4 supplied with MIT krb5 is intended for use in sites that
require compatibility with legacy administrative clients; sites that
do not have this requirement are not likely to be running this daemon.

IMPACT
======

A remote attacker can execute arbitrary code on the KDC with the
privileges of the user running kadmind4 (usually root).  This can lead
to compromise of the Kerberos database.

AFFECTED SOFTWARE
=================

* All releases of MIT Kerberos 5, up to and including krb5-1.2.6.

* All Kerberos 4 implementations derived from MIT Kerberos 4,
  including Cygnus Network Security (CNS).

FIXES
=====

Apply the following patch to src/kadmin/v4server/kadm_ser_wrap.c:

Index: kadm_ser_wrap.c
===================================================================
RCS file: /cvs/krbdev/krb5/src/kadmin/v4server/kadm_ser_wrap.c,v
retrieving revision 1.10.4.1
diff -c -r1.10.4.1 kadm_ser_wrap.c
*** kadm_ser_wrap.c	2000/05/23 21:44:50	1.10.4.1
- --- kadm_ser_wrap.c	2002/10/22 22:07:11
***************
*** 170,183 ****
      u_char *retdat, *tmpdat;
      int retval, retlen;
  
!     if (strncmp(KADM_VERSTR, (char *)*dat, KADM_VERSIZE)) {
  	errpkt(dat, dat_len, KADM_BAD_VER);
  	return KADM_BAD_VER;
      }
      in_len = KADM_VERSIZE;
      /* get the length */
!     if ((retc = stv_long(*dat, &r_len, in_len, *dat_len)) < 0)
  	return KADM_LENGTH_ERROR;
      in_len += retc;
      authent.length = *dat_len - r_len - KADM_VERSIZE - sizeof(krb5_ui_4);
      memcpy((char *)authent.dat, (char *)(*dat) + in_len, authent.length);
- --- 170,190 ----
      u_char *retdat, *tmpdat;
      int retval, retlen;
  
!     if ((*dat_len < KADM_VERSIZE + sizeof(krb5_ui_4))
! 	|| strncmp(KADM_VERSTR, (char *)*dat, KADM_VERSIZE)) {
  	errpkt(dat, dat_len, KADM_BAD_VER);
  	return KADM_BAD_VER;
      }
      in_len = KADM_VERSIZE;
      /* get the length */
!     if ((retc = stv_long(*dat, &r_len, in_len, *dat_len)) < 0
! 	|| (r_len > *dat_len - KADM_VERSIZE - sizeof(krb5_ui_4))
! 	|| (*dat_len - r_len - KADM_VERSIZE -
! 	    sizeof(krb5_ui_4) > sizeof(authent.dat))) {
! 	errpkt(dat, dat_len, KADM_LENGTH_ERROR);
  	return KADM_LENGTH_ERROR;
+     }
+ 
      in_len += retc;
      authent.length = *dat_len - r_len - KADM_VERSIZE - sizeof(krb5_ui_4);
      memcpy((char *)authent.dat, (char *)(*dat) + in_len, authent.length);

The patch was generated against krb5-1.2.6; patches to other releases
may apply with some offset.

This patch may also be found at:

http://web.mit.edu/kerberos/www/advisories/2002-002-kadm4_patch.txt

The associated detached PGP signature is at:

http://web.mit.edu/kerberos/www/advisories/2002-002-kadm4_patch.txt.asc

This announcement and code patches related to it may be found on the
MIT Kerberos security advisory page at:

	http://web.mit.edu/kerberos/www/advisories/index.html

The main MIT Kerberos web page is at:

	http://web.mit.edu/kerberos/www/index.html

ACKNOWLEDGMENTS
===============

Thanks to Johan Danielsson and Love Hornquist-Astrand for alerting us
to this problem and providing us with an initial patch.

Thanks to Assar Westerlund for further assistance in developing the
patch.

DETAILS
=======

The function kadm_ser_in() is passed an allocated buffer (containing a
request read from the network) and its length.  From this buffer, it
reads an 8-byte version string followed by a 4-byte length.  This
length field is not checked; an attacker can construct a request that
will cause authent.length to become negative or to become greater than
sizeof(authent.dat).  Both cases can cause the following call to
memcpy() to overflow authent.dat, which is a buffer on the stack.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (SunOS)

iQCVAwUBPbYaj6bDgE/zdoE9AQHYRwP9GJFVcvLfyOgeAXEpWqnQS/RdH5PwOCoi
7+6P2jILef1glCfqNmGfJK2kCh5pN8cioplYUgG2XLC1ATHSQoy18ldByfeU9mwJ
ae5GV0K8v7LifpMqPobxCHQdzNi02xjZtiLbQTH/8ACtYLn+rS7ZbtfrVti5bWy9
juJ+NZDS4RA=
=5VQa
-----END PGP SIGNATURE-----

 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2022, SecurityGlobal.net LLC