Re: enabling setuid -- what's the security issue? and how to do it?



On Nov 10, 10:01 pm, Keith Keller <kkeller-use...@xxxxxxxxxxx
francisco.ca.us> wrote:
On 2007-11-10, Bennett Haselton <benn...@xxxxxxxxxxxxx> wrote:
1) If user X sets the setuid bit as their script, then that just means
when user Y runs the script, it runs with the permissions of user X
instead of Y. But this means that the absolute worst that Y could do,
would just be things that X would be able to do under their own
account anyway. So the worst risk is that you'll allow someone to do
things as you (delete your files, etc.) but you wouldn't be putting
anybody else's data at risk, would you? So shouldn't it just be X's
prerogative if they want to put their own stuff at risk by setting the
setuid bit on their script?

Well, there are two issues: X can disclaim culpability for any security
exploits created by his programs by claiming that someone else did it
with his setuid script. If X happens to be root, things are that much
worse.

I guess it depends on whether the admin is willing to hold X just as
responsible for things that were done under his account, as for things
that were done by X deliberately.

If not, then there are a myriad other excuses that X could use (stuck
their password to their monitor, saved it in a client program on their
computer that was then compromised by spyware, etc.) in addition to
"someone ran my setuid script".

This is a webserver configuration issue: it sounds like the webserver is
running in a chroot jail. There are certainly many ways of getting
around this issue beyond running as setuid; either reconfigure the
chroot environment to allow reading of the log files, or don't run the
webserver in a chroot jail at all. Either of these are better than
allowing setuid scripts. There are probably other workarounds too.

What is the settings file that I could edit to configure which
directories the webserver is allowed to read from (currently limited
apparently to /tmp and /var/www )?

-Bennett

.



Relevant Pages

  • SUMMARY: Silly Little Question about SETUID
    ... A script losing the setuid bit when edited by non-root ... small compiled program that, using setuid privilege, executes a shell script ... wrapper, ...
    (SunManagers)
  • Re: Setuid problems with perl 5.8.4?
    ... >> I've got a perl script that runs setuid root. ... Or you could use an suid binary wrapper to run ...
    (comp.lang.perl.misc)
  • Re: /usr/local/etc/rc.d/ scripts and non-root user
    ... There's no particular reason that setuid bits on scripts are dangerous ... there used to be a race condition on opening files that meant it was ... Haven't need a setuid shell script in 15 years and I think I'll still keep it that way :-) It wasn't the right answer to the OPs original problem, ...
    (freebsd-questions)
  • Re: sudo not log command
    ... Sudothe script will still log the commands every min/two and i ... If I try setting chown to root for the script then setting suid on the ... Yes, in Linux, scripting languages don't recognize the setuid bit on script ...
    (comp.os.linux.misc)
  • Re: enabling setuid -- whats the security issue? and how to do it?
    ... If user X sets the setuid bit as their script, ... when user Y runs the script, it runs with the permissions of user X ... webserver in a chroot jail at all. ...
    (comp.os.linux.misc)