home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!news
- From: mcharity@lcs.mit.edu (Mitchell N Charity)
- Newsgroups: comp.unix.aix
- Subject: AIX setuid/setgid security hole
- Message-ID: <1992Dec17.192558.23830@mintaka.lcs.mit.edu>
- Date: 17 Dec 92 19:25:58 GMT
- Sender: news@mintaka.lcs.mit.edu
- Organization: MIT Laboratory for Computer Science
- Lines: 50
-
- Bug: setuid/setgid do not properly limit authority.
- Example:
- A program running as root,
- after successfully calling setgid(100) and setuid(100),
- thus allegedly adopting guest/usr authority,
- can still delete files from root/security owned directories.
- Security impact:
- User written programs which begin running as root,
- (in my case, a /bin/login replacement),
- and appear to safeguard the filesystem by becoming a unprivileged user,
- may in fact still have the authority to do significant damage.
- Bug status:
- - I have begun the tortuous IBM support process. No feedback yet.
- - I have heard that a related bug, and an associated workaround,
- were posted to this list. Also that they were reported to IBM and CERT,
- and ignored by both. ?
-
- Demo:
-
- Under AIX 3.2.1:
- % more program.c
- #include <unistd.h>
- #include <stdio.h>
- main (int argc,char**argv) {
- if( setgid( 100 ) <0) { perror("setgid failed"); exit(1); }
- if( setuid( 100 ) <0) { perror("setuid failed"); exit(1); }
- execv(argv[1],&(argv[1]));
- perror("execv failed");
- exit(1);
- }
- % cc -o program program.c
- % su
- # mkdir foodir
- # chown root foodir
- # chgrp security foodir
- # chmod 775 foodir
- # touch foodir/foofile
- # chown root foodir/foofile
- # chgrp security foodir/foofile
- # chmod 775 foodir/foofile
- # /bin/ls -dl foodir
- drwxrwxr-x 2 root security 512 Dec 17 13:14 foodir
- # /bin/ls -l foodir/foofile
- -rwxrwxr-x 1 root security 0 Dec 17 13:14 foodir/foofile
- # ./program /bin/rm -f foodir/foofile
- # /bin/ls -l foodir/foofile
- foodir/foofile not found
-
- Note:
- If chmod 755 foodir, rather than 775, then permission is correctly denied.
-