home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / aix / 12659 < prev    next >
Encoding:
Text File  |  1992-12-17  |  2.0 KB  |  61 lines

  1. Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!news
  2. From: mcharity@lcs.mit.edu (Mitchell N Charity)
  3. Newsgroups: comp.unix.aix
  4. Subject: AIX setuid/setgid security hole
  5. Message-ID: <1992Dec17.192558.23830@mintaka.lcs.mit.edu>
  6. Date: 17 Dec 92 19:25:58 GMT
  7. Sender: news@mintaka.lcs.mit.edu
  8. Organization: MIT Laboratory for Computer Science
  9. Lines: 50
  10.  
  11. Bug:  setuid/setgid do not properly limit authority.
  12. Example:
  13.    A program running as root,
  14.    after successfully calling setgid(100) and setuid(100),
  15.    thus allegedly adopting guest/usr authority,
  16.    can still delete files from root/security owned directories.
  17. Security impact:
  18.    User written programs which begin running as root,
  19.    (in my case, a /bin/login replacement),
  20.    and appear to safeguard the filesystem by becoming a unprivileged user,
  21.    may in fact still have the authority to do significant damage.
  22. Bug status:
  23.   - I have begun the tortuous IBM support process.  No feedback yet.
  24.   - I have heard that a related bug, and an associated workaround,
  25.    were posted to this list.  Also that they were reported to IBM and CERT,
  26.    and ignored by both.  ?
  27.  
  28. Demo:
  29.  
  30. Under AIX 3.2.1:
  31. % more program.c
  32. #include <unistd.h>
  33. #include <stdio.h>
  34. main (int argc,char**argv) {
  35.   if( setgid( 100 ) <0) { perror("setgid failed"); exit(1); }
  36.   if( setuid( 100 ) <0) { perror("setuid failed"); exit(1); }
  37.   execv(argv[1],&(argv[1]));
  38.   perror("execv failed");
  39.   exit(1);
  40. }
  41. % cc -o program program.c
  42. % su
  43. # mkdir          foodir
  44. # chown root     foodir
  45. # chgrp security foodir
  46. # chmod 775      foodir
  47. # touch          foodir/foofile
  48. # chown root     foodir/foofile
  49. # chgrp security foodir/foofile
  50. # chmod 775      foodir/foofile
  51. # /bin/ls -dl foodir
  52. drwxrwxr-x   2 root     security     512 Dec 17 13:14 foodir
  53. # /bin/ls -l  foodir/foofile
  54. -rwxrwxr-x   1 root     security       0 Dec 17 13:14 foodir/foofile
  55. # ./program /bin/rm -f foodir/foofile
  56. # /bin/ls -l  foodir/foofile
  57. foodir/foofile not found
  58.  
  59. Note: 
  60.  If chmod 755 foodir, rather than 775, then permission is correctly denied.
  61.