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

Mouse <mouse@Rodents-Montreal.ORG> Sun, 26 March 2017 07:05 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 3D79D129431 for <ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com>; Sun, 26 Mar 2017 00:05:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.201
X-Spam-Level:
X-Spam-Status: No, score=-4.201 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 HlaqOtdx4aQi for <ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com>; Sun, 26 Mar 2017 00:05:52 -0700 (PDT)
Received: from mail.netbsd.org (mail.NetBSD.org [IPv6:2001:470:a085:999::25]) (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 6628A1243F6 for <secsh-tyoxbijeg7-archive@lists.ietf.org>; Sun, 26 Mar 2017 00:05:52 -0700 (PDT)
Received: by mail.netbsd.org (Postfix, from userid 605) id 918E0855BE; Sun, 26 Mar 2017 07:05:50 +0000 (UTC)
Delivered-To: ietf-ssh@netbsd.org
Received: by mail.netbsd.org (Postfix, from userid 1347) id 502E584CE1; Sun, 26 Mar 2017 07:05:50 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id AA8C585604 for <ietf-ssh@NetBSD.org>; Sat, 25 Mar 2017 12:27:39 +0000 (UTC)
X-Virus-Scanned: amavisd-new at netbsd.org
Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id SBMAGlxsLHgJ for <ietf-ssh@netbsd.org>; Sat, 25 Mar 2017 12:27:39 +0000 (UTC)
Received: from Stone.Rodents-Montreal.ORG (Stone.Rodents-Montreal.ORG [98.124.61.89]) by mail.netbsd.org (Postfix) with ESMTP id 84EE385600 for <ietf-ssh@NetBSD.org>; Sat, 25 Mar 2017 12:27:38 +0000 (UTC)
Received: (from mouse@localhost) by Stone.Rodents-Montreal.ORG (8.8.8/8.8.8) id IAA20189; Sat, 25 Mar 2017 08:27:37 -0400 (EDT)
Date: Sat, 25 Mar 2017 08:27:37 -0400
From: Mouse <mouse@Rodents-Montreal.ORG>
Message-Id: <201703251227.IAA20189@Stone.Rodents-Montreal.ORG>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Erik-Conspiracy: There is no Conspiracy - and if there were I wouldn't be part of it anyway.
X-Message-Flag: Microsoft: the company who gave us the botnet zombies.
X-Composition-Start-Date: Sat, 25 Mar 2017 07:43:11 -0400 (EDT)
To: ietf-ssh@NetBSD.org
Subject: Re: Fixing exchange of host keys in the SSH key exchange
In-Reply-To: <1490340148872.12344@cs.auckland.ac.nz>
References: <2216143EDEE342A3A5C9BB786F7FEF7A@Khan> <1490340148872.12344@cs.auckland.ac.nz>
Sender: ietf-ssh-owner@NetBSD.org
List-Id: ietf-ssh.NetBSD.org
Precedence: list

>> (1) Security benefit: although [...]; 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.

How?  As far as I can see, this affects the user only in that "pick up
the host key on first connect" no longer works.  In particular...

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

...I can't see how it affects the user if the client already has a
correct host key for the server.

>> (2) Security benefit: [...]
> This is really just an awkward form of port-knocking.

Awkward?  _Less_ awkward in some respects - significantly easier to set
up in most cases, for example, with no need for anything client-side
beyond a client that knows the extension.  But weaker in other
respects; for example, it reveals the presence of an ssh server to
anyone, even someone who doesn't know the knock (well, probable
presence; nothing says someone can't use port 22 for something else).

>> 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, of course.  But note that the spec does not say that the
_client_ may send text before its version string, only that the
_server_ may.  (Or, at least, if it says that about the client, I
haven't found where.)

Furthermore, just because some implementations are broken (if the
consensus is that that constitutes brokenness, of course) is not a
reason to fail to call them on their brokenness.  I've run into ssh
servers that fall over hard when confronted with clients using the
string@domainname extension mechanism.  Should we stop using it as a
result?  No, we should get the relevant servers fixed (and, as an
interim measure for the immediate term, tell clients to not use
extensions when talking with such broken servers).

> 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.

Well, if the consensus is that the client is allowed to send text
there (if not, this becomes a private protocol change, not suitable for
interoperation use), then my stance is that that's their problem.  My
advice for users dealing with such servers would be "either get the
server fixed or turn off the extension when using it".

> 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.

Then this suggestion has the additional feature that it will smoke out
such bugs!

Hmm, I think I'll give moussh a configuration option to send things
before the ID string, for exactly that reason.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse@rodents-montreal.org
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B