login
Header Space

 
 

Re: Suid/sgid

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Subject: Re: Suid/sgid
Date: Wednesday, August 26, 1992 - 12:24 pm

From: rafal@utstat.uucp (Rafal Kustra (summer student))
   Date: Tue, 25 Aug 1992 23:09:07 GMT

   Either I don't understand the concept of suid/sgid
   (**very** possible) or there is something wrong.

   Say root creates a script like follows:
           cat $*
   and sets it suid.

   <description of how the setuid shell script apparently didn't have
    root privs omitted>

This should probably be added to the FAQ.

Setuid shell scripts are a bad, bad, bad, bad, bad thing.  They
represent a gigantic security hole for your system.  There is either a
race condition you can exploit to break root, or (depending on how dumb
your shell is), you can sometimes just confuse it enough by using a
symlink to giving you a root shell.  

So on most modern Un*x systems (Linux included), setuid shell scripts
are specifically disabled by the kernel.  If you must have a shell
script which needs to run as root, write a small C program that execs
the shell script, and make sure that no one can spoof the C program into
running some other program besides your shell script.

                                                        - Ted
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Suid/sgid, Theodore Ts'o, (Wed Aug 26, 12:24 pm)
speck-geostationary