Public Vulnerability Reports

Apple Mac OS X Server NeST -target Buffer Overflow Vulnerability



Mac OS X is an advanced operating system which blends features of UNIX
with the ease-of-use of the Macintosh. NetInfo is Darwin's built-in
directory system. It stores administrative information in a
hierarchical database of nodes called directories. NeST is the NetInfo
Setup Tool. More information is available on the vendor's website:


Local exploitation of a buffer overflow vulnerability in Apple
Computer, Inc.'s Mac OS X Server default install allows attackers to
execute arbitrary code. NeST is the NetInfo Setup Tool for Mac OS X.
The vulnerability specifically exists due to insufficient bounds
checking on the argument passed to the '-target' command line
parameter. Local attackers can supply an overly long value to overflow
the buffer and execute arbitrary code. The following example debugger
session shows execution control when overflowing the target buffer:

    osx-dev:~ $ gdb -q /usr/sbin/NeST
    (gdb) run -target `perl -e 'print "xbfxffxfexe4" x 800 '`
    Starting program: /usr/sbin/NeST -target `perl -e 'print
       "xbfxffxfexe4" x 800 '`
    Reading symbols for shared libraries ............... done
    1976-04-01 08:29:04.480 NeST[3359] CFLog (0):
            CFPropertyListCreateFromXMLData(): plist parse failed; the
               data is not proper UTF-8. The file name for this data
               could be:
            Info.plist -- file://localhost/usr/sbin/
            The parser will retry as in 10.2, but the problem should be
               corrected in the plist.
    Program received signal EXC_BAD_INSTRUCTION, Illegal
    0xbffffee8 in ?? ()
    (gdb) bt
    #0  0xbffffee8 in ?? ()
    #1  0xbffffee4 in ?? ()


Successful exploitation of this vulnerability will result in execution
of arbitrary code with root privileges. The vulnerability itself is a
textbook stack overflow and is trivially exploitable. This binary does
not ship by default with the standard install of Mac OS X, so only OS X
Server platforms are affected.


iDEFENSE has confirmed that Apple Computer, Inc.'s Mac OS X Server
10.3.7 is vulnerable. All versions of OS X Server are suspected to be


As a workaround solution, remove the setuid bit from the NeST binary
until the vendor releases a patch.


The vulnerability is addressed in Apple Security Update 2005-005:


The Common Vulnerabilities and Exposures (CVE) project has assigned the
names CAN-2005-0594 to these issues. This is a candidate for inclusion
in the CVE list (, which standardizes names for
security problems.


02/28/2005   Initial vendor notification
02/28/2005   Initial vendor response
05/03/2005   Coordinated public disclosure


Nico is credited with this discovery.

Get paid for vulnerability research

Free tools, research and upcoming events


Copyright © 2005 Verisign, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.