home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!daemon
- From: tytso@ATHENA.MIT.EDU (Theodore Ts'o)
- Subject: Re: Suid/sgid
- Message-ID: <1992Aug26.162407.6349@athena.mit.edu>
- Sender: daemon@athena.mit.edu (Mr Background)
- Reply-To: tytso@ATHENA.MIT.EDU (Theodore Ts'o)
- Organization: The Internet
- Date: Wed, 26 Aug 1992 16:24:07 GMT
- Lines: 28
-
- 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
-