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: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1020c6,d4c1f7c0fe672a4 X-Google-Attributes: gid1020c6,public X-Google-Thread: fcda7,d4c1f7c0fe672a4 X-Google-Attributes: gidfcda7,public X-Google-Thread: 10872d,d4c1f7c0fe672a4 X-Google-Attributes: gid10872d,public X-Google-Thread: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public From: Barry Margolin Subject: Re: Secure cleaning of /tmp was Different Unixes pros & cons Date: 1998/09/21 Message-ID: #1/1 X-Deja-AN: 393327108 Distribution: world References: <35F71814.1E0B911C@iakom.com> <3602E82F.C8638268@llnl.gov> <6tuuep$kks@web.nmti.com> <360674DF.C1EDCEAF@llnl.gov> X-Trace: burlma1-snr1.gtei.net 906394449 4.2.32.97 (Mon, 21 Sep 1998 16:14:09 GMT) Organization: GTE Internetworking, Cambridge, MA NNTP-Posting-Date: Mon, 21 Sep 1998 16:14:09 GMT Newsgroups: comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec,comp.security.unix Originator: barmar@bbnplanet.com (Barry Margolin) In article <360674DF.C1EDCEAF@llnl.gov>, Jim Mellander wrote: >seems that by proper choosing of the directory name, it would be >possible to execute an arbritary program as root, since it is used as an >argument to cd. Could you explain this? How does using a directory as an argument to cd cause an arbitrary program to run? Are you thinking of something like creating a directory named ".;", so that when the script does: cd "$d" it will do the equivalent of: cd .; and execute the command? I just tried it and it didn't work: $ foo='.;echo baz' $ cd $foo ksh: cd: bad substitution Korn shell is complaining because the substitution contains a space. But even without this, it still isn't a problem: $ foo='.;echo' $ cd $foo $ mkdir $foo $ cd $foo /home/sa/barmar/.;echo See? No "arbitrary programs" have been executed. -- Barry Margolin, barmar@bbnplanet.com GTE Internetworking, Powered by BBN, Burlington, MA *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.