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

Peter Gutmann <pgut001@cs.auckland.ac.nz> Sat, 25 March 2017 09:39 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 45054120726 for <ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com>; Sat, 25 Mar 2017 02:39:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=auckland.ac.nz
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 HlsSqjfEEDO2 for <ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com>; Sat, 25 Mar 2017 02:39:43 -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 17676124BE8 for <secsh-tyoxbijeg7-archive@lists.ietf.org>; Sat, 25 Mar 2017 02:39:43 -0700 (PDT)
Received: by mail.netbsd.org (Postfix, from userid 605) id BF7BA855EE; Sat, 25 Mar 2017 09:39:42 +0000 (UTC)
Delivered-To: ietf-ssh@netbsd.org
Received: by mail.netbsd.org (Postfix, from userid 1347) id 6AEA7855ED; Sat, 25 Mar 2017 09:39:42 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 4C5C685570 for <ietf-ssh@netbsd.org>; Fri, 24 Mar 2017 08:53:18 +0000 (UTC)
X-Virus-Scanned: amavisd-new at netbsd.org
Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (2048-bit key) header.d=auckland.ac.nz
Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id jdX2ly0rJVQ8 for <ietf-ssh@netbsd.org>; Fri, 24 Mar 2017 08:53:17 +0000 (UTC)
Received: from mx4.auckland.ac.nz (mx4.auckland.ac.nz [130.216.125.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.netbsd.org (Postfix) with ESMTPS id 1315984CEA for <ietf-ssh@netbsd.org>; Fri, 24 Mar 2017 08:53:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=auckland.ac.nz; i=@auckland.ac.nz; q=dns/txt; s=mail; t=1490345597; x=1521881597; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Z33E0p7jjYebOKeH0dr3aguCYUA5q3jg5oh0rVeq8yM=; b=JJC43SCb8f17rra8YaJTcozIrDWeNlPLutUyG/FYqAwKF4RsHsuf6G+r PE0aksuuWtjqg8sn10xIDyOSkm3yB6NIxdY6xkSSWKoItk+gXiVK/19n7 R0qnyC7Yci+bquKCsB6SJh5UC+WaGJ7xppLdECPuaE50ZC8rnyT80SoWZ 0x5ntzNLxdX8lO7e2EiBVLYxf5RXzxYw3s7sZt/MW/o7enMK2ysQgXfKk qvSxZ/28X0snuY6Gwnl4fLvRYJlK22DYEjCgaIODWuMTj7RRzucxCoY7W Odh7h3c0khBO1DPOZntOyIW8nSrrDS0BGA9jtMFt4aGF/yWoxgwF31UpB w==;
X-IronPort-AV: E=Sophos;i="5.36,213,1486378800"; d="scan'208";a="145188219"
X-Ironport-HAT: MAIL-SERVERS - $RELAYED
X-Ironport-Source: 10.6.3.4 - Outgoing - Outgoing
Received: from uxcn13-tdc-c.uoa.auckland.ac.nz ([10.6.3.4]) by mx4-int.auckland.ac.nz with ESMTP/TLS/AES256-SHA; 24 Mar 2017 20:22:38 +1300
Received: from uxcn13-ogg-d.UoA.auckland.ac.nz (10.6.2.5) by uxcn13-tdc-c.UoA.auckland.ac.nz (10.6.3.24) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 24 Mar 2017 20:22:37 +1300
Received: from uxcn13-ogg-d.UoA.auckland.ac.nz ([10.6.2.25]) by uxcn13-ogg-d.UoA.auckland.ac.nz ([10.6.2.25]) with mapi id 15.00.1178.000; Fri, 24 Mar 2017 20:22:37 +1300
From: Peter Gutmann <pgut001@cs.auckland.ac.nz>
To: "denis bider (Bitvise)" <ietf-ssh3@denisbider.com>, "ietf-ssh@netbsd.org" <ietf-ssh@netbsd.org>
CC: "djm@mindrot.org" <djm@mindrot.org>, Simon Tatham <anakin@pobox.com>
Subject: Re: Fixing exchange of host keys in the SSH key exchange
Thread-Topic: Fixing exchange of host keys in the SSH key exchange
Thread-Index: AQHSo6JCh/pnJs1+UUq8ewlt+ue/5qGjlx6Q
Date: Fri, 24 Mar 2017 07:22:37 +0000
Message-ID: <1490340148872.12344@cs.auckland.ac.nz>
References: <2216143EDEE342A3A5C9BB786F7FEF7A@Khan>
In-Reply-To: <2216143EDEE342A3A5C9BB786F7FEF7A@Khan>
Accept-Language: en-NZ, en-GB, en-US
Content-Language: en-NZ
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [130.216.158.4]
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Sender: ietf-ssh-owner@NetBSD.org
List-Id: ietf-ssh.NetBSD.org
Precedence: list

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.