Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:4948
HistoryAug 05, 2003 - 12:00 a.m.

NetBSD Security Advisory 2003-011: off-by-one error in realpath(3)

2003-08-0500:00:00
vulners.com
21

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