[26043] in bugtraq

home help back first fref pref prev next nref lref last post

Re: Three problems in OpenSSH's ssh-keysign

daemon@ATHENA.MIT.EDU (Theo de Raadt)
Wed Jul 3 02:45:11 2002

Message-Id: <200207030611.g636Bv8I029860@cvs.openbsd.org>
To: bugtraq@securityfocus.com
In-reply-to: Your message of "Wed, 03 Jul 2002 01:40:54 GMT."
             <200207030140.g631ess20085@nagasaki.sitaranetworks.com> 
Date: Wed, 03 Jul 2002 00:11:57 -0600
From: Theo de Raadt <deraadt@cvs.openbsd.org>

> 3) [Charles Hannum] The protection of host keys is not very good; to
>    wit:
> 
>         key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
>         key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
>                         
>         seteuid(getuid());
>         setuid(getuid()); 
> 
>    Although current BSD systems are safe (because they do not permit
>    PTRACE_ATTACH, et al, on processes that were ever set-id), this may
>    permit direct reading of the host keys by users on other systems.

First off, we believe that any system which has weak handling of such
setuid or setgid processes is flawed.  But let me continue before
anyone freaks out at that strong assertion.

There is a tradeoff being made here.  Either

1) We continue running as root, any exploitable bug in any code after
   that point can gain root.

or

2) We drop root, and any bug after that point can gain those file
   descriptors, and those files.

We choose 2.

That said, we very strongly believe that any system which does not
have strong de-permit semantics for ptrace and any other such calls
will continue to have serious security problems in the future.  They
force application authors to keep large monolithic processes running
entirely as root.  This is not a sustainable or safe policy.  Time for
vendors to start fixing those systems, if they are not already fixed.

This way, we do not need to keep very large applications like ssh and
sshd running as setuid root all the time like ssh.com has to.


home help back first fref pref prev next nref lref last post