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

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                  ESB-2002.309 -- FreeBSD-SA-02:28.resolv
                        buffer overflow in resolver
                               27 June 2002

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:                dns resolver
Vendor:                 FreeBSD
Operating System:       FreeBSD 4.6 and prior
Impact:                 Execute Arbitrary Code/Commands
Access Required:        Remote

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

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

=============================================================================
FreeBSD-SA-02:28.resolv                                     Security Advisory
                                                          The FreeBSD Project

Topic:          buffer overflow in resolver

Category:       core
Module:         libc
Announced:      2002-06-26
Credits:        Joost Pol <joost@pine.nl>
Affects:        All releases prior to and including 4.6-RELEASE
Corrected:      2002-06-26 06:34:18 UTC (RELENG_4)
                2002-06-26 08:44:24 UTC (RELENG_4_6)
                2002-06-26 18:53:20 UTC (RELENG_4_5)
FreeBSD only:   NO

I.   Background

The resolver implements functions for making, sending and interpreting
query and reply messages with Internet domain name servers.
Hostnames, IP addresses, and other information are queried using the
resolver.

II.  Problem Description

DNS messages have specific byte alignment requirements, resulting in
padding in messages.  In a few instances in the resolver code, this
padding is not taken into account when computing available buffer
space.  As a result, the parsing of a DNS message may result in a
buffer overrun of up to a few bytes for each record included in the
message.

III. Impact

An attacker (either a malicious domain name server or an agent that
can spoof DNS messages) may produce a specially crafted DNS message
that will exploit this bug when parsed by an application using the
resolver.  It may be possible for such an exploit to result in the
execution of arbitrary code with the privileges of the resolver-using
application.  Though no exploits are known to exist today, since
practically all Internet applications utilize the resolver, the
severity of this issue is high.

IV.  Workaround

There is currently no workaround.

V.   Solution

Do one of the following:

1) Upgrade your vulnerable system to 4.6-STABLE; or to the RELENG_4_6
or RELENG_4_5 security branch dated after the correction date
(4.6-RELEASE-p1 or 4.5-RELEASE-p7).

2) To patch your present system:

The following patch has been verified to apply to FreeBSD 4.5 and
FreeBSD 4.6 systems.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:28/resolv.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:28/resolv.patch.asc

b) Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile the operating systems as described in
<URL:http://www.freebsd.org/doc/handbook/makeworld.html>.

Note that any statically linked applications that are not part of
the base system (i.e. from the Ports Collection or other 3rd-party
sources) must be recompiled.

VI.  Correction details

The following list contains the revision numbers of each file that was
corrected in FreeBSD.

Path                                                             Revision
  Branch
- - -------------------------------------------------------------------------
src/lib/libc/net/gethostbydns.c
  RELENG_4                                                       1.27.2.2
  RELENG_4_6                                                    1.27.10.1
  RELENG_4_5                                                     1.27.8.1
src/lib/libc/net/getnetbydns.c
  RELENG_4                                                       1.13.2.2
  RELENG_4_6                                                 1.13.2.1.8.1
  RELENG_4_5                                                 1.13.2.1.6.1
src/lib/libc/net/name6.c
  RELENG_4                                                        1.6.2.6
  RELENG_4_6                                                  1.6.2.5.8.1
  RELENG_4_5                                                  1.6.2.5.6.1
src/sys/conf/newvers.sh
  RELENG_4_6                                                1.44.2.23.2.2
  RELENG_4_5                                                1.44.2.20.2.8
- - -------------------------------------------------------------------------

VII. References

<URL:http://www.pine.nl/advisories/pine-cert-20020601.html>
- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iQCVAwUBPRoQOVUuHi5z0oilAQG3cAP/d7Gb2rdkSjZKCR0NI+QzMibgySVTXOtF
sdoJrYka/XnIpFMVAyXl36bibtRKbwfCyv/rEX39YSas7tqReizwAABoaRF956Qb
qlek1ONvvd+Tj6+WpEEueX/VdPqGQuqMk0BoguIbOgwAya6ZFYJ9ZKAHHSN9YqO8
ZGTC8pmqfGI=
=s76v
- -----END PGP SIGNATURE-----

- --------------------------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.

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 use any or all of this information is
the responsibility of each user or organisation, and should be done so in
accordance with site policies and procedures.

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 original authors 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:

	http://www.auscert.org.au/Information/advisories.html

If you believe that your system has been compromised, contact AusCERT or
your representative in FIRST (Forum of Incident Response and Security
Teams).

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.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: ftp://ftp.auscert.org.au/pub/auscert/AUSCERT_PGP.key

iQCVAwUBPRs2TCh9+71yA2DNAQGT9AP9FcwCMaE/j+kEHQZQT+ktb5X/meHDsMUi
1gvuCViSUOXLtlny43HR0amPxWXTXa/M/VTghq90ZjCs7lxGALkP5jJyrCOLQ8lh
VpRktLsoKUrrl0i3d/PYuPuzWFSxd5IRPWJr2JDlB3cjPlPz2WAbjjSct+6Xku2L
D4OArH7irZM=
=oUSs
-----END PGP SIGNATURE-----