Re: [Curdle] Spencer Dawkins' Yes on draft-ietf-curdle-ssh-ext-info-12: (with COMMENT)

Spencer Dawkins at IETF <spencerdawkins.ietf@gmail.com> Wed, 13 September 2017 17:38 UTC

Return-Path: <spencerdawkins.ietf@gmail.com>
X-Original-To: curdle@ietfa.amsl.com
Delivered-To: curdle@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0A6BE133075; Wed, 13 Sep 2017 10:38:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 JX75MrBhyotP; Wed, 13 Sep 2017 10:38:41 -0700 (PDT)
Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CCEA91320D9; Wed, 13 Sep 2017 10:38:40 -0700 (PDT)
Received: by mail-yw0-x22a.google.com with SMTP id v72so2127367ywa.3; Wed, 13 Sep 2017 10:38:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9USCVkfubXJKK+4pkjd1b4z4UczuYsnkApkIXDVJRrA=; b=h/JSiom7xagDMy9COMXMtPK6XaynaHx2m7Mt0y202zPUjr58OVpzvunVf23KiDlhMh +AW8GQccLQ9Txx7nSnYufZzd4NBiFN4wyL5y6+QvLM75HNh2i1Cxigxx4pN9VtD5u7xK vxyLhT0zopVK82+yYPvfbOgWKEIxoMmqm9mpgEm8FGCDIRFdI5IbOv9zwwbSVuhA/Isa e9cvA/ueAccCZyW6BgFkblWtka/ZIncdYVRO2A8e2XpOP/bP+i9oeaKcSWp0+05L5aO7 fNS4QeUzTNlfJBOaog85zQF5MnZJHFBvNw8wCJ8JsxY09/qXIUHj+ZZ9GB/rZjmHIPvX FyWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9USCVkfubXJKK+4pkjd1b4z4UczuYsnkApkIXDVJRrA=; b=pfzQgXvlHM/dS/GNtrLbADSPxuWDYuYW2xpB/CNb6/d/BHrl8SD5Ban8BN+LoW/qeU +ZtgBYqdUcT8dJm8I1zVDPA1o1GP5qymxN4rcxEms9x6kNBq5pkp2KYTEbyuxb9xdPL1 B7ijWreRLj/VVAFmtvLOZFqA5ZiwtdKM9pxgRTkYZTs2xzEoBgOxY4VIt94cYieoBOvL uwmKrWvNwkhItoxdRUbLYs6mVdY0X2eGy9G0U3sY4IsT3Qew8KBw97kKZahRn089bquy nW9ZNURtciTtQrufGVlTFNJv694IAI8ex0i+P4/tIEXbxqdnCapJ/PIBr/ZICWFvEyDt 2J6g==
X-Gm-Message-State: AHPjjUg6+odhAvmqQhoRtOxniMsx5sBZJ35xHKJ08P00YIqo74kmyrKp KPj9IfwhN+/U8eeI6TOHg8vq9I9kiwa442+j9mA=
X-Google-Smtp-Source: ADKCNb626llkx2INHW4yjboI5Ik0T+oVxd9qWWZFEsrvWu+ls2EFMIex44oV+iEVOvWLQxzSTrkWF3JAP5F6xVkW/qc=
X-Received: by 10.37.162.193 with SMTP id c1mr15432283ybn.66.1505324319857; Wed, 13 Sep 2017 10:38:39 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.2.15 with HTTP; Wed, 13 Sep 2017 10:38:39 -0700 (PDT)
In-Reply-To: <CADPMZDA=sW1G2X4GsG4s51-dL=mXY0-d7k43WUtp5RXtAoZByw@mail.gmail.com>
References: <150524144548.17894.106479337730195058.idtracker@ietfa.amsl.com> <CADPMZDA=sW1G2X4GsG4s51-dL=mXY0-d7k43WUtp5RXtAoZByw@mail.gmail.com>
From: Spencer Dawkins at IETF <spencerdawkins.ietf@gmail.com>
Date: Wed, 13 Sep 2017 12:38:39 -0500
Message-ID: <CAKKJt-cAYcd936x5Wc-L5OB2-rygtZiZozxYxuMwyuO-2pVfmA@mail.gmail.com>
To: denis bider <denisbider.ietf@gmail.com>
Cc: The IESG <iesg@ietf.org>, Daniel Migault <daniel.migault@ericsson.com>, curdle-chairs <curdle-chairs@ietf.org>, curdle <curdle@ietf.org>, draft-ietf-curdle-ssh-ext-info@ietf.org
Content-Type: multipart/alternative; boundary="089e0828ff1c5b6100055915a188"
Archived-At: <https://mailarchive.ietf.org/arch/msg/curdle/AmMMIezkG_sJgqufZwwDn_YfLug>
Subject: Re: [Curdle] Spencer Dawkins' Yes on draft-ietf-curdle-ssh-ext-info-12: (with COMMENT)
X-BeenThere: curdle@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "List for discussion of potential new security area wg." <curdle.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/curdle>, <mailto:curdle-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/curdle/>
List-Post: <mailto:curdle@ietf.org>
List-Help: <mailto:curdle-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/curdle>, <mailto:curdle-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Sep 2017 17:38:43 -0000

Hi, Denis,

On Wed, Sep 13, 2017 at 1:11 AM, denis bider <denisbider.ietf@gmail.com>
wrote:

> Hello,
>
> replies below:
>
>
> > In this text,
> >
> >  Implementations MUST NOT send an incorrect indicator name for their
> >  role. Implementations MAY disconnect if the counter-party sends an
> >  incorrect indicator. If "ext-info-c" or "ext-info-s" ends up being
> >  negotiated as a key exchange method, the parties MUST disconnect.
> >
> > why would a party that doen't support this extention disconnect?
>
> This language clarifies a corner case that's not expected to happen.
> Algorithm negotiation in SSH works like this:
>
> For each algorithm type (e.g. key exchange) and direction (for some
> algorithm types, e.g. encryption):
>
> - Server sends a comma-separated namelist of algorithm names in the
> initial KEX_INFO message. For example: "foo,bar,baz"
> - Client sends a similar list. For example: "baz,bar"
> - The negotiated algorithm is (1) the first algorithm in the client's list
> that (2) also appears in the server's list.
>
> In the above example, the negotiated algorithm is "baz".
>
> The "ext-info-s" and "ext-info-c" indicators are chosen so that two
> correct implementations will never negotiate either, because only clients
> send "ext-info-c", and only servers send "ext-info-s". If one of these
> algorithms is negotiated, it means either one of the sides is seriously
> buggy, or there's an attempt at some kind of attack. Therefore,
> implementations should disconnect.
>
> A party that doesn't support EXT_INFO will never see "ext-info-c" or
> "ext-info-s" being negotiated because it did not send it in its algorithm
> list. Therefore, it cannot be negotiated.
>

Bingo - that answers my question.

I was just making sure that a properly implemented SSH would disconnect
because this happens as a result of a protocol violation, so it works with
this way for SSLs that don't support this specification.

I'll leave determining the proper level of paranoia beyond that to the
professionals :-)


> This is unless the party that doesn't support EXT_INFO is sending randomly
> generated algorithm names and happens to hit upon that one. I trust no
> honest implementation does this, except for fuzzing. If something like
> fuzzing results in "ext-info-s" or "ext-info-c" being accidentally
> negotiated, the aware implementation - of course - is the one that
> disconnects.
>
>
> >   If this extension takes effect, the client MUST send the following
> >   message shortly after receiving SSH_MSG_USERAUTH_SUCCESS:
> >
> >      byte       SSH_MSG_NEWCOMPRESS (value 8)
> >
> > I THINK the point is that the client's SSH_MSG_NEWCOMPRESS
> > is sent after SSH_MSG_USERAUTH_SUCCESS, before the client
> > sends its first SSH message that's compressed using the newly
> > negotiated compression algorithm
>
> The implication here is that the client might have existing messages in
> flight to the server when the server sends SSH_MSG_USERAUTH_SUCCESS. This
> is not often the case, but it is possible: for example, user authentication
> takes some time, and the client sends a keep-alive message.
>
> Because of this potential race condition, the server must wait until it
> receives SSH_MSG_USERAUTH_SUCCESS before it assumes that compression in the
> client-to-server direction is in effect.
>
> The language says "shortly" because it's hard to say what delay is
> permissible here. Consider an intentionally pessimized case:
>
> - Suppose the server took extremely long to process the authentication
> attempt. It's not unheard of that login processing can take 5 minutes.
> - Suppose the client is set up to send frequent keep-alive messages to
> prevent routers from disconnecting the TCP session, but it does not require
> the server to respond to them.
> - Suppose the server blocks and does nothing while it's processing the
> login attempt.
>
> In these circumstances, the server may send SSH_MSG_USERAUTH_SUCCESS, only
> to find in its TCP input buffer a large number of keep-alive messages from
> the client which were sent while the server was processing. The server
> needs to be able to handle all of these messages without compression,
> before it can expect to receive the client's SSH_MSG_NEWCOMPRESS.
>
> My intent here was to encourage clients to send SSH_MSG_NEWCOMPRESS as
> soon as they are able, while at the same time encouraging servers to
> tolerate any reasonable number of packets from the client before this
> message is received - where "reasonable" may be, to some extent,
> implementation-defined.
>
> Based on this feedback, I'm leaning toward changing this language as
> follows:
>
> "If this extension takes effect, the client MUST send the following message
> within a reasonable number of outgoing messages after receiving
> SSH_MSG_USERAUTH_SUCCESS - but not necessarily as the first such outgoing
> message:"
>
> Maybe that makes it more clear. The existing, immediately following
> paragraph attempts to explain the context without trying to dwell on it too
> long:
>
>     The purpose of NEWCOMPRESS is to avoid a race condition where the
>     server cannot reliably know whether a message sent by the client was
>     sent before or after receiving the server's USERAUTH_SUCCESS.
>

Your proposed new text, together with the following paragraph, is clear
enough for me. Thanks for that.


> > I would find this easier to understand, if the paragraph defining the
> > terms was the first paragraph in the section, and then the description
> > of the extension (which uses the term "elevation") followed.
>
> No problem. Will move.
>
>
> > but I could imagine that adding elevation is the first step toward fewer
> > SSH server implementations that always run with administrative rights
> > just in case they ever need to use them, so the attack surface is
> > getting smaller?
>
> Yes, that is the case. If clients can't be expected to implement the
> "elevation" extension, Windows servers must elevate administrative users by
> default.
>
> In a parable - without "elevation", all sessions from administrative users
> have to run as "root" (on Windows), because there's no way to "sudo".
>
>
> > ... And now I see that Mirja also asked about elevation, and your
> answer to
> > her was pretty much what I had guessed.  Maybe it's worth summarizing
> > your answer in section 3.4.
>
> I will do so. :-)
>

This all seems perfect to me, Thanks.

Spencer