Operating System:

Published:

07 August 2002

Protect yourself against future threats.

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

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

             ESB-2002.397 -- NetBSD Security Advisory 2002-011
               Sun RPC XDR decoder contains buffer overflow
                               7 August 2002

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

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

Product:                libc
Vendor:                 NetBSD
Operating System:       NetBSD-current:	source prior to August 1, 2002
                        NetBSD-1.6 beta
                        NetBSD-1.5.3
                        NetBSD-1.5.2
                        NetBSD-1.5.1
                        NetBSD-1.5
                        NetBSD-1.4.*
Impact:                 Root Compromise
Access Required:        Remote

Ref:                    AL-2002.09
                        ESB-2002.394

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

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


		 NetBSD Security Advisory 2002-011
		 =================================

Topic:		Sun RPC XDR decoder contains buffer overflow

Version:	NetBSD-current:	source prior to August 1, 2002
		NetBSD-1.6 beta: affected
		NetBSD-1.5.3:	affected
		NetBSD-1.5.2:	affected
		NetBSD-1.5.1:	affected
		NetBSD-1.5:	affected
		NetBSD-1.4.*:	affected

severity:	Possible remote root compromise if RPC services
		are enabled

Fixed:		NetBSD-current:		August 1, 2002
		NetBSD-1.6 branch:	August 2, 2002 (1.6 will include the fix)
		NetBSD-1.5 branch:	August 1, 2002 (1.5.4 will include the fix)
		NetBSD-1.4 branch:	not yet


Abstract
========

Integer overflows exist in the RPC code in libc. These cause a buffer to
be mistakenly allocated too small, and then overflown.

amd and amq, the Automounter and its query tool, and the rusers client
binary use the flawed code in a way which could be exploitable.

Other uses of the RPC functions have been examined and are believed to
not be exploitable.

No RPC-based services are enabled by default.


Technical Details
=================

Sun RPC is a remote procedure call framework which allows clients
to invoke procedures in a server process over a network somewhat
transparently.  XDR is a mechanism for encoding data structures for
use with RPC.  NFS, NIS, and many other network services are built
upon Sun RPC.

The NetBSD C runtime library (libc) contains an XDR encoder/decoder
derived from Sun's RPC implementation.

Any application using Sun RPC may be vulnerable to a heap buffer
overflow.  Depending upon the application, this vulnerability may be
exploitable and lead to arbitrary code execution.

An error in the calculation of memory needed for unpacking arrays in
the XDR decoder can result in a heap buffer overflow.

Though no exploits are known to exist currently, RPC-based services run
as the superuser, and the vulnerability in amd could be exploitable.

Again, no RPC-based services are enabled by default.


Solutions and Workarounds
=========================

If you do not run any of the affected RPC services (amd/amq/rusers)
your system is not affected.  However, we suggest you to upgrade your
system to avoid running vulnerable RPC code by mistake.

The following instructions describe how to upgrade your libc (which
includes RPC code) by updating your source tree and rebuilding and
installing a new version of libc.

Note that if you have any statically-linked binaries that uses RPC,
you need to recompile them.

* NetBSD-current:

	Systems running NetBSD-current dated from before 2002-08-01
	should be upgraded to NetBSD-current dated 2002-08-01 or later.

	The following directories need to be updated from the
	netbsd-current CVS branch (aka HEAD):
		lib/libc/rpc

	To update from CVS, re-build, and re-install libc:
		# cd src
		# cvs update -d -P lib/libc/rpc

		# cd lib/libc
		# make cleandir dependall
		# make install


* NetBSD 1.6 beta:

	Systems running NetBSD-1.6 branch dated from before 2002-08-02
	should be upgraded to NetBSD-1.6 branch dated 2002-08-02 or later.

	The following directories need to be updated from the
	netbsd-1-6 CVS branch:
		lib/libc/rpc

	To update from CVS, re-build, and re-install libc:
		# cd src
		# cvs update -d -P -r netbsd-1-6 lib/libc/rpc

		# cd lib/libc
		# make cleandir dependall
		# make install


* NetBSD 1.5, 1.5.1, 1.5.2, 1.5.3:

	Systems running NetBSD-1.5 branch dated from before 2002-08-02
	should be upgraded to NetBSD-1.5 branch dated 2002-08-02 or later.

	The following directories need to be updated from the
	netbsd-1-5 CVS branch:
		lib/libc/rpc

	To update from CVS, re-build, and re-install libc:
		# cd src
		# cvs update -d -P -r netbsd-1-5 lib/libc/rpc

		# cd lib/libc
		# make cleandir dependall
		# make install


* NetBSD 1.4, 1.4.1, 1.4.2, 1.4.3:

	The advisory will be updated to include instructions to remedy
	this problem for systems running the NetBSD-1.4 branch.


Thanks To
=========

CERT for notification.

Charles Hannum for scope analysis and commentary.

FreeBSD security-officers. Parts of the advisory text are based on
the FreeBSD advisory.


Revision History
================

	2002-08-01	Initial release
	2002-08-02	1.5/1.6 branch info


More Information
================

An up-to-date PGP signed copy of this release will be maintained at
  ftp://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2002-011.txt.asc

Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.ORG/ and http://www.NetBSD.ORG/Security/.


Copyright 2002, The NetBSD Foundation, Inc.  All Rights Reserved.

$NetBSD: NetBSD-SA2002-011.txt,v 1.9 2002/08/02 13:42:18 david Exp $

- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see http://www.gnupg.org

iQCVAwUBPUpQNz5Ru2/4N2IFAQEWTgP/Y985RBH4drGjfpS5tdMpWWtk372vjSG6
pu9mV/voqaOhMoRaxtYmh0BKxnWs+JFjEiXO0gWiUfEq7aTZt6DhBFX6ON01eZPw
/3ZwLR/PyeRjUHTLL0b+kfmkWWTU2LNuD9+aEeiUQmbGbkuc1JWqI/q62rtsHcEQ
IbegeQ2NM2Y=
=M6bA
- -----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 only.

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

iQCVAwUBPVECVih9+71yA2DNAQEESgP/Utw+BZtXGfBATL583IleRpd9EJjeQiMt
GdLh4swTWG0S+BJUHyh7i+WbB1ic99lU76u4a3mYJFSSoX9Zg2FYBq8iiHuZ4qgx
J/Pv8nmz7RIyKnea46RPkb2IHovYtpPsK196NUD3DgR0WWwH5xiGthX4X72rp9x7
6sKFjsfNv4s=
=L0FH
-----END PGP SIGNATURE-----