From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,3c3a49f100a52d3e,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2004-01-30 01:37:47 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: chiefglider@gmx.de (Karl-Heinz Nausenack) Newsgroups: comp.unix.tru64 Subject: strange "su" behaviour Date: 30 Jan 2004 01:37:47 -0800 Organization: http://groups.google.com Message-ID: <2525cdab.0401300137.533018f2@posting.google.com> NNTP-Posting-Host: 132.176.114.21 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1075455467 17694 127.0.0.1 (30 Jan 2004 09:37:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 30 Jan 2004 09:37:47 +0000 (UTC) Xref: archiver1.google.com comp.unix.tru64:11142 "su" behaves not in the expected way. For example (wwwuser is the user for the WWW server, but every other user, local or from NIS, shows the same behaviour; guest is a NIS user) At first, login as wwwuser: $ id uid=201(wwwuser) gid=65534(nobody) groups=0(system) $ su Password: # id uid=0(root) gid=1(daemon) groups=0(system),3(mem),7(terminal),9(opr),12(lp) # su guest bash-2.05a$ id uid=3170(guest) gid=2777(guests) bash-2.05a$ su wwwuser $ id uid=201(wwwuser) gid=65534(nobody) groups=0(system) $ /usr/sbin/sizer -v Compaq Tru64 UNIX V5.1 (Rev. 732); Fri Mar 21 16:36:25 CET 2003 Note, that the command "su wwwuser" did not ask for a password. This doesn't happen in Tru64 4.0F, but on a dozen machines running 5.1. I use the terms "wwwuser" and "guest" just to relieve the explanation, you can change this to every other user. In fact, it is possible to su to any user, whoms parent process has done the su command before. This is especially a problem for processes which were initially started by root, as the WWW-Server (Apache starts up when booting and then switches to wwwuser): with the "su" command in an CGI script it is possible to setuid to any user without knowing his password and even to root. In this case the wwwuser does not have to be a member of the system group. I can not reproduce this on any other Unixoid, so I think, we have a security hole here. Do you know, how to fix it? Please excuse the use of a pseudonym, but I think it's better, if our students find the security holes by their own.