Users login

Create an account »

JOIN XATRIX

Users login

Home » Hacking News » NetBSD 2002-011-Sun RPC XDR decoder contains buffer overflow

NetBSD 2002-011-Sun RPC XDR decoder contains buffer overflow

by Nikola Strahija on August 3rd, 2002 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 $


Newsletter signup

Signup to our monthly newsletter and stay in touch with IT news!

Free E-books

We've got ebooks! But they're not online. :( Please give us a few days to bring downloads back.

Contact

Have something to say or just wanna drop us a line? Please keep this in mind: to spam, we reply with spam.

Contact us »