Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Why was suid support dropped in perl?

Reply
Thread Tools

Why was suid support dropped in perl?

 
 
shrike@cyberspace.org
Guest
Posts: n/a
 
      10-19-2012
####
From the INSTALL file of 5.16:
suidperl was an optional component of earlier releases of perl. It is no
longer available. Instead, use a tool specifically designed to handle
changes in privileges, such as B<sudo>.
####

I imagine this has busted quite a few sysadmin tools across perls install base. Why the change?
 
Reply With Quote
 
 
 
 
Rainer Weikusat
Guest
Posts: n/a
 
      10-19-2012
"(E-Mail Removed)" <(E-Mail Removed)> writes:
> ####
> From the INSTALL file of 5.16:
> suidperl was an optional component of earlier releases of perl. It is no
> longer available. Instead, use a tool specifically designed to handle
> changes in privileges, such as B<sudo>.
> ####
>
> I imagine this has busted quite a few sysadmin tools across perls
> install base. Why the change?


I do not know who came up with the idea to install the perl
interpeter(!) as setuid-0 program because providing a functionally
equivalent facility in C is so dead easy: Just compile the program
below, install as 'setuid whatever you want to' and all other local
users will be able to execute arbitrary code with the desired
privilege level.

#include <unistd.h>

int main(int argc, char **argv)
{
setuid(geteuid());
execvp(argv[1], argv + 1);
return 0;
}
 
Reply With Quote
 
 
 
 
shrike@cyberspace.org
Guest
Posts: n/a
 
      10-20-2012
On Friday, October 19, 2012 5:48:03 PM UTC-4, Ben Morrow wrote:
> Quoth "(E-Mail Removed)" <(E-Mail Removed)>:
>
> > ####

>
> > From the INSTALL file of 5.16:

>
> > suidperl was an optional component of earlier releases of perl. It is no

>
> > longer available. Instead, use a tool specifically designed to handle

>
> > changes in privileges, such as B<sudo>.

>
> > ####

>
> >

>
> > I imagine this has busted quite a few sysadmin tools across perls

>
> > install base. Why the change?

>
>
>
> suidperl has had many security problems over the years, has not been
>
> part of the default install for a long time, and has been explicitly
>
> deprecated in INSTALL since at least 5.10.0. The design of suidperl
>
> requires it to link all of the argument-parsing code of perl itself,
>
> which is rather complicated and not something you want to link into a
>
> vulnerable program if you can help it. In practice using sudo instead is
>
> pretty-much never a problem.
>
>
>
> Ben


It turns out I have run into such a problem: running a driver written in perl on a remote host via SSH. Either I turn off the tty requirement for sudoon the whole box, or I embed perl. I would much rather make a fifo, fork and seteuid() down to nobody to isolate privs.

In terms of making a redistributable package, if I touch sudo then I have to support sudo, and if I use a cheap wrapper, it looks kludgy. To embed I have to code in C, and frankly my C leaves something to be desired. Python does support suid I think, but I'm not adding more interpreters to my box.

Embedding perl is a pretty tall order just to get a monolithic redistributable out of the deal. Any other options?

 
Reply With Quote
 
shrike@cyberspace.org
Guest
Posts: n/a
 
      10-29-2012
On Tuesday, October 23, 2012 7:29:35 PM UTC-4, Andrew Gideon wrote:
> On Sat, 20 Oct 2012 09:59:11 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>
>
>
> > It turns out I have run into such a problem: running a driver written in

>
> > perl on a remote host via SSH.

>
>
>
> Why not permit SSH to root using a key pair with a command restriction?
>
> Since the command runs as root, there's no su-ing required.
>
>
>
> This does have the risks associated with the program itself running as
>
> root, but you'd have those anyway, right?
>
>
>
> - Andrewq


Because then I would have to support public key rhost based authentication for sshd, which is an even worse proposition than supporting sudo. If I touch _anything_ else, I own it. All I can reasonably expect to secure or support is _my_ code. This is the basic reality of software support.

My concern is not whether _I_ can use it. My concern is whether somebody else can use it by following a short set of instructions. "chmod +s" works. sudo or rhost+sshd is a 3 hour support call. And I'm not going to tell somebody to turn on remote access for the root account for sshd, when I have no reasonable expectation that they understand the consequences of doing so.







 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re. suid/sudo in python Rustom Mody Python 3 03-31-2009 06:47 AM
suid/sudo in python rustom Python 0 03-30-2009 06:35 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
suid-perl deprecated... why? chris-usenet@roaima.co.uk Perl Misc 4 12-06-2004 09:09 AM
Re: suid Python script Jeff Epler Python 0 08-24-2003 07:54 PM



Advertisments