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#196945

ISC BIND 8 contains buffer overflow in transaction signature (TSIG) handling code

Overview

The Berkeley Internet Name Domain (BIND) is an implementation of the Domain Name System (DNS) by the Internet Software Consortium (ISC). There is a buffer overflow vulnerability in BIND 8.2.x, which may allow remote intruders to gain access to systems running BIND. DNS servers running BIND 8 are responsible for the majority of name resolution services on the Internet.

This vulnerability has been successfully exploited in a laboratory environment and presents a serious threat to the Internet infrastructure.

I. Description

During the processing of transaction signatures, BIND performs a test for signatures that fail to include a valid key. If a transaction signature is found in the request, but a valid key is not included, BIND skips normal processing of the request and jumps directly to code designed to send an error response. Because this code fails to initialize variables in the same manner as the normal processing, later function calls make invalid assumptions about the size of the request buffer. In particular, the code to add a new (valid) signature to the response may overflow the request buffer and overwrite adjacent memory on the stack or heap. Overwriting this memory can allow an intruder (in conjunction with other buffer overflow exploit techniques) to gain unauthorized access to the vulnerable system.

The flawed program logic is distributed over several function calls within the BIND software. When the attacker sends a UDP request, the packet will be loaded into a buffer on the stack (u.buf) by the function datagram_read(). On the other hand, TCP requests are loaded into a buffer (sp->s_buf) on the heap by the function stream_getmsg(). Regardless of the protocol, each of these functions call dispatch_message(), which in turn calls ns_req().

The ns_req() function handles the request. A call to ns_find_tsig() determines if a transaction signature exists in the request, and find_key() is called thereafter to determine if a valid key has been included. In the case where a transaction signature is found but the key is NULL, msglen is computed to include only the portion of the request before the signature. This is where the problem occurs, because the variables buflen and msglen are assumed through most of the code to add up to the total size of the buffer allocated for holding the request.

BIND uses the same buffer for storing the request and generating the response. Specifically, the response is composed by appending an error code and a transaction signature to the existing request. Since the new transaction signature is supposed to overwrite the signature of the request, msglen was modified to reflect the request length minus the signature length. However, buflen was not modified to reflect the new value of msglen, causing subsequent function calls (specifically ns_sign) to cause BIND to overwrite memory adjacent to the packet buffer.

These overwrites may allow an intruder to create conditions required for the execution of arbitrary code. Because the overflows occur on the stack for UDP requests and on the heap for TCP requests, the specific details of the exploit begin to differ at this point. Both scenarios result in the same impact -- the attacker can execute arbitrary code on the vulnerable system.

For more information on transaction signatures, please visit:

II. Impact

This vulnerability may allow an attacker to execute privileged commands or code with the same permissions as the BIND server. Because BIND is typically run by a superuser account, the execution would occur with superuser privileges.

III. Solution

The ISC has released BIND version 8.2.3 to address this security issue as well as others. The CERT/CC strongly recommends that all users of BIND 8.2.x upgrade to 8.2.3 immediately. The ISC recommends that users affected by this vulnerability upgrade to either BIND 8.2.3 or BIND 9.1.


The BIND 8.2.3 distribution can be downloaded from:


The BIND 9.1 distribution can be downloaded from:

Please note that upgrading to BIND 8.2.3 also addresses the information leakage vulnerability discussed in VU#325431.

Systems Affected

VendorStatusDate NotifiedDate Updated
AppleNot Vulnerable5-Apr-2001
BSDIUnknown26-Jan-2001
CalderaVulnerable29-Jan-2001
Compaq Computer CorporationVulnerable4-Apr-2001
ConectivaVulnerable4-Apr-2001
Data GeneralUnknown26-Jan-2001
DebianVulnerable5-Apr-2001
FreeBSDVulnerable11-May-2001
FujitsuUnknown26-Jan-2001
Hewlett PackardNot Vulnerable10-May-2001
IBMVulnerable5-Apr-2001
ImmunixVulnerable5-Apr-2001
ISCVulnerable4-Apr-2001
MandrakeSoftVulnerable4-Apr-2001
MicrosoftNot Vulnerable30-Jan-2001
NECUnknown27-Jan-2001
NetBSDVulnerable5-Apr-2001
NeXTUnknown27-Jan-2001
OpenBSDNot Vulnerable30-Jan-2001
RedHatVulnerable4-Apr-2001
SCOVulnerable1-May-2002
SequentUnknown27-Jan-2001
SGIUnknown27-Apr-2001
Siemens NixdorfUnknown27-Jan-2001
SlackwareVulnerable5-Apr-2001
SonyUnknown27-Jan-2001
SunVulnerable7-Aug-2001
SuSEVulnerable5-Apr-2001
UnisysUnknown27-Jan-2001

References

VU#325431, VU#572183, VU#868916
http://www.cymru.com/~robt/Docs/Articles/secure-bind-template.html
http://www.ietf.org/rfc/rfc2535.txt
http://www.ietf.org/rfc/rfc2845.txt
http://www.isi.edu/~bmanning/in-addr-audit.html
http://www.securityfocus.com/bid/2304
http://www.securityfocus.com/news/144

Credit

The CERT/CC thanks the COVERT Labs at PGP Security for discovering and analyzing this vulnerability and the Internet Software Consortium for providing a patch to fix it.

This document was written by Cory F Cohen.

Other Information

Date Public:2001-01-29
Date First Published:2001-01-29
Date Last Updated:2002-05-01
CERT Advisory:CA-2001-02
CVE-ID(s):CAN-2001-0010
NVD-ID(s):CAN-2001-0010
US-CERT Technical Alerts: 
Metric:50.87
Document Revision:59

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

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