sux, an enhancer for su

Steve Peltz peltz at cerl.uiuc.edu
Sat Apr 27 08:33:37 AEST 1991


Yeah, yeah, enough already! Heck, I posted that a setuid script wasn't a good
idea even before anyone responded to me (other than e-mail complaining that it
wasn't source in alt.sources).

However, I do have one question regarding security (and lack thereof) in a
sh script.

The two major problems pointed out to me were that I assumed the path to
various programs, and that IFS can be set on a sh script.

However, I do notice that, at least in the version of sh on this Sun, if I
enter:

IFS=

it will do the expected thing REGARDLESS of what the IFS already is. After
that, of course, I'll set:

PATH=/bin:/usr/ucb

and be done with it.

The only other security hole pointed out to me was more generic to any script,
not just a particular flavor of shell.

My other answer to making such a script secure would be to make it executable
only by group wheel. Since it is intended to allow anyone in group wheel to
execute it, there is no (additional) security problem.

All that aside, the main problem with my script is that it only sets the
effective uid, and I suspect that most su implementations require the
real uid to be set to root as well.

Thanks to everyone who took the time to politely (or not so politely) remind
me of the various problems with shell scripts. I apologize for not thinking
a bit more about the issues before posting a what seemed to be a simple
solution.
--
Steve Peltz
Internet: peltz at cerl.uiuc.edu	PLATO/NovaNET: peltz/s/cerl



More information about the Alt.sources.d mailing list