Re: [jose] JWS signature verification and claims payload
Hannes Tschofenig <hannes.tschofenig@gmx.net> Fri, 13 October 2023 07:39 UTC
Return-Path: <hannes.tschofenig@gmx.net>
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 1E3CFC14CE52 for <jose@ietfa.amsl.com>; Fri, 13 Oct 2023 00:39:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.803
X-Spam-Level:
X-Spam-Status: No, score=-2.803 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=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 (2048-bit key) header.d=gmx.net
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 1-jWGvmiMfIR for <jose@ietfa.amsl.com>; Fri, 13 Oct 2023 00:39:38 -0700 (PDT)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C03D2C14CE44 for <jose@ietf.org>; Fri, 13 Oct 2023 00:39:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1697182775; x=1697787575; i=hannes.tschofenig@gmx.net; bh=P0sAKN3ER7MPziyC95vlIQ68lkiGqGNtgkBIl3CbsE8=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=rRg2yAgwxVJtWnfKJEQ3fwSOSGJhWr3l+beKVsZKc/QmEguUSYiRa91O4rZio7UXyjcaFwkAysk trCQASN1bBvJbBAYgiZoexiHIcZoGCS0e8IXMd91Q5nOn3GjbSoqp5ykwfPzrLZ3kwgdVzeM3YnEK qgDbGnagKJI6POmfZhnyTXnl0Re5vvdDj6y9G/8bpDepXM5psGzfVD01wd/HNhkvEP5Ewq4b8H9u7 1BU15s7umy14q+rSx1KtqtABRwY5uPKHNGY193JKl7Hs/YdISy/LclUADbD0hdPBPLW9TRAueGYn/ YcUFb6nHg1YufUG+5UrNNgJR58wTSiynxh3A==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [172.16.254.186] ([195.149.218.225]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MEFvj-1qjk6k07rp-00ADVD; Fri, 13 Oct 2023 09:39:35 +0200
Message-ID: <c8a66f20-175e-4863-887c-f6d3b367e485@gmx.net>
Date: Fri, 13 Oct 2023 09:39:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Les Hazlewood <lhazlewood@gmail.com>, jose@ietf.org
References: <CACVbtYO28BkxPXoXKUojjV_XFGQOEV7EDs=d1TZ9ymcBhFicUQ@mail.gmail.com>
From: Hannes Tschofenig <hannes.tschofenig@gmx.net>
In-Reply-To: <CACVbtYO28BkxPXoXKUojjV_XFGQOEV7EDs=d1TZ9ymcBhFicUQ@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:k9KNuyWeB5x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OpZQqeEup ueQILVHPmEym7b0uMfEQe1R/ef5o6GAQn9IECfRMlqvC7uANYDNA+P2vubrgpE5D+IFllqivl 7uSKvZr4afHOt0pXpgF9CkpjfOhgnbFl1bAy4I9/vVZSpVFyW4NdqxaMx9r9osleulAaJfzhN YkzbaB9u6145mrAdNJGs1mHkeXs=
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/KojfaXcuKokYWXq6gLjE6tXT2J8>
Subject: Re: [jose] JWS signature verification and claims payload
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: Fri, 13 Oct 2023 07:39:42 -0000
Hi Les, ideally, protocol designers should use information in the header to identify a key. The obvious example is the "kid" parameter. That's what it has been designed for. (Over time more parameters have been added.) Sometimes this key identifier is elsewhere, namely * not in the JOSE structure itself (hence implicit), or * in the payload of the JOSE structure itself. Placing the key identification information in the payload structure itself is, as you say in your email, a bit annoying. I would call it a flawed design (from a layering point of view). If we are only talking about information for identifying a key then I don't see a security problem. If we are, however, talking about making generic decisions without prior verification of the MAC/signature then there is obviously a huge problem. The problem for you as a library developer is that you do not know what information in the payload is used to identify the key vs. used for generic decision making. How to you design an library that ensures that developers do not make mistakes? You don't need to be a visionary to see how developers will introduce security bugs. From the working group point of view I think we have to write a Best Current Practice guide on what designs to avoid when designing protocols with JOSE (and COSE) and the use of key identification information inside the payload of a JOSE structure would be one of the items to avoid. In OAuth we have an RFC that provides guidance for JWTs (see https://datatracker.ietf.org/doc/rfc8725/) but this document would be more generic. Ciao Hannes Am 12.10.2023 um 20:54 schrieb Les Hazlewood: > Hello folks - I hope someone can help answer a quick question: > > https://datatracker.ietf.org/doc/html/rfc7515#section-5.2 does not > make any indication if a Claims payload may be parsed before > signature/MAC verification. > > I am a JOSE library author/maintainer and I've had application > developers request the ability to look at information in a Claims > payload to help find the key used to verify the signature/MAC. Their > concerns are that an Identity Provider may use a key id (kid) in the > header that is not guaranteed to be globally unique, and they may need > other information in the Claims (e.g. issuer) to help them locate the > appropriate key. > > My response was that there are many other options like jku, jwk > thumprints as key ids, x5t, etc, that all mitigate this concern, and I > dislike parsing payloads that haven't been cryptographically verified > due to potential security issues otherwise. But they said those > additional headers are only relevant if if the IdP actually uses those > values, and if not, they still might need to look in the claims. > > What is the JOSE committee's stance on parsing the claims before > signature verification? > > Thank you kindly, > > Les > > > > _______________________________________________ > jose mailing list > jose@ietf.org > https://www.ietf.org/mailman/listinfo/jose
- [jose] JWS signature verification and claims payl… Les Hazlewood
- Re: [jose] JWS signature verification and claims … Orie Steele
- Re: [jose] JWS signature verification and claims … Les Hazlewood
- Re: [jose] JWS signature verification and claims … Orie Steele
- Re: [jose] JWS signature verification and claims … Les Hazlewood
- Re: [jose] JWS signature verification and claims … Les Hazlewood
- Re: [jose] JWS signature verification and claims … Manger, James
- Re: [jose] JWS signature verification and claims … Les Hazlewood
- Re: [jose] JWS signature verification and claims … Manger, James
- Re: [jose] JWS signature verification and claims … Les Hazlewood
- Re: [jose] JWS signature verification and claims … Manger, James
- Re: [jose] JWS signature verification and claims … Hannes Tschofenig
- Re: [jose] JWS signature verification and claims … Les Hazlewood