tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Alan Cox <coxa () cableol ! net>
To: tru64-unix-managers
Subject: SUMMARY: Non-privileged user to reset passwords?
Date: Fri, 30 Aug 1996 11:30:08 +0000	[thread overview]
Message-ID: <96076337821777.tru64-unix-managers.marc@archive.invalid> (raw)

> then try use wrappiner program.
> 
>  main()
>  {
>   setuid(0);
>   system( "YOUR SCRIPT HERE" );
>  }
> 
> * SCRIPT name FULL-PATH only! for security.
>                                and use this wrapper.
> 

I wouldnt normally reply this back to the list but NEVER NEVER use this
example program as is. The system command feeds its string through the shell.

Thus if you have a program called "secure"

	system("/usr/local/bin/my_command");

a user can do

IFS="/ "
export IFS
secure

and it will feed /usr/local/bin/my_command to the shell. IFS says what
things are seperators between words and the shell will effectively run

	usr local bin my_command

running a program "usr" provided by the user on the machine as root.


Users may also set resource limits and cause the setuid program to break
(a long time ago things like ulimit 0; passwd blanked the passwd file).


If you want to do this right, use something like sudo that is basically
safe or read the security list stuff on writing secure setuid application
things. That generally means it needs to remove resource limits, clean
the environment variables, set the signal handlers up nicely then use
execle/execve to safely run the binary. I would recommend the latter path.

Alan

             reply	other threads:[~1996-08-30 11:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-30 11:30 Alan Cox [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-08-30 16:52 SUMMARY: Non-privileged user to reset passwords? Craig Makin
1996-08-30 17:03 Craig Makin
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox