Re: Bug in ssh client (open ssh 2.3.0)

2001-02-12 Thread Tatu Ylonen

 OpenSSH's client drops all privileges before the user is asked for a
 password, so there is really no need to panic and send ads to this list
 -- especially since this thread not at all related to SSH-1.  However,
 if you are afraid of SSH-1 you can simply turn off protocol 1 support
 in OpenSSH and happily use SSH-2 only.

This is not a protocol issue but an implementation issue, and is not
related to which protocol is used in "OpenSSH".  I just took a quick look
at this in "OpenSSH 2.3.0" source.  On line ssh.c:624, it says:

/*
 * Note that some legacy systems need to postpone the following call
 * to permanently_set_uid() until the private hostkey is destroyed
 * with RSA_free().  Otherwise the calling user could ptrace() the
 * process, read the private hostkey and impersonate the host.
 * OpenBSD does not allow ptracing of setuid processes.
 */
permanently_set_uid(original_real_uid);

While OpenBSD may be safe from the risk of attaching with debugger, there
are other systems in use that are vulnerable.  Several years ago,
when I wrote the original code for SSH1, I did a quick study on whether
various systems allow debugging the process after restoring the user's
privileges.  I found several widely used systems that did allow attaching
with a debugger after the process had relinquished suid privileges.
(Unfortunately, I no longer remember which systems were affected.)

I did a quick test now (at only a few systems), and the situation
seems to have improved.  At least Solaris 2.6, Digital Unix 4.0,
linux-2.2.12, NetBSD 1.3.2 were safe, and presumably newer versions of
these are also ok.  I did not check other platforms.  However, 
there may still be older systems in use where it is not safe to relinguish
the privileges.  Old installations in production live suprisingly long
without upgrades.

On those systems that are affected by the problem, this results 
in private key compromise, allowing impersonation of any user on the
server and impersonating the server itself for password stealing or
man-in-the-middle attacks.  The attacks are relatively simple to implement
in practise.

To eliminate the risk, SSH1 keeps the extra privileges until
authentication is complete.  SSH2 approaches this differently; the client
is not suid at all, and there is a small, easier to analyze helper
application that accesses the local host key.  Thus, even if there was a
bug in the client, it holds no sensitive information.

I would recommend something similar for "OpenSSH", either moving the call
back to where it was in SSH1 (i.e., after authentication) or alternatively
changing the architecture to something similar to that in SSH2.  It is,
in my opinion, a lesser evil to face the unknown risk of keeping the suid
rights a little longer than to include a serious known vulnerability for
some systems, even if the affected systems are slightly older.

Tatu

SSH Communications Security   http://www.ssh.com/
SSH IPSEC Toolkit http://www.ipsec.com/
SSH(R) Secure Shell(TM)   http://www.ssh.com/products/ssh

 
 Moreover, we never received a report on this or a similar problem and
 it's not reproducible for us, so it seems your setup is broken (do you
 have a stack backtrace).
 
 -m
 
 On Fri, Feb 09, 2001 at 09:59:34AM +0100, Tomasz Kuniar wrote:
  Ssh client is suid, so it could be real problem. Must check source...
 
 On Sat, Feb 10, 2001 at 02:42:23PM +0200, Tatu Ylonen wrote:
  SSH2 also fixes fundamental security problems in the old SSH1 protocol.
  SSH1 is DEPRECATED, and people are strongly encouraged to move to using
  the SSH2 protocol.
  
  The latest version of SSH2 is ssh-2.4.0, available from
  ftp://ftp.ssh.com/pub/ssh.  SSH2 is completely free for any use on Linux,
  FreeBSD, NetBSD, and OpenBSD, as well as for use by universities and
  charity organizations, and for personal hobby/recreational use by
  individuals. (For commercial use, please see http://www.ssh.com/.)
 



Re: Bug in ssh client (open ssh 2.3.0)

2001-02-10 Thread Ben Greenbaum

Nobody else yet has confirmed this:

--
From: "Jeffrey W. Baker" [EMAIL PROTECTED]

Curious.  It doesn't do that here on Slackware-current (Linux 2.4.1, glibc
2.2.1, gcc 2.95.2):

jwb@manchurian-candidate:~$ ssh jwb@heat
jwb@heat's password:
Permission denied, please try again.
jwb@heat's password:
Permission denied, please try again.
jwb@heat's password:
Permission denied.
jwb@manchurian-candidate:~$ ssh -l jwb heat
jwb@heat's password:
Permission denied, please try again.
jwb@heat's password:
Permission denied, please try again.
jwb@heat's password:
Permission denied.
jwb@manchurian-candidate:~$ ssh -V
SSH Version OpenSSH_2.3.0p1, protocol versions 1.5/2.0.
Compiled with SSL (0x0090581f).


From: [EMAIL PROTECTED] (Bostjan Muller)

This does not happen on my machine - debian 2.2  SSH Version OpenSSH_2.3.0p1,
protocol versions 1.5/2.0. Compiled with SSL (0x0090581f). Kernel 2.4.1 or
kernel 2.2.18 or kernel 2.2.16 I tested it on 4 machines, not one of them
segfaultet.

--
From: =?iso-8859-1?Q?M=E5ns_Nilsson?= [EMAIL PROTECTED]

What OS? I have it on several BSDen and Solaris. Works just nice.

--
From: [EMAIL PROTECTED]

NOT confirmed, however i use rh7's openssh-clients package:

[kerouac:mg:~]ssh mgerber@noc
ssh: noc: Name or service not known
[kerouac:mg:~]ssh mgerber@noc
mgerber@noc's password:
Permission denied, please try again.
mgerber@noc's password:
Permission denied, please try again.
mgerber@noc's password:
[kerouac:mg:~]which ssh
/usr/bin/ssh
[kerouac:mg:~]ls -la /usr/bin/ssh
-rwsr-xr-x1 root root   176932 Nov 21 23:53 /usr/bin/ssh
[kerouac:mg:~]ssh -V
SSH Version OpenSSH_2.3.0p1, protocol versions 1.5/2.0.
Compiled with SSL (0x0090581f).
[kerouac:mg:~]rpm -qf /usr/bin/ssh
openssh-clients-2.3.0p1-4


Ben Greenbaum
Director of Site Content
SecurityFocus
http://www.securityfocus.com



Bug in ssh client (open ssh 2.3.0)

2001-02-09 Thread Tomasz Kuniar

hi,
When Michal Zalewski found bug in ssh, most people tried to reinstall
their ssh. They usualy install openssh 2.3.0 or higher, or ssh2.com

Well, it could not be the best fix using openssh client 2.3.0p1 (i dont
check other ver.).
I've compile it from sources, so look at it:

mezon@ania:~$whereis ssh
ssh: /usr/local/bin/ssh
mezon@ania:~$ls -al /usr/local/bin/ssh
-rws--x--x   1 root root   663364 Feb  8 14:48
/usr/local/bin/ssh*
mezon@ania:~$ssh mezon@ania
mezon@ania's password:
Segmentation fault
mezon@ania:~$


When it crash? heh, there must be some conditions:
1. on my host : mist be typed "ssh -l mezon ania" or ssh mezon@ania
(When using full ip or address it will not segv)
2. when password prompted, You will have to type some chars, then
press BACKSPACE button , and next ENTER

Ssh client is suid, so it could be real problem. Must check source...

Mezon
--
Tomasz Kuzniar [EMAIL PROTECTED]
* Polska Platforma Internetowa *
  ~ ~ ~
"Wioska zabita dechami - Village killed by desks"



Re: Bug in ssh client (open ssh 2.3.0)

2001-02-09 Thread rafal wiosna

* Tomasz Kuniar wrote:
 Ssh client is suid, so it could be real problem. Must check source...

SUID is only needed when using rhosts or rshost-rsa authentication.
Many installations don't need it. Just set this option [taken from man ssh]:

 UsePrivilegedPort
 Specifies whether to use a privileged port for outgoing connec-
 tions.  The argument must be `yes'' or `no''. The default is
 `yes''. Note that setting this option to `no'' turns off
 RhostsAuthentication and RhostsRSAAuthentication.

--
__
rafal wiosna * Polbox On-Line Service * Fidonet 2:480/33 * In ARP we trust
Powered by /usr/local/bin/joe B.O.F.P (alias|free).polbox.pl admin * AR155
RAFD-RIPE * PGP nyckeln finns tillgnglig p www.se.pgp.net (ID: 3CDCB7A9)