[COSE] Re: WGLC for draft-ietf-cose-hpke-13

Laurence Lundblade <lgl@island-resort.com> Sun, 22 June 2025 19:45 UTC

Return-Path: <lgl@island-resort.com>
X-Original-To: cose@mail2.ietf.org
Delivered-To: cose@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 5C9C9380C5BE for <cose@mail2.ietf.org>; Sun, 22 Jun 2025 12:45:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (1024-bit key) header.d=island-resort.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QPyiVsVOt2Me for <cose@mail2.ietf.org>; Sun, 22 Jun 2025 12:45:32 -0700 (PDT)
Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 8F57D380C5AA for <cose@ietf.org>; Sun, 22 Jun 2025 12:45:32 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1750621525; cv=none; d=zohomail.com; s=zohoarc; b=WJB1Qni3UHzENuNatq6BRn33gxbzG+V7TrA2fWmuiisPIdJXYEmJluMUxH8Nk2NJe6YR2blmvWRKKnZQgjeJOrBzXk+0PxilksfXw6d5646kexZbjLwXNK31T82NYvaIGa79G3i1AQsUwZP0AlljSd0Gd8amH5M6sc6pHPzIfs8=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750621525; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=iPKo88p2M/wLXK0gjRf24UiJlg5esD8Gn2leq3DYIH4=; b=TUUpHuVK7hwjYyj6Xi2FkOqcn7EbpJWfCmiELhCS4SCyEIHflZ0Q+HPZaQi/gXEg/2qJquGjqcDuttjq7vH6E6uO6CPQWO/bEW/qOnaBvT6sn6ml7DKdgyY0JPVkMPTWgPVutQjCZrBfRK5+ggAFkjEt/e/c/GbUNQMbvjysmIc=
ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=island-resort.com; spf=pass smtp.mailfrom=lgl@island-resort.com; dmarc=pass header.from=<lgl@island-resort.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1750621525; s=island; d=island-resort.com; i=lgl@island-resort.com; h=From:From:Message-Id:Message-Id:Content-Type:Mime-Version:Subject:Subject:Date:Date:In-Reply-To:Cc:Cc:To:To:References:Reply-To; bh=iPKo88p2M/wLXK0gjRf24UiJlg5esD8Gn2leq3DYIH4=; b=WnuYDbsgQdaDXxbMcXWfqcJoVN0S1Vzt9pNkZi2ute/sMbbPK0Iuf/K2GWI6Gvjk a+DDDUW/+mcrZOJb5whDfO7b6p2Cw0CoJkaKJoFJQ+0hnG7xGpm7d5/3QMbXWYPb+Zo vQBimBkR0kcgnXWmnYevw8OC5ZDWQSwBGGflyEus=
Received: by mx.zohomail.com with SMTPS id 1750621522712152.2698921276376; Sun, 22 Jun 2025 12:45:22 -0700 (PDT)
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <756D08F6-E65A-40AF-ADC9-757BA350877A@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_1A18CCC6-ED9A-4CBD-98DA-A514A6006931"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\))
Date: Sun, 22 Jun 2025 12:45:11 -0700
In-Reply-To: <aFb03WG9-nFWcp7q@LK-Perkele-VII2.locald>
To: Ilari Liusvaara <ilariliusvaara@welho.com>
References: <PH7PR02MB9292EAE69687BA443627B95BB76CA@PH7PR02MB9292.namprd02.prod.outlook.com> <trinity-888ac013-43e2-4272-acd7-d6954660c685-1750430444583@trinity-msg-rest-gmx-gmx-live-b647dc579-whl4j> <CAD2CPUG_cgWyHCaghXOYi_TeS7DLvw=+SxC+e1s9R74KxWRwzQ@mail.gmail.com> <aFWmj0TFC7alV_YE@LK-Perkele-VII2.locald> <CAFWvErWFGwpP=BBNgDmNUppXhOzN55ANDmTePaccb_hcw4gWZw@mail.gmail.com> <aFb03WG9-nFWcp7q@LK-Perkele-VII2.locald>
X-Mailer: Apple Mail (2.3826.500.181.1.5)
X-ZohoMailClient: External
Message-ID-Hash: M355Q6QGUTGJY6DYI7QKECYJONRJN237
X-Message-ID-Hash: M355Q6QGUTGJY6DYI7QKECYJONRJN237
X-MailFrom: lgl@island-resort.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cose.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: cose@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [COSE] Re: WGLC for draft-ietf-cose-hpke-13
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/qv5HrFpCOeu6Iqjat1Ee19Dxfhc>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Owner: <mailto:cose-owner@ietf.org>
List-Post: <mailto:cose@ietf.org>
List-Subscribe: <mailto:cose-join@ietf.org>
List-Unsubscribe: <mailto:cose-leave@ietf.org>

> On Jun 21, 2025, at 11:07 AM, Ilari Liusvaara <ilariliusvaara@welho.com> wrote:
> 
> On Sat, Jun 21, 2025 at 06:49:56AM +0900, AJITOMI Daisuke wrote:
>> Hi Hannes, Mike, all,
>> 
>> Over the past year, I haven’t been able to contribute to the revisions of
>> the specification despite being a co-author. However, I’ve reviewed the
>> latest content again and believe there are no major issues.
> 
> The COSE_MAC stuff seems very broken, at least in base mode. What is
> to prevent an attacker that has victim public key from choosing the
> message, MACing it with random key, and then encrypting the key to
> recipient?
> 
> That would not work in auth mode, but it is not supported (and it
> would still be a lot weaker than proper signatures).

I filed an issue so we don’t forget this: https://github.com/cose-wg/HPKE/issues/81


>> I’d feel a lot better about the “yes, let’s publish” if there was some
>>> comment and confirmation that next_layer_alg in Recipient_structure
>>> [3.1.2.1] secures the bulk encryption algorithm ID well enough that a
>>> non-AEAD can be used. I think it does, but we should have a little
>>> consensus on this.
>> 
>> At one point, I misunderstood your proposal, but I’m now confident that the
>> current approach is appropriate.
> 
> If an attacker changes the next layer algorithm from AE(AD) to non-AE,
> the aad will not match, which causes decryption failure with very high
> probability.

You’ve confirmed that next_layer_alg does the main job of defending against the lamps attack.

> Next_layer_alg does not help if the next layer algorithm is already
> non-AE, but that is a Bad Idea anyway.

Right. This is not to enforce against bad choices for the bulk content encryption. We can make recommendations, but that should be done elsewhere.

> Next_layer_alg also does not detect replacing bulk encryption with
> key wrap, but getting a valid key wrap seems very hard. Reusing other
> key wraps does not work, because that needs KEK, which would
> compromise the message anyway.

To clarify, if an attacker replaced AES-128-GCM with A128KW, next_layer_alg would cause it to be detected.

If a protocol designer created a three layer COSE encryption (e.g., HPKE-key-wrap-AES), next_layer_alg would secure the ID of the key wrap, but not the AES. This is more a problem with the three layer design than next_layer_alg, so no problem here either.

So, you’ve thought through the next_layer_alg design some and haven’t found a problem with it, right?. This makes me feel more confident. Thank you.

LL