Re: [jose] RFC 8037 "alg" quirkiness

Neil Madden <neil.e.madden@gmail.com> Wed, 16 September 2020 13:03 UTC

Return-Path: <neil.e.madden@gmail.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 2ED1E3A0E03 for <jose@ietfa.amsl.com>; Wed, 16 Sep 2020 06:03:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=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=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 UmhNPiN6wTsA for <jose@ietfa.amsl.com>; Wed, 16 Sep 2020 06:02:59 -0700 (PDT)
Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 8F9583A0CC5 for <jose@ietf.org>; Wed, 16 Sep 2020 06:02:59 -0700 (PDT)
Received: by mail-wm1-x331.google.com with SMTP id b79so2932900wmb.4 for <jose@ietf.org>; Wed, 16 Sep 2020 06:02:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=tIhwkNIp9fJkG1bBq4/Tzk2gk0Iu8Rfmszqk3jcIrAU=; b=kEnQPMgU6TA9KtSnu7RHWKfUCxvrFCi4Gne1187/5wfG8G27LsT7oVrovz4RuXG67I o1bQhZtdT+31NGigFq82NUv8GFMTbF3KP3JydSVWcnDOtFib8g9m1X/5KPgCmO6w8FNW CMZTTnXr6X73+79fTZ0J+h79HILY1+bqc92hgAWy4O7plAFJevTpUkWm7suV2310tKfD LLaJAk9KjAzGno4DVMYb1tLeP1w3Ocb0LXX2I9pj5aP7uxZulQNy1jzl2EPuimPkQITC 3tYll/kmwwrfgzMHgTt4NZcWEiIq9uBCsM/W0wv3epsg8XG0swCTDQ07ZGQPjI1mVlE7 640g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=tIhwkNIp9fJkG1bBq4/Tzk2gk0Iu8Rfmszqk3jcIrAU=; b=qe1VYWPrHql7aQi/z28wMK2OqjGk7VBYUv6QPw5t7Zon4W44UB3LovzMaUB9ms20C7 8/YVJXYnUQjOBdhC6LWLwq4G+WaKcEkp+26vbFDJH+OKxSdaGtb2UkI6Jcmtit53euds 6TpXZ05/Mkhc1B81g2VmSPsmynX2oBpniLWPG29eKtgNa7u6vCe0PflkwiC7FQeBMo2M td7GlDe+XQy9BiGwQGTFoLl6YtClzAA2h8Z0KaOdAd7jr/BwWHL2POQdVnPKVnICCDkK +A51WcxRRov78Oy4P64Qf0MSbPCyQwaAcanVRF0W1TLLu8k4gDTPZdkoKlUjGWXPeNmH rPOQ==
X-Gm-Message-State: AOAM532O5NNRMGz+DS32085YbZqTE36WHBEzndyjeh6gmLpL5R0nHwf4 kDW0PdSfnS0RBAqSanDpaoo=
X-Google-Smtp-Source: ABdhPJwtTvkBy4B6p0Vv5WOmUV9FyUikiesFzk486/QrYU8NhSkcUECgdNoZrgBXpgIYK24Qc72a9Q==
X-Received: by 2002:a1c:a90a:: with SMTP id s10mr4630595wme.11.1600261377639; Wed, 16 Sep 2020 06:02:57 -0700 (PDT)
Received: from [10.0.0.6] (251.58.93.209.dyn.plus.net. [209.93.58.251]) by smtp.gmail.com with ESMTPSA id 18sm5093079wmj.28.2020.09.16.06.02.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2020 06:02:56 -0700 (PDT)
From: Neil Madden <neil.e.madden@gmail.com>
Message-Id: <D7856A3C-96A5-4922-89D5-405041264462@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_52F09EAD-60EA-4F20-93F5-5D38276B2275"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
Date: Wed, 16 Sep 2020 14:02:55 +0100
In-Reply-To: <20200916123043.GB1653297@LK-Perkele-VII>
Cc: "jose@ietf.org" <jose@ietf.org>
To: Ilari Liusvaara <ilariliusvaara@welho.com>
References: <1a84f81d-c7bd-9961-9f5c-e6c358fc1095@gmail.com> <3B2FF2C4-44EB-4462-868E-C6DD1DD3F1CA@forgerock.com> <20200916123043.GB1653297@LK-Perkele-VII>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/FyStbPaTObQMO2iT7TSyqC6Kh8c>
Subject: Re: [jose] RFC 8037 "alg" quirkiness
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 16 Sep 2020 13:03:01 -0000

On 16 Sep 2020, at 13:30, Ilari Liusvaara <ilariliusvaara@welho.com> wrote:
> […]
> 
>> 8037 was done by CFRG, so probably best to ask there. 
> 
> 8037 was done by JOSE. The CFRG part (generic specification of
> EdDSA2) was 8032.

Good to know, thanks.

> 
>> I like this aspect of the spec. IMO “alg” as a header was a mistake.
>> By using a generic algorithm header, it forces implementors to
>> associate the specific details in metadata stored with the key, which
>> is much safer. 
> 
> Actually a few months ago I came up with idea of having a way to express
> "algorithm determined by the key" in JOSE/COSE.
> 
> - There have been some serious security issues in JWS implementations
>  that have been caused by using completely wrong algorithms.
> - In general, using the same key with multiple algorithms is not
>  cryptographically safe. There can be algorithm pairs which interact
>  badly (for instance, Ed25519 and the original Ed25519ph).

I wrote about this some time ago: https://neilmadden.blog/2018/09/30/key-driven-cryptographic-agility/ <https://neilmadden.blog/2018/09/30/key-driven-cryptographic-agility/> 

JWK already allows associating an algorithm with a key, so I have considered a small draft to deprecate the “alg” header in JOSE entirely. With this WG being disbanded however, there’s not a natural place to do that.

— Neil