Re: [Acme] SNI extension for tls-alpn-01 challenge in draft-ietf-acme-ip-05

Ryan Sleevi <ryan-ietf@sleevi.com> Tue, 23 April 2019 18:15 UTC

Return-Path: <ryan.sleevi@gmail.com>
X-Original-To: acme@ietfa.amsl.com
Delivered-To: acme@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B7A0C1200E0 for <acme@ietfa.amsl.com>; Tue, 23 Apr 2019 11:15:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.647
X-Spam-Level:
X-Spam-Status: No, score=-1.647 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no 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 LFHleao5WnR3 for <acme@ietfa.amsl.com>; Tue, 23 Apr 2019 11:15:38 -0700 (PDT)
Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 C7D4912003E for <acme@ietf.org>; Tue, 23 Apr 2019 11:15:37 -0700 (PDT)
Received: by mail-ed1-f53.google.com with SMTP id k45so13509961edb.6 for <acme@ietf.org>; Tue, 23 Apr 2019 11:15:37 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SaoiGCz+xc+tmCGWOBg6pg4IKkFOPvY4OjbBvFITu0A=; b=WY34SKeijHnO8CqzpWSMKmgW6+6Ms2g6XocUrW4hy+NXlZ2ucESQS8+PSoDl3g5LX5 TGvLO6oUDt4JfQGqt9Pt25AiWzTJ1hu5LY7CN5FYdScDgLXC8nqdHVjTIOHP3QaUKH6X h3oWk4Isml/qdqrGsqS3mY9PiL+T+dIMQDAvQnCMFt5OXk9aCQEgC1EhiG7xDlIznUeU uxbZ7N82ptwq78Tvo59NBM5vbwcYHfWlSys6ZAEdhuotioRmeIu+OkG5f/zTQUaoiFD4 YhYgO+H+AYkOh7P4l2W+OyNqOMlP+/V48n1ufRFFZh96fDTA+qGBr4PVhZ1WYiruFfUO +JbQ==
X-Gm-Message-State: APjAAAVtWs/wmD+IPTs9b+6pGH+iD9qQ44eLzrBTvXiiN5YjHTG1EVv4 +OPiq6qeN1BJ4b8U8upcUp+wOkSv
X-Google-Smtp-Source: APXvYqyEtLrTsnL17UYFxW/rnqNhaFJj+qAcZddMjKnX2GFXEG4s5XX6wvJwFuKH71GlORpEKrVLPw==
X-Received: by 2002:a17:906:bc1:: with SMTP id y1mr10404329ejg.110.1556043334030; Tue, 23 Apr 2019 11:15:34 -0700 (PDT)
Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com. [209.85.221.41]) by smtp.gmail.com with ESMTPSA id u18sm3093146eja.25.2019.04.23.11.15.33 for <acme@ietf.org> (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 11:15:33 -0700 (PDT)
Received: by mail-wr1-f41.google.com with SMTP id c5so12573746wrs.11 for <acme@ietf.org>; Tue, 23 Apr 2019 11:15:33 -0700 (PDT)
X-Received: by 2002:a5d:6101:: with SMTP id v1mr18058664wrt.222.1556043333169; Tue, 23 Apr 2019 11:15:33 -0700 (PDT)
MIME-Version: 1.0
References: <MN2PR18MB28457CCBEF6FFE2B70E286FCC3250@MN2PR18MB2845.namprd18.prod.outlook.com> <CAErg=HGYuRc+tOBwRedx5a9tnH9iVm3bfWYhfXeiHCgcvp8gMA@mail.gmail.com> <MN2PR18MB2845DBA634A0BC648222C627C3230@MN2PR18MB2845.namprd18.prod.outlook.com>
In-Reply-To: <MN2PR18MB2845DBA634A0BC648222C627C3230@MN2PR18MB2845.namprd18.prod.outlook.com>
From: Ryan Sleevi <ryan-ietf@sleevi.com>
Date: Tue, 23 Apr 2019 14:15:21 -0400
X-Gmail-Original-Message-ID: <CAErg=HG=LgqDxZ8QxVSAq2K6MsKJX36o6O7v0ojS3rsgUXuHVw@mail.gmail.com>
Message-ID: <CAErg=HG=LgqDxZ8QxVSAq2K6MsKJX36o6O7v0ojS3rsgUXuHVw@mail.gmail.com>
To: Corey Bonnell <cbonnell@outlook.com>
Cc: Ryan Sleevi <ryan-ietf@sleevi.com>, "acme@ietf.org" <acme@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000020f96105873692ca"
Archived-At: <https://mailarchive.ietf.org/arch/msg/acme/IFz8oAbrJo5qxcVHgLaOkc4rWvE>
Subject: Re: [Acme] SNI extension for tls-alpn-01 challenge in draft-ietf-acme-ip-05
X-BeenThere: acme@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Automated Certificate Management Environment <acme.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/acme>, <mailto:acme-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/acme/>
List-Post: <mailto:acme@ietf.org>
List-Help: <mailto:acme-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/acme>, <mailto:acme-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Apr 2019 18:15:41 -0000

Good points!

I can't speak for the draft authors here, but my understanding and
expectation was, in part in response to the concerns with tls-sni mitigated
by tls-alpn, to ensure there's a strong binding from the request to the
response, and that the binding is unambiguous.

What I mean by that is that in the case of tls-sni, there wasn't a strong
binding between the host name of the challenge certificate and the host
name that the certificate would be issued for (the .invalid problem).
TLS-ALPN resolves this by introducing the ALPN identifier as the protocol
signal, and thus ensures a strong binding between the SNI name and the
final certificate - ensuring it's unambiguous as to what host name will be
challenged for.

As you note, TLS prohibits the use of the IP address in SNI, and thus makes
it difficult to have a strong binding between the name that the certificate
will be issued for and the challenge certificate. This leaves two options:
introduce an alternative way to encode the challenged-for IP in the request
(which the draft does) or omit it entirely (as I believe you're proposing).
If we go with the former approach, encoding it in the request, than servers
that are dispatching the request can ensure that it's only dispatched to
the entity responsible for the IP address encoded. If we go with the latter
approach, then servers would need to ensure that the SNI-less responses can
only be provided on the particular party authorized for that IP address.

The latter only becomes a consideration if multiple IPs are terminated at
the same TLS layer, and that TLS termination layer doesn't consider the
destination IP when dispatching certificates. If we were to omit the
binding, it'd likely be worthy of a security consideration to specify
guidance as to how to do so safely / considerations that should be done
before enabling TLS-ALPN in the context of IP. Alternatively, if we assume
they took the necessary steps for TLS-ALPN, then encoding the domain in the
SNI allows the existing dispatch protection mechanisms to work will
continue to work.

That's, at least, how I've viewed it :)

On Mon, Apr 22, 2019 at 9:21 PM Corey Bonnell <cbonnell@outlook.com> wrote:

> Hi Ryan,
> I suppose I should have framed my email a bit more generally as opposed to
> focusing specifically on the security aspects. More broadly, I'm having a
> hard time coming up with a reason why the SNI extension must be included at
> all for IP address challenges. In the normal TLS connection flow, a
> connection by direct IP address (not hostname) would not include the SNI
> extension at all, so mandating the use of the .arpa domain in the SNI is
> inconsistent with normal TLS processing. This inconsistency is compounded
> when you consider that the self-signed cert for the challenge encodes the
> IP address as an iPAddress SAN (and not the .arpa dNSName). I could also
> see someone being confused upon reading the spec and thinking that a DNS
> A/AAAA record lookup against the in-addr/ipv6.arpa domain must be performed
> and that the challenge TLS connection is to be done against the resolved IP
> address.
>
> I believe it would be more consistent with normal TLS processing and less
> confusing to prohibit the use of SNI altogether for IP address validations.
> However, I'd greatly appreciate any explanations as to why it is preferable
> to include the SNI extension.
>
> Thanks,
> Corey
>
> ------------------------------
> *From:* Ryan Sleevi <ryan-ietf@sleevi.com>
> *Sent:* Wednesday, April 17, 2019 1:05 AM
> *To:* Corey Bonnell
> *Cc:* acme@ietf.org
> *Subject:* Re: [Acme] SNI extension for tls-alpn-01 challenge in
> draft-ietf-acme-ip-05
>
>
>
> On Tue, Apr 16, 2019 at 9:55 PM Corey Bonnell <cbonnell@outlook.com>
> wrote:
>
> Hello,
>
> Draft-ietf-acme-ip-05 specifies that for the tls-alpn-01 challenge, an
> SNI value with the in-addr/ipv6.arpa domain name corresponding to the
> iPAddress being validated MUST be specified. I have a concern that this
> requirement suffers the same problem that rendered tls-sni-01 insecure:
> namely, an arbitrary user on a shared hosting provider could upload an
> arbitrary certificate for the required .ip-addr/ipv6.arpa domain, thus
> circumventing any security provided by the mandatory SNI extension.
>
> The mandatory ALPN extension prevents this from being exploited to obtain
> fraudulent certificates, but given how trivially the SNI requirement can be
> defeated in the same manner as for tls-sni-01, I don’t believe that
> requiring SNI provides any security value and is not necessary. If the
> intent for requiring the SNI extension is to convey to the TLS server that
> an IP address is being validated, couldn’t that similarly be accomplished
> by *not* specifying any SNI extension at all? Tls-apln-01 (for dNSNames)
> requires that a SNI value be specified, so TLS servers could differentiate
> between challenge requests for dNSNames and iPAddress based on the presence
> (or absence) of the SNI extension.
>
>
> I’m not sure I follow the attack scenario you’re describing. The value
> proposition of the ALPN method is that it’s indicative that the server does
> not “suffer the same problem that rendered sni-01 insecure”, precisely
> because it does not allow an arbitrary user to upload an arbitrary
> certificate while also responding with that ALPN identifier.
>
> Perhaps I misunderstood your question, but with the above invariant being
> the reason for the introduction of the ALPN method, if we assume it holds,
> do you still have concerns?
>
>