Re: [jose] [COSE] Consensus on cryptographic agility in modern COSE & JOSE

Manu Sporny <msporny@digitalbazaar.com> Sun, 09 April 2023 20:20 UTC

Return-Path: <msporny@digitalbazaar.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 198EAC15152D for <jose@ietfa.amsl.com>; Sun, 9 Apr 2023 13:20:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.096
X-Spam-Level:
X-Spam-Status: No, score=-7.096 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_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=digitalbazaar.com
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 r2_SC9BHQLEk for <jose@ietfa.amsl.com>; Sun, 9 Apr 2023 13:20:29 -0700 (PDT)
Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 6B4D0C1516F3 for <jose@ietf.org>; Sun, 9 Apr 2023 13:20:29 -0700 (PDT)
Received: by mail-io1-xd2d.google.com with SMTP id d186so964558iog.12 for <jose@ietf.org>; Sun, 09 Apr 2023 13:20:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalbazaar.com; s=google; t=1681071628; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=N2s/ZKg+HxtwDQL+Ya/Ne+mr4H3BvDNI3T5InI+RXpE=; b=az1/ha9yicfSPMda2/4SeGpns9AFmEnf+wz17KPHm496tLXzYJBXGaf6a4cKskxOTt 3aDjrylPdoQuYDRE2mEcNunpPXbpHiP2KTF0pTzMJ0+GOH+ycttBIUXzxb3X7W8HNWy9 WFEwakgYv6PCLnOfkq5MRKVJZSQ8ptwPcRNvvdEgqsaDrfJKrdP3/cEU0MOgc+oZSS+t jn1M1V8FutLQJJj1Pbr/+Y5++N/A5z0rujCNrYSTc6sFvkmC6DtJBG4OlMqVsQA+Jnw+ eiWmHameN8nE25xp7XGUjFzeo+/FfWkqrNwg0T8vmfHIcOtYtQ2AA3ltRv2Z7q2r4kBx 13tQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681071628; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N2s/ZKg+HxtwDQL+Ya/Ne+mr4H3BvDNI3T5InI+RXpE=; b=OJbOs0q4IW07ASS1rBzJZTlpcKW0KEcWU+7WbffcfwgzGW/yt2RsX0W4F2771IoseZ D7x7e3e7hzbQ1h4/xe5rnPqIhpMgJ6zdvyOOtGBnVEKej2TcuMDUFTXRJCzrpNXl97kA 2T294kC04dZG56IJJOvjJ8T1JCmPm+3hQqOlvRx5lYTipz64iLFn61hwcJoGEhqJkvXD e1hFGne2F/4q5MgJfD7J01eFCGnidZIEhkpKDFMd5r2K7VreHwkZbG8GEFgiKqo4hX2d D8M2mjKGIi4vvoh6BBjn4/N3jFx2HBuUvA3/gg7/fh4g1SWPQjByeOopODYx2q272wdf CNmw==
X-Gm-Message-State: AAQBX9fkNkAK8hdaCdMmg2GgLCrS7zXA3JWsNpqv2gAOgecmgRpOdxwq G96n/qrslGXYHxmIxBSbVbc4tN5xaTvbo5NC5t+jdQ==
X-Google-Smtp-Source: AKy350Y/Er813LEG593P094qqbkPrr3pnMuoLYsqAiBonCQhZ7JLLz1iZfhAGv9Y2qF0HUCenDCdkCaeqVi646HuqWM=
X-Received: by 2002:a05:6638:3708:b0:3ec:46d4:e15 with SMTP id k8-20020a056638370800b003ec46d40e15mr8711152jav.3.1681071627957; Sun, 09 Apr 2023 13:20:27 -0700 (PDT)
MIME-Version: 1.0
References: <CAN8C-_KqEbX10mE=3sNWAJoWUkb8OSG9mDJ82XNaZHBwKNtrYg@mail.gmail.com> <ZCAVE4Wh23lc92kn@LK-Perkele-VII2.locald> <CAFWvErXg2wxRnZEj-OU6X8rhxK3XDh24UzX33YtM1vP_hubTCw@mail.gmail.com> <CAMBN2CRBcRZWxr7gq19HdQJG4enKaWyT_G1-8T=i+Lk49EAEhw@mail.gmail.com> <CAFWvErWcYnCfHHtbG5O-TDbKrnogegXenB+G_sfEJshzPZnhBA@mail.gmail.com>
In-Reply-To: <CAFWvErWcYnCfHHtbG5O-TDbKrnogegXenB+G_sfEJshzPZnhBA@mail.gmail.com>
From: Manu Sporny <msporny@digitalbazaar.com>
Date: Sun, 09 Apr 2023 16:19:52 -0400
Message-ID: <CAMBN2CToOhEcY_G=JPnTzV73efFJGdKHgXh3pA2_RaMrQiwpkA@mail.gmail.com>
To: AJITOMI Daisuke <ajitomi@gmail.com>, Ilari Liusvaara <ilariliusvaara@welho.com>, Christopher Allen <ChristopherA@lifewithalacrity.com>
Cc: cose <cose@ietf.org>, JOSE WG <jose@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/duyPHEJd0F0MEZlsKgX8ob1WcsU>
Subject: Re: [jose] [COSE] Consensus on cryptographic agility in modern COSE & JOSE
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 09 Apr 2023 20:20:34 -0000

On Sat, Apr 1, 2023 at 5:09 AM AJITOMI Daisuke <ajitomi@gmail.com> wrote:
> Thank you for the information. However, this article has already been shared previously on this COSE WG mailing list, and I have sent comments to the author, Christopher, regarding this article.

+CC: ChristopherA

> https://mailarchive.ietf.org/arch/msg/cose/KqFj9VqJ0Fjk45fEPh-Ys8HZiP8/

Thank you, Daisuke, for your thoughts regarding cryptographic agility.
As I mentioned in the response to Ilari, there are subtle differences
in definitions and approaches that will benefit from further
discussion.

> Based on my experience and observations, the Versioned Protocol approach is not as bad as Ilari mentioned (in fact, I found it easy to implement and quite like it), but it doesn't seem to be working well in the real world. In fact, the version switching of PASETO has not been going well at all.

That people are not upgrading in the field is an important, but
different concern vs. people choosing to deploy 30+ variations of the
technology. As far as the latter is concerned, PASTEO got many things
right (aggressive downscoping in algorithm and parameter selection)
where JOSE was flawed right out of the gate.

What you outline as a failure in PASTEO (people aren't upgrading from
v2 to v4), is an independent (but important) concern. That is,
deployed software tends to stick around for far longer than any of us
would like it to. If we try to think about what's worse... is 10+
variations of older technology sticking around better than 1 variation
of that same old technology? It, of course, depends on what that one
variation does vs. what the other 10 do... but if we start adding
qualifiers on that 1 variation (like, it's still secure, it has a
higher level of auditing, it's hard to get implementations wrong,
etc.), then we start to identify the sort of ecosystem we'd like to
see.

Again, PASTEO got more things right than JOSE did, and if we had taken
the PASTEO approach instead (by aggressively reducing options and
parameters), then we might not have had as many CVEs as we ended up
having over the years.

Now, to be clear, I'm not arguing for "one version"... what I'm
arguing for is something along the lines of "a latest version of a
class of digital signature algorithm, versioned by year" ... like
"ecdsa-YYYY", where the designated experts decide what parameters are
appropriate for a given year and release a new "versioned" cryptosuite
every couple of years. Much like SafeCurves did almost a decade ago:

https://safecurves.cr.yp.to/

For a developer, understanding that "SOMETHING-2022" is likely a
better choice than "SOMETHING-2009" is easier than trying to
differentiate if using "RS256" is better than "ES256", or if
"Curve25519" is a better choice than "Curve41417".

> In my opinion, a better approach would be to make a generic cryptographic utility layer (like COSE or JOSE) be cryptoagility-oriented as much as possible, and then narrow down the choice of cryptographic algorithms as needed in higher-level, application-specific specifications.

Yes, exactly right, and it's the "narrow down" layer that I'm most
interested in. We tend to leave this up to the library implementers,
who have demonstrated time and time again that "implement everything"
is what they do.

In the W3C Data Integrity work, we're trying to "narrow down the
choice of cryptographic algorithms as needed in higher-level,
application-specific specifications"... but some keep insisting that
"the experts at IETF recommend cryptographic agility", when the issue
is multi-faceted and more nuanced than "crypto-agility good/bad".

IOW, for W3C Data Integrity digital signatures, what we're trying to do is:

1. Aggressively reduce the number of algorithms that can be selected
from; e.g., we're not including RSA -- systems/libraries that need it
already exist and future systems probably shouldn't use it.

2. Aggressively reduce, and ideally eliminate, developer-led parameter
selection via sane defaults; e.g., ECDSA for this year will use P-256
and SHA-256 by default. We *might* have a "strong" option that will
use P-521 and SHA-512 (but won't support 384 because there doesn't
seem to be a compelling need to). So, if a developer is using ECDSA,
they use "ecdsa-2023" or "strong-ecdsa-2023". We are considering not
even having a "strong-ecdsa-2023" algorithm identifier. This is
somewhat analogous to the "HPKE-v1" approach.

So, for ECDSA, at the application layer, you effectively have one
versioned choice for this year... and we won't release another version
until there is a compelling reason to do so. As you mentioned, even if
we were to release a new version, it's highly unlikely that people
will upgrade for years and we tend to have multi-year advanced notice
wrt. when cryptographic systems fail.

I hope that helps explain where some of us are coming from, Daisuke. I
agree with the positive things you said about PASTEO and suggest that
the reasons people are not upgrading from v2 to v4 have less to do
with PASTEOs design, and more to do with the momentum behind v2. As
we're seeing with TLS v1.2 and v1.3, people do upgrade eventually, and
what we can do in the meantime is reduce optionality such that the
software we're putting out into the wild have a chance at a thorough
audit and greatly reduced attack surface.

-- manu

--
Manu Sporny - https://www.linkedin.com/in/manusporny/
Founder/CEO - Digital Bazaar, Inc.
News: Digital Bazaar Announces New Case Studies (2021)
https://www.digitalbazaar.com/