Re: [TLS] TLS 1.3, Raw Public Keys, and Misbinding Attacks

Viktor Dukhovni <ietf-dane@dukhovni.org> Thu, 28 March 2024 17:33 UTC

Return-Path: <ietf-dane@dukhovni.org>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 65682C14F60A for <tls@ietfa.amsl.com>; Thu, 28 Mar 2024 10:33:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.097
X-Spam-Level:
X-Spam-Status: No, score=-7.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=dukhovni.org
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AGAeqqQNLHXB for <tls@ietfa.amsl.com>; Thu, 28 Mar 2024 10:33:37 -0700 (PDT)
Received: from chardros.imrryr.org (chardros.imrryr.org [144.6.86.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0E484C14F6A2 for <tls@ietf.org>; Thu, 28 Mar 2024 10:33:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dukhovni.org; i=@dukhovni.org; q=dns/txt; s=f8320d6e; t=1711647243; h=date : from : to : subject : message-id : reply-to : references : mime-version : content-type : in-reply-to : content-transfer-encoding : from; bh=lU4b8sJpWU+SUi+OFL+dCx0q1h5DARqAVyQqfXjS7wg=; b=ShWBx17YnP2D5ulx/nRXc0w+CpUAtLq9IBrrEILHxck43S274sphYk1gYK+p45C4t+d79 21uH/zNRuBkIHjHALdih2jFhxhXEvXlHmdyf9YgV6wmELMrJ9RSHtNIKX/QYdNhphDk1qxG BfJ0dICIACyPi5S+R4jf3SbDiR8gcvo=
Received: by chardros.imrryr.org (Postfix, from userid 1000) id 6731692B6EF; Thu, 28 Mar 2024 13:34:03 -0400 (EDT)
Date: Thu, 28 Mar 2024 13:34:03 -0400
From: Viktor Dukhovni <ietf-dane@dukhovni.org>
To: tls@ietf.org
Message-ID: <ZgWqC3qMnld4SakQ@chardros.imrryr.org>
Reply-To: tls@ietf.org
References: <GVXPR07MB9678DFD1EED3971606FB3DE6893B2@GVXPR07MB9678.eurprd07.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <GVXPR07MB9678DFD1EED3971606FB3DE6893B2@GVXPR07MB9678.eurprd07.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/ey_rNTC8Um1OMD5cxjkpZ1OyInQ>
Subject: Re: [TLS] TLS 1.3, Raw Public Keys, and Misbinding Attacks
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Mar 2024 17:33:41 -0000

On Thu, Mar 28, 2024 at 03:22:05PM +0000, John Mattsson wrote:

> I looked into what RFC 8446(bis) says about Raw Public Keys. As
> correctly stated in RFC 8446, TLS 1.3 with signatures and certificates
> is an implementation of SIGMA-I:

Assuming certificates are issued with strong assurance, which, with DV
certificates, is perhaps somewhat questionable.

> SIGMA does however require that the identities of the endpoints
> (called A and B in [SIGMA]) are included in the messages. This is not
> true for TLS 1.3 with RPKs and TLS 1.3 with RPKs is therefore not
> SIGMA. TLS 1.3 with RPKs is vulnerable to what Krawczyk’s SIGMA paper
> calls misbinding attacks:

The SNI extension in TLS allows servers that are the targets of
misbinding attacks to detect that the client was trying to communicate
with a different system, and in the case of HTTPS, there is also the
required "Host:" host header, which again will alert the server to the
fact that the client is requesting an unsupported resource.

Many operators obtain wildcard certificates, again a server should take
measures to ensure that among all the hosts sharing the same DNS suffix,
the session was actually intended for it, and not another service
endpoint, though in the case of multiple application services on the
same machine, that isn't always possible, because SNI conveys just
the hostname.

> “Even more significantly we show here that the misbinding attack
> applies to this protocol in any scenario where parties can register
> public keys without proving knowledge of the corresponding signature
> key.”

Note, that, for example, with SMTP the simplest way to direct traffic to
someone else's MX host is to publish MX records for one's own domain
that specify that MX host.  So "misbinding" attacks are not
"interesting" in this context.  Furthermore, because there are no
"cross-origin" issues in SMTP, there is nothing to be gained by
misleading a client that it is connected to a service endpoint for which
one can control the expected public key binding, when in fact it is
connecting to a "victim" service endpoint.

And of course how clients learn the association between and endpoint,
and the expected raw public key is a rather separate matter from whether
public keys or certificates happen to be used.  The public key might
be pre-shared out of band over a pre-existing bilateral trusted channel
between client and server, and proof of possession could be part of
that exchange if desired and useful.

> TLS 1.3 with PRKs does not fulfill this unless the out-of-band
> mechanism to register public keys proved knowledge of the private key.
> RFC 7250 does not say anything about this either.

If the server rejects unexpected SNI (including absence of SNI), that
should close the gap.

> I think this needs to be clarified in RFC8446bis. The only reason to
> ever use an RPK is in constrained IoT environments.

This is much too narrow a use-case.  There are other valid scenarios.

> self-signed certificate is a much better choice. TLS 1.3 with
> self-signed certificates is SIGMA-I.

Assuming the client looks at the name in the certificate, which isn't
always the case. And that the certificate isn't a wildcard certificate,
and the there aren't multiple TLS service endpoints at the same
hostname, where redirection from one application service to another,
might be a concern...

> It is worrying to find comments like this:
> 
> “I'd like to be able to use wireguard/ssh-style authentication for my
> app. This is possible currently with self-signed certificates, but the
> proper solution is RFC 7250, which is also part of TLS 1.3.”
> https://github.com/openssl/openssl/issues/6929

There are legitimate use-cases for RPKs, including at least some where
UKS attacks are not applicable.

> RPKs are not the proper solution.

RPKs are a solution when obtained from a trusted party, e.g. for
connections between machines controlled by the same operator, or
SMTP (given MX indirection described above), or in applications where
cross-origin attacks don't apply, ...

> (Talking about misbinding, does RFC 8446 say anything about how to
> avoid selfie attacks where an entity using PSK authentication ends up
> talking to itself?)

PSKs are not generally symmetric.

-- 
    Viktor.