Hash: SHA1

             AUSCERT External Security Bulletin Redistribution

           ESB-2004.0551 -- MIT krb5 Security Advisory 2004-003
                      ASN.1 decoder denial of service
                             1 September 2004


        AusCERT Security Bulletin Summary

Product:                MIT Kerberos 5
Publisher:              MIT
Impact:                 Denial of Service
Access:                 Remote/Unauthenticated
CVE Names:              CAN-2004-0644

- --------------------------BEGIN INCLUDED TEXT--------------------


                 MIT krb5 Security Advisory 2004-003

Original release: 2004-08-31

Topic: ASN.1 decoder denial of service

Severity: serious


The ASN.1 decoder library in the MIT Kerberos 5 distribution is
vulnerable to a denial-of-service attack causing an infinite loop in
the decoder.  The KDC is vulnerable to this attack.


* An unauthenticated remote attacker can cause a KDC or application
  server to hang inside an infinite loop.  [CAN-2004-0644]

* An attacker impersonating a legitimate KDC or application server may
  cause a client program to hang inside an infinite
  loop.  [CAN-2004-0644]


* KDC software and applications from MIT Kerberos 5 releases
  krb5-1.2.2 through krb5-1.3.4.

* Applications using the MIT krb5 libraries from the above releases.


* The upcoming krb5-1.3.5 release will contain fixes for these

* Apply the appropriate patch referenced below, and rebuild the software.

Patches available:

* Patch against krb5-1.3.4 (should apply to earlier krb5-1.3.x releases)

* Patch against krb5-1.2.8 (should apply to releases krb5-1.2.2
  through krb5-1.2.7 as well)

PATCH AGAINST krb5-1.3.4

* This patch was generated against krb5-1.3.4; it may
  apply, with some offset, to earlier krb5-1.3.x releases.

  This patch may also be found at:


  The associated detached PGP signature is at:


Index: src/lib/krb5/asn.1/asn1buf.c
RCS file: /cvs/krbdev/krb5/src/lib/krb5/asn.1/asn1buf.c,v
retrieving revision 5.24
*** src/lib/krb5/asn.1/asn1buf.c	12 Mar 2003 04:33:30 -0000	5.24
- - --- src/lib/krb5/asn.1/asn1buf.c	23 Aug 2004 03:43:47 -0000
*** 122,127 ****
- - --- 122,129 ----
        return ASN1_OVERRUN;
    while (nestlevel > 0) {
+     if (buf->bound - buf->next + 1 <= 0)
+       return ASN1_OVERRUN;
      retval = asn1_get_tag_2(buf, &t);
      if (retval) return retval;
      if (!t.indef) {

PATCH AGAINST krb5-1.2.8

* This patch was generated against krb5-1.2.8; it may apply, with some
  offset, to releases krb5-1.2.2 through krb5-1.2.7.  You are strongly
  encouraged to update to a release from the krb5-1.3.x series.

  This patch may also be found at:


  The associated detached PGP signature is at:


Index: src/lib/krb5/asn.1/asn1buf.c
RCS file: /cvs/krbdev/krb5/src/lib/krb5/asn.1/asn1buf.c,v
retrieving revision
diff -c -r5.19.2.1 asn1buf.c
*** src/lib/krb5/asn.1/asn1buf.c	31 Jan 2001 18:00:12 -0000
- - --- src/lib/krb5/asn.1/asn1buf.c	23 Aug 2004 03:54:50 -0000
*** 140,145 ****
- - --- 140,147 ----
        return ASN1_OVERRUN;
    while (nestlevel > 0) {
+     if (buf->bound - buf->next + 1 <= 0)
+       return ASN1_OVERRUN;
      retval = asn1_get_tag_indef(buf, &class, &construction, &tagnum,
  				&taglen, &tagindef);
      if (retval) return retval;


This announcement and related security advisories may be found on the
MIT Kerberos security advisory page at:


The main MIT Kerberos web page is at:


CERT VU#550464


CVE CAN-2004-0644


        ASN.1 decoder bug in MIT Kerberos 5 releases krb5-1.2.2
        through krb5-1.3.4 allows unauthenticated remote attackers to
        induce infinite loop, causing denial of service, including in
        KDC code


Thanks to Will Fiveash and Nico Williams at Sun for finding this


The ASN.1 decoder in the MIT krb5 library handles indefinite-length
BER encodings for the purpose of backwards compatibility with some
non-conformant implementations. The ASN.1 decoders call
asn1buf_sync() to skip any trailing unrecognized fields in the
encoding of a SEQUENCE type.  asn1buf_sync() calls asn1buf_skiptail()
if the ASN.1 SEQUENCE type being decoded was encoded with an
indefinite length.  asn1buf_sync() is provided with a prefetched BER
tag; a placeholder tag is provided by the prefetching code in the case
where there is are no more octets in a sub-encoding.

The loop in asn1buf_skiptail() which attempts to skip trailing
sub-encodings of an indefinite-length SEQUENCE type does not properly
check for end-of-subbuffer conditions or for the placeholder tag,
leading to an infinite loop.   Valid BER encodings cannot cause this
condition; however, it is trivial to construct a corrupt encoding
which will trigger the infinite loop.


2004-08-31      original release

Copyright (C) 2004 Massachusetts Institute of Technology
Version: GnuPG v1.2.5 (SunOS)


- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:


If you believe that your computer system has been compromised or attacked in 
any way, we encourage you to let us know by completing the secure National IT 
Incident Reporting Form at:


Australian Computer Emergency Response Team
The University of Queensland
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.

Comment: http://www.auscert.org.au/render.html?it=1967