Sign Up for Your FREE Weekly SecurityTracker E-mail Alert Summary
|
|
|
|
|
|
|
Put SecurityTracker Vulnerability Alerts on Your Web Site -- It's Free!
|
|
|
|
Become a Partner and License Our Database or Notification Service
|
|
|
|
|
|
|
|
|
|
|
|
|
(NetBSD Issues Fix) Re: 'libc' Off-by-One Overflow in realpath() May Let Remote Users Execute Arbitrary Code
|
|
SecurityTracker Alert ID: 1007407 |
|
SecurityTracker URL: http://securitytracker.com/id/1007407
|
|
CVE Reference:
GENERIC-MAP-NOMATCH
(Links to External Site)
|
Date: Aug 4 2003
|
Impact:
Denial of service via local system, Denial of service via network, Execution of arbitrary code via local system, Execution of arbitrary code via network, Root access via local system, Root access via network, User access via local system, User access via network
|
Fix Available: Yes Vendor Confirmed: Yes
|
Version(s): 2.3.2
|
Description:
A buffer overflow vulnerability was reported in libc. A remote or local user may be able to crash an application, execute arbitrary code, or gain elevated privileges on the target system. The specific impact depends on the applications that use the vulnerable realpath() function in libc.
It is reported that a user can supply a specially crafted pathname that is 1024 characters in length to the realpath() function. If the pathname string contains two or more directory separators, a buffer can be overwritten with a single byte (NULL).
The impact depends on the application that uses the vulnerable function, the underlying operating system, and other factors.
This vulnerability was originally reported in Alert ID #1007353 on July 31, 2003 (CVE: CAN-2003-0466) as a flaw in wu-ftpd. However, according to FreeBSD, the vulnerability resides in the underlying 'libc' realpath() function.
Janusz Niewiadomski <funkysh@isec.pl> and Wojciech Purczynski <cliph@isec.pl> are credited with reporting this flaw.
|
Impact:
A remote or local user may be able to cause the system to crash or arbitrary code to be executed. The specific impact depends on the application that uses the affected function.
|
Solution:
NetBSD has issued the following fixes:
NetBSD-current: August 4, 2003
NetBSD-1.6 branch: August 5, 2003 (1.6.2 will include the fix)
For the NetBSD-1.5 branch, a fix is pending.
The vendor has provided the following upgrade instructions:
For NetBSD-current:
Systems running NetBSD-current dated from before 2003-08-03 should be upgraded to NetBSD-current dated 2003-08-04 or later.
The following directories need to be updated from the netbsd-current CVS branch (aka HEAD):
lib/libc
To update from CVS, re-build, and re-install libc and rescue:
# cd src
# cvs update -d -P lib/libc
# cd lib/libc
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../../rescue
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
(then, reboot, or restart affected daemons)
For NetBSD 1.6, 1.6.1:
The binary distributions of NetBSD 1.6 and 1.6.1 are vulnerable.
Systems running NetBSD 1.6 sources dated from before 2003-08-04 should be upgraded from NetBSD 1.6 sources dated 2003-08-05 or later.
NetBSD 1.6.2 will include the fix.
The following directories need to be updated from the netbsd-1-6 CVS branch:
lib/libc
To update from CVS, re-build, and re-install libc and static binaries:
# cd src
# cvs update -d -P -r netbsd-1-6 lib/libc
# cd lib/libc
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../../sbin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../bin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
(then, reboot, or restart affected daemons)
Alternatively, apply the following patch (with potential offset differences):
ftp://ftp.netbsd.org/pub/NetBSD/security/patches/SA2003-011-realpath.patch
To patch, re-build and re-install libc, and static binaries:
# cd src
# patch < /path/to/SA2003-011-realpath.patch
# cd lib/libc
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../../sbin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../bin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
(then, reboot, or restart affected daemons)
For NetBSD 1.5, 1.5.1, 1.5.2, 1.5.3:
The binary distributions of NetBSD 1.5, 1.5.1, 1.5.2, and 1.5.3 are vulnerable.
Changes have not yet been pulled up to the 1.5 source branch.
Apply the following patch (with potential offset differences):
ftp://ftp.netbsd.org/pub/NetBSD/security/patches/SA2003-011-realpath.patch
To patch, re-build and re-install libc, and static binaries:
# cd src
# patch < /path/to/SA2003-011-realpath.patch
# cd lib/libc
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../../sbin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../bin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
(then, reboot, or restart affected daemons)
|
Cause:
Boundary error
|
Underlying OS:
UNIX (NetBSD)
|
|
Message History:
This archive entry is a follow-up to the message listed below.
|
Source Message Contents
|
Date: Mon, 4 Aug 2003 14:17:12 -0400
Subject: NetBSD Security Advisory 2003-011: off-by-one error in realpath(3)
|
-----BEGIN PGP SIGNED MESSAGE-----
NetBSD Security Advisory 2003-011
=================================
Topic: off-by-one error in realpath(3)
Version: NetBSD-current: source prior to August 4, 2003
NetBSD 1.6.1: affected
NetBSD 1.6: affected
NetBSD-1.5.3: affected
NetBSD-1.5.2: affected
NetBSD-1.5.1: affected
NetBSD-1.5: affected
Severity: Possible remote buffer overrun/root compromise
Fixed: NetBSD-current: August 4, 2003
NetBSD-1.6 branch: August 5, 2003 (1.6.2 will include the fix)
NetBSD-1.5 branch: Awaiting pullups
Abstract
========
In the library function realpath(3), there was a string manipulation
mistake which could lead to 1-byte buffer overrun. realpath(3) is
being used by important network daemons such as ftpd(8),
therefore the vulnerability could be remotely exploitable.
Note: The same error remained in a derived function in the distribution
of the wu-ftpd server (Not part of NetBSD's base system). This
information has been available to the general public for a matter of
days now. Exploits have been released against wu-ftpd. They are probably
being written against other affected services as well. If you offer any
of the affected services, you are advised to patch your system
immediately.
Technical Details
=================
http://www.kb.cert.org/vuls/id/743092
Binaries in the NetBSD base system which use realpath(3) include:
/bin/systrace
/usr/libexec/ftpd (*)
/sbin/mount
/sbin/umount
/usr/sbin/mountd (*)
/usr/bin/ssh
/usr/sbin/sshd (*)
/usr/libexec/sftp-server (*)
/usr/sbin/bootpd (*)
Binaries marked (*) listen on network interfaces, and could be remotely
exploitable.
Solutions and Workarounds
=========================
To fix this vulnerability you will need to upgrade your libc.
The following instructions describe how to upgrade your libc
binaries by updating your source tree and rebuilding and
installing a new version of libc.
Note that all statically-linked binaries, such as the following, must be
rebuilt:
- - binaries under /sbin and /bin for 1.5 and 1.6-based systems
- - binaries under /rescue for NetBSD-current systems
- - statically-linked binaries built by pkgsrc
Also, running instances of daemons must be restarted, if you do not plan
to reboot the machine after the update of libc.
* NetBSD-current:
Systems running NetBSD-current dated from before 2003-08-03
should be upgraded to NetBSD-current dated 2003-08-04 or later.
The following directories need to be updated from the
netbsd-current CVS branch (aka HEAD):
lib/libc
To update from CVS, re-build, and re-install libc and rescue:
# cd src
# cvs update -d -P lib/libc
# cd lib/libc
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../../rescue
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
(then, reboot, or restart affected daemons)
* NetBSD 1.6, 1.6.1:
The binary distributions of NetBSD 1.6 and 1.6.1 are vulnerable.
Systems running NetBSD 1.6 sources dated from before
2003-08-04 should be upgraded from NetBSD 1.6 sources dated
2003-08-05 or later.
NetBSD 1.6.2 will include the fix.
The following directories need to be updated from the
netbsd-1-6 CVS branch:
lib/libc
To update from CVS, re-build, and re-install libc and static
binaries:
# cd src
# cvs update -d -P -r netbsd-1-6 lib/libc
# cd lib/libc
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../../sbin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../bin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
(then, reboot, or restart affected daemons)
Alternatively, apply the following patch (with potential offset
differences):
ftp://ftp.netbsd.org/pub/NetBSD/security/patches/SA2003-011-realpath.patch
To patch, re-build and re-install libc, and static binaries:
# cd src
# patch < /path/to/SA2003-011-realpath.patch
# cd lib/libc
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../../sbin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../bin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
(then, reboot, or restart affected daemons)
* NetBSD 1.5, 1.5.1, 1.5.2, 1.5.3:
The binary distributions of NetBSD 1.5, 1.5.1, 1.5.2, and 1.5.3
are vulnerable.
Changes have not yet been pulled up to the 1.5 source branch.
Apply the following patch (with potential offset differences):
ftp://ftp.netbsd.org/pub/NetBSD/security/patches/SA2003-011-realpath.patch
To patch, re-build and re-install libc, and static binaries:
# cd src
# patch < /path/to/SA2003-011-realpath.patch
# cd lib/libc
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../../sbin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
# cd ../bin
# make USETOOLS=no cleandir dependall
# make USETOOLS=no install
(then, reboot, or restart affected daemons)
Thanks To
=========
CERT
Revision History
================
2003-08-04 Initial release
More Information
================
Advisories may be updated as new information becomes available.
The most recent version of this advisory (PGP signed) can be found at
ftp://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2003-011.txt.asc
Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.org/ and http://www.NetBSD.org/Security/.
Copyright 2003, The NetBSD Foundation, Inc. All Rights Reserved.
Redistribution permitted only in full, unmodified form.
$NetBSD: NetBSD-SA2003-011.txt,v 1.7 2003/08/04 16:02:47 david Exp $
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see http://www.gnupg.org
iQCVAwUBPy6EcD5Ru2/4N2IFAQGJfgP9HXf/mfaGmp9y22PlfA+mxlTiTfb/9N8H
ovrKNKiETzFTSr1Ni/l4pqNrkYDRqyP1J4VnS/6wv1ewDYmIzXW1c98gM7+m792l
rgZSkaDWxLyPRUhQ8N3BLJKMHvMRdNWPuYwyL76QMVVVFmUo8vSlcH8PRNJrjD8K
FIhI6NQ3/+Q=
=do/K
-----END PGP SIGNATURE-----
|
|
Go to the Top of This SecurityTracker Archive Page
|