From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10952f,b69d377feb5a8a2 X-Google-Attributes: gid10952f,public X-Google-Thread: fcda7,d4c1f7c0fe672a4 X-Google-Attributes: gidfcda7,public X-Google-Thread: 1020c6,d4c1f7c0fe672a4 X-Google-Attributes: gid1020c6,public X-Google-Thread: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public X-Google-Thread: 10872d,d4c1f7c0fe672a4 X-Google-Attributes: gid10872d,public From: "Mark & Suzanne (gcs might work)" Subject: Re: Different UNIX pro's and con's. Date: 1998/09/22 Message-ID: <36079B1B.2781@s054.aone.net.au>#1/1 X-Deja-AN: 393621751 Content-Transfer-Encoding: 7bit References: <35F71814.1E0B911C@iakom.com> <6u5v9e$f0i$1@pravda.ucr.edu> <36069D3E.10DF1CFA@llnl.gov> <36069F96.E8127ED3@llnl.gov> <6u67ug$ccd@web.nmti.com> To: Peter da Silva Content-Type: text/plain; charset=us-ascii X-Trace: news.mel.aone.net.au 906467800 5058 203.12.186.8 (22 Sep 1998 12:36:40 GMT) Organization: Garetech Computer Solutions P/L Mime-Version: 1.0 NNTP-Posting-Date: 22 Sep 1998 12:36:40 GMT Newsgroups: comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec,comp.security.unix Peter da Silva wrote: > > This will protect files owned by "root". > > >If the program decides to delete a file, change the owner of the file to > >'nobody' (remember we're running as root here), then delete the file as > >'nobody'. Then this would work even for files owned by root. > > This would allow you to change the permissions of the file to "nobody". > > The real solution is to remove the directory name race by pinning the directory > down with a "cd". The real concern here is some small window to stick a symlink in place of part of the path. eg. /tmp/tst/passwd and at the exact moment remove tst/passwd and put a symlink of ln -s /etc /tmp so that the rm /tmp/tst/passwd does real damage. as the rm on its own will not follow a link nor will the find. The solution is to pin the directory path in /tmp by changing owner down the path to root:daemon or nobody:nobody then pass it again that way the evil user will not get to change the directory to a link they wont have the permission. I think given that its tmp the degree of subdirs is resonable to assume that if one like in a subdirectory of /tmp is old enough to remove then the whole tree goes. Otherwise you could not the permissions/owner before pinning the permissions and then put then back after the rm. I think the discussion is getting a little unrealistic. I think my disks are more likely to fail than a user actually achived any result :) esp. on a single processor machine just add up the system calls on the side of the attacker against the find -exec rm :) Cheers Mark :)