SkipNavigation
US-CERT
American Flag
  Vulnerability
Notes
Database

Search Vulnerability Notes

Vulnerability Notes Help Information


 
 View Notes By
  Name

ID Number

CVE Name

Date Public

Date Published

Date Updated

Severity Metric



 Other Documents
  Technical Alerts

Technical Bulletins

Alerts

Security Tips

 

Vulnerability Note VU#795632

MIT Kerberos 5 ASN.1 decoding functions insecurely deallocate memory (double-free)

Overview

The MIT Kerberos 5 library does not securely deallocate heap memory when decoding ASN.1 structures, resulting in double-free vulnerabilities. An unauthenticated, remote attacker could execute arbitrary code on a KDC server, which could compromise an entire Kerberos realm. An attacker may also be able to execute arbitrary code on Kerberos clients, or cause a denial of service on KDCs or clients.

I. Description

As described on the MIT Kerberos web site: "Kerberos is a network authentication protocol. It is designed to provide strong authentication for client/server applications by using secret-key cryptography." MIT Kerberos code is used in network applications from a variety of different vendors and is included in many UNIX and Linux distributions.

Kerberos 5 protocol messages are defined using Abstract Syntax Notation One (ASN.1). When ASN.1 decoding functions in the MIT Kerberos 5 library handle error conditions, the functions free() a memory reference and return the reference to the calling function. In some cases, error handling code in the calling functions may free() the memory reference again, resulting in a double-free vulnerability. MITKRB5-SA-2004-002 explains in more detail:

    In the MIT krb5 library, in all releases up to and including
    krb5-1.3.4, ASN.1 decoder functions and their callers do not use a
    consistent set of memory management conventions.  The callers expect
    the decoders to allocate memory.  The callers typically have
    error-handling code which frees memory allocated by the ASN.1 decoders
    if pointers to the allocated memory are non-null.  Upon encountering
    error conditions, the ASN.1 decoders themselves free memory which they
    have allocated, but do not null the corresponding pointers.  When some
    library functions receive errors from the ASN.1 decoders, they attempt
    to pass the non-null pointer (which points to freed memory) to free(),

    causing a double-free.
The MIT Kerberos 5 KDC is affected by a specific variant of this type of double-free condition. From MITKRB5-SA-2004-002:
    In all releases of MIT krb5 up to and including krb5-1.3.4, cleanup
    code in the KDC frees memory returned by ASN.1 decoders.  This cleanup
    code only frees memory pointed to by non-null pointers, but if an
    ASN.1 decoder returns an error, the cleanup code will free memory
    previously freed by the decoder.
The double-free conditions occur in the MIT Kerberos 5 library and affect the KDC and Kerberos clients.

II. Impact

An unauthenticated, remote attacker could execute arbitrary code on a KDC server. This could allow an attacker to gain the master secret for a Kerberos realm, leading to compromise of the entire realm. An attacker who is able to impersonate a KDC or application server may be able to execute arbitrary code on Kerberos clients. An attacker may also be able to crash a KDC or client, causing a denial of service.

III. Solution

Apply a patch

Apply the appropriate patch(es) referenced in MITKRB5-SA-2004-002 or specified by your vendor.

Upgrade

According to MITKRB5-SA-2004-002, "The upcoming krb5-1.3.5 release will contain fixes for these problems."

Restrict access

Depending on network architecture, it may be practical to restrict access to KDC servers (88/udp) from untrusted networks such as the Internet. Due to network application requirements, it may be possible, but less practical, to limit access from Kerberos clients to trusted KDC and application servers. While these workarounds will help to limit the source of attacks, they will not prevent attacks from trusted hosts or networks or attackers who can successfully spoof their source addresses.

Systems Affected

VendorStatusDate Updated
Apple Computer Inc.Vulnerable10-May-2005
Cisco Systems Inc.Not Vulnerable2-Sep-2004
ConectivaUnknown2-Sep-2004
Cray Inc.Unknown2-Sep-2004
CyberSafeNot Vulnerable2-Sep-2004
DebianVulnerable3-Sep-2004
EMC CorporationUnknown2-Sep-2004
F-SecureUnknown2-Sep-2004
Fedora Legacy ProjectVulnerable3-Sep-2004
FreeBSDUnknown2-Sep-2004
FujitsuUnknown2-Sep-2004
Guardian Digital Inc. Unknown2-Sep-2004
Heimdal Kerberos ProjectUnknown2-Sep-2004
Hewlett-Packard CompanyUnknown2-Sep-2004
HitachiNot Vulnerable3-Sep-2004
IBMUnknown2-Sep-2004
Ingrian NetworksUnknown2-Sep-2004
Juniper NetworksUnknown2-Sep-2004
KTH KerberosUnknown2-Sep-2004
MandrakeSoftVulnerable3-Sep-2004
Microsoft CorporationUnknown2-Sep-2004
MIT Kerberos Development TeamVulnerable1-Sep-2004
MontaVista SoftwareUnknown2-Sep-2004
NEC CorporationUnknown3-Sep-2004
NetBSDUnknown2-Sep-2004
NokiaUnknown2-Sep-2004
NovellUnknown2-Sep-2004
Openwall GNU/*/LinuxUnknown2-Sep-2004
Red Hat Inc.Vulnerable2-Sep-2004
SCOUnknown2-Sep-2004
SGIUnknown2-Sep-2004
Sony CorporationUnknown2-Sep-2004
SSH Communications SecurityUnknown2-Sep-2004
Sun Microsystems Inc.Unknown2-Sep-2004
SuSE Inc.Unknown2-Sep-2004
Trustix Secure LinuxVulnerable3-Sep-2004
TurboLinuxUnknown2-Sep-2004
UnisysUnknown2-Sep-2004
VanDyke Software Inc.Not Vulnerable2-Sep-2004
Wind River Systems Inc.Unknown2-Sep-2004
WirexUnknown2-Sep-2004
WRQNot Vulnerable2-Sep-2004

References


http://web.mit.edu/kerberos/advisories/MITKRB5-SA-2004-002-dblfree.txt
http://web.mit.edu/kerberos/www/
http://web.mit.edu/kerberos/www/krb5-1.3/
http://www.cmf.nrl.navy.mil/CCS/people/kenh/kerberos-faq.html#asn1
http://www.itu.int/ITU-T/asn1/
http://www.itu.int/ITU-T/studygroups/com10/languages/
http://www.cmf.nrl.navy.mil/CCS/people/kenh/kerberos-faq.html#kerbfirewall
http://www.securitytracker.com/alerts/2004/Aug/1011106.html

Credit

Thanks to Tom Yu and the MIT Kerberos Development Team for reporting this vulnerability and coordinating with vendors. MITKRB5-SA-2004-002 acknowledges Will Fiveash and Nico Williams.

This document was written by Art Manion.

Other Information

Date Public08/31/2004
Date First Published09/01/2004 11:24:28 PM
Date Last Updated05/10/2005
CERT Advisory 
CVE-ID(s)CAN-2004-0642
NVD-ID(s)CAN-2004-0642
US-CERT Technical Alerts 
Metric20.55
Document Revision42

If you have feedback, comments, or additional information about this vulnerability, please send us email.
 

 
Page Corner Image
Copyright 2004 Carnegie Mellon University
Disclaimers and copyright information
Get Adobe Reader Get Adobe Reader