Re: Fixing exchange of host keys in the SSH key exchange

"denis bider \(Bitvise\)" <ietf-ssh3@denisbider.com> Sat, 25 March 2017 19:10 UTC

Return-Path: <bounces-ietf-ssh-owner-secsh-tyoxbijeg7-archive=lists.ietf.org@NetBSD.org>
X-Original-To: ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com
Delivered-To: ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 906B2124234 for <ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com>; Sat, 25 Mar 2017 12:10:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.646
X-Spam-Level:
X-Spam-Status: No, score=-2.646 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, STOX_REPLY_TYPE=0.439, TVD_FINGER_02=1.215, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=denisbider.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R0KzZ_H2-NDy for <ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com>; Sat, 25 Mar 2017 12:10:01 -0700 (PDT)
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A2D871252BA for <secsh-tyoxbijeg7-archive@lists.ietf.org>; Sat, 25 Mar 2017 12:10:01 -0700 (PDT)
Received: by mail.netbsd.org (Postfix, from userid 605) id 36B17855BC; Sat, 25 Mar 2017 19:10:01 +0000 (UTC)
Delivered-To: ietf-ssh@netbsd.org
Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id CDEA3855B7 for <ietf-ssh@netbsd.org>; Sat, 25 Mar 2017 19:09:55 +0000 (UTC)
X-Virus-Scanned: amavisd-new at netbsd.org
Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (2048-bit key) header.d=denisbider.com
Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 4WcsrVqm_1C3 for <ietf-ssh@netbsd.org>; Sat, 25 Mar 2017 19:09:55 +0000 (UTC)
Received: from skroderider.denisbider.com (skroderider.denisbider.com [50.18.172.175]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.netbsd.org (Postfix) with ESMTPS id 2A0B0855AF for <ietf-ssh@netbsd.org>; Sat, 25 Mar 2017 19:09:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=denisbider.com; s=mail; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=41QjRDozVcoP6T5bMxuubtfLq/nUo4LVKETbi15LUSA=; b=St5oFHQds6HtWn2DOPPzr34PlaS6nvuZ59Qxmy+jXURMm8w6Y8W2TOERORVz+JJBFDUquAAlwnIpe R5voLd4cI3R3hcoEcVWqAgXmUkLsAGk7ioqJjDq6DWnUJ8hA9EDJcJEsAt2uosPBGpSbOaNfFn8ygq D+yb2Zl8BvGp4OfOKWUhh7u8DF+CdErvYFim3TJbcnNq+EdYZIkZQmS/6mQmYtGLNBaIWs+LBW5ZqA evndFAGvT4K+5DZuZXTUBaa/+41RC7oaaI9/7HmXQ0yX5dt/kICJMu0YencKG7NqDxKFBbea3DorfE 8GudiZqUqKvITJsiqKsLgSQaDI38e7w==
X-Footer: ZGVuaXNiaWRlci5jb20=
Received: from localhost ([127.0.0.1]) by skroderider.denisbider.com with ESMTPSA (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)); Sat, 25 Mar 2017 19:09:30 +0000
Message-ID: <EC92EEDA9D654E44A3E1B1844F50C174@Khan>
From: "denis bider (Bitvise)" <ietf-ssh3@denisbider.com>
To: Peter Gutmann <pgut001@cs.auckland.ac.nz>, ietf-ssh@netbsd.org
Cc: djm@mindrot.org, Simon Tatham <anakin@pobox.com>
References: <2216143EDEE342A3A5C9BB786F7FEF7A@Khan> <1490340148872.12344@cs.auckland.ac.nz>
In-Reply-To: <1490340148872.12344@cs.auckland.ac.nz>
Subject: Re: Fixing exchange of host keys in the SSH key exchange
Date: Sat, 25 Mar 2017 13:09:55 -0600
MIME-Version: 1.0
Content-Type: text/plain; format="flowed"; charset="Windows-1252"; reply-type="original"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 16.4.3528.331
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331
Sender: ietf-ssh-owner@NetBSD.org
List-Id: ietf-ssh.NetBSD.org
Precedence: list

Peter:


> > this prevents the situation where the client will present
> > the user with a host key verification dialog, and the user
> > will just click through it.
>
> It also makes things a lot more painful for the user.

It helps ensure secure host key configuration. There are administrators who 
would prefer this.

If this involves more pain than previously, the user was most likely not 
managing host key trust to the same standards.


> If you regularly need to SSH into a dozen different devices
> to administer them, it gets even worse.

This is meant for administrators who would want to enable this policy. This 
would be a server-side policy, so if you're administering machines, you 
could avoid configuring this policy.


> > drive-by password guessing becomes largely impossible,
> > since unknown attackers do not know the server’s host key.
>
> This is really just an awkward form of port-knocking.

Yes, and we have other mechanisms for this (e.g. protocol obfuscation). In 
this case, it's a nice effect you get for free, in case you enable this 
policy.


> > Server implementations that do not know about this extension,
> > but correctly implement the spec,
>
> How do we know what percentage of servers do this?

We don't, it would be necessary to test this.

Which means, probably, I would have to test this.

Mouse pointed out I was wrong about the spec. It turns out RFC 4253 provides 
for text before version string when sent by servers, not by clients. It's 
definitely necessary to test.

As discussed with Mouse, if this exact method doesn't work, there are 
alternatives. Server could send "expect-key" host key alg in KEXINIT, and 
client could send a new message SSH_MSG_EXPECT_KEYS after its KEXINIT. This 
would still solve the primary objective, but would not have all the same 
nice properties. E.g. the server could not use that to avoid fingerprinting.


> it has the potential to break lots of things

That seems to be the main potential downside of the method as presented.

But there are other ways to do it, and the suggested approach could be 
proven safe in testing.


denis


----- Original Message -----
From: Peter Gutmann
Sent: Friday, March 24, 2017 01:22
To: denis bider (Bitvise) ; ietf-ssh@netbsd.org
Cc: djm@mindrot.org ; Simon Tatham
Subject: Re: Fixing exchange of host keys in the SSH key exchange

denis bider (Bitvise) <ietf-ssh3@denisbider.com> writes:

>(1) Security benefit: although the client could still not verify the server’s
>signature during key exchange, or could do any number of other things
>incorrectly; under reasonable assumptions, if the client has to communicate
>one or more fingerprints of the server’s host key(s) before KEXINIT, this
>prevents the situation where the client will present the user with a host 
>key
>verification dialog, and the user will just click through it.

It also makes things a lot more painful for the user.  If you regularly need
to SSH into a dozen different devices to administer them, it gets even 
worse.

>(2) Security benefit: on servers that enable this policy, and prevent
>connections where the client does not communicate a correct server host 
>key,
>drive-by password guessing becomes largely impossible, since unknown
>attackers do not know the server’s host key.

This is really just an awkward form of port-knocking.  If you want to use a
port-knocking-style mechanism, you should probably do it properly.  If you
want to bind a client to a server ("only this client, only this server") 
then
there are better ways of doing it than this.

>Server implementations that do not know about this extension, but correctly
>implement the spec,

How do we know what percentage of servers do this?  It's true that the spec
says you should expect other stuff in the textual data, but since pretty 
much
everything out there only ever sends the SSH ID string, it's quite likely 
that
lots of implementations will choke on unexpected extra lines of text.  Even 
in
cases where the code does try and handle non-SSH-ID lines, the absence of
anything that sends them means it's probably never been tested.

This doesn't seem like a good idea, it has the potential to break lots of
things, while what you're getting in return could be done better in other
ways.

Peter.