Re: [jose] Whether implementations must understand all JOSE header fields

Mike Jones <Michael.Jones@microsoft.com> Tue, 18 December 2012 21:47 UTC

Return-Path: <Michael.Jones@microsoft.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 BECF821F87C7 for <jose@ietfa.amsl.com>; Tue, 18 Dec 2012 13:47:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.86
X-Spam-Level:
X-Spam-Status: No, score=-3.86 tagged_above=-999 required=5 tests=[AWL=0.735, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, TRACKER_ID=2.003]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nX4HHRcy2GQ8 for <jose@ietfa.amsl.com>; Tue, 18 Dec 2012 13:47:26 -0800 (PST)
Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe003.messaging.microsoft.com [65.55.88.13]) by ietfa.amsl.com (Postfix) with ESMTP id 1240821F87AC for <jose@ietf.org>; Tue, 18 Dec 2012 13:47:25 -0800 (PST)
Received: from mail16-tx2-R.bigfish.com (10.9.14.253) by TX2EHSOBE013.bigfish.com (10.9.40.33) with Microsoft SMTP Server id 14.1.225.23; Tue, 18 Dec 2012 21:47:25 +0000
Received: from mail16-tx2 (localhost [127.0.0.1]) by mail16-tx2-R.bigfish.com (Postfix) with ESMTP id 04193380160; Tue, 18 Dec 2012 21:47:25 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:131.107.125.8; KIP:(null); UIP:(null); IPV:NLI; H:TK5EX14HUBC106.redmond.corp.microsoft.com; RD:autodiscover.service.exchange.microsoft.com; EFVD:NLI
X-SpamScore: -22
X-BigFish: VS-22(zz9371Ic85fhd772h148cIzz1de0h1202h1e76h1d1ah1d2ahzz1033IL18c673h17326ah8275bh8275dhz2fh2a8h668h839hd25hf0ah1288h12a5h12bdh137ah1441h1504h1537h153bh15d0h162dh1631h1758h1155h)
Received-SPF: pass (mail16-tx2: domain of microsoft.com designates 131.107.125.8 as permitted sender) client-ip=131.107.125.8; envelope-from=Michael.Jones@microsoft.com; helo=TK5EX14HUBC106.redmond.corp.microsoft.com ; icrosoft.com ;
Received: from mail16-tx2 (localhost.localdomain [127.0.0.1]) by mail16-tx2 (MessageSwitch) id 1355867241406521_31732; Tue, 18 Dec 2012 21:47:21 +0000 (UTC)
Received: from TX2EHSMHS013.bigfish.com (unknown [10.9.14.238]) by mail16-tx2.bigfish.com (Postfix) with ESMTP id 544668006D; Tue, 18 Dec 2012 21:47:21 +0000 (UTC)
Received: from TK5EX14HUBC106.redmond.corp.microsoft.com (131.107.125.8) by TX2EHSMHS013.bigfish.com (10.9.99.113) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 18 Dec 2012 21:47:20 +0000
Received: from TK5EX14MBXC283.redmond.corp.microsoft.com ([169.254.2.50]) by TK5EX14HUBC106.redmond.corp.microsoft.com ([157.54.80.61]) with mapi id 14.02.0318.003; Tue, 18 Dec 2012 21:47:20 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: "Axel.Nennker@telekom.de" <Axel.Nennker@telekom.de>, "jose@ietf.org" <jose@ietf.org>
Thread-Topic: [jose] Whether implementations must understand all JOSE header fields
Thread-Index: Ac3c6fKiGIpH7bZFS4icWSDz6kDFIAAEWr0AABe5RWA=
Date: Tue, 18 Dec 2012 21:47:19 +0000
Message-ID: <4E1F6AAD24975D4BA5B16804296739436696753E@TK5EX14MBXC283.redmond.corp.microsoft.com>
References: <4E1F6AAD24975D4BA5B16804296739436694758E@TK5EX14MBXC284.redmond.corp.microsoft.com> <CE8995AB5D178F44A2154F5C9A97CAF4025238FC2A45@HE111541.emea1.cds.t-internal.com>
In-Reply-To: <CE8995AB5D178F44A2154F5C9A97CAF4025238FC2A45@HE111541.emea1.cds.t-internal.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [157.54.51.76]
Content-Type: multipart/alternative; boundary="_000_4E1F6AAD24975D4BA5B16804296739436696753ETK5EX14MBXC283r_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
Subject: Re: [jose] Whether implementations must understand all JOSE header fields
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Tue, 18 Dec 2012 21:47:30 -0000

Thanks for your note, Axel.  A few comments...

I want to challenge the premise of your statement "All headers and values are defined in a version".  In fact, future headers and values can be defined by multiple specifications in parallel through use of the IANA registries defined by the JOSE specifications.  For instance, it was decided in an ad-hoc meeting on Friday in Atlanta that Matt Miller would write an "application" specification that specifies mechanisms for encrypting private and symmetric keys as JWEs *and* adds a new algorithm for password-based encryption to the registry.  In parallel, others wanting definitions for additional algorithms (using SHA-3 family, for instance) might also specify those.  When parallel changes are both possible and likely, versioning-based solutions tend to break down.

Also, I want to push back on your statement "All other header fields ... can be safely ignored because they are not relevant to alg or enc", based upon past input from the working group.  When we discussed this issue in the past, only one person was in favor of a must-ignore-by-default behavior, and yet that's what you're advocating for fields "not relevant to alg or enc".  See http://www.ietf.org/mail-archive/web/jose/current/msg01216.html.  Therefore, I don't think that's going to fly with the working group.  If you want to propose a different syntax that requires people to take special action to ignore a not-understood field, that would be fine, but I suspect that one that requires special action to mark fields as must-be-understood isn't likely to fly.

                                                                Best wishes,
                                                                -- Mike

From: Axel.Nennker@telekom.de [mailto:Axel.Nennker@telekom.de]
Sent: Tuesday, December 18, 2012 12:52 AM
To: Mike Jones; jose@ietf.org
Subject: RE: [jose] Whether implementations must understand all JOSE header fields

I did not comment on this because I thought I needed to think about all alternatives.

3) have a field "ver" denoting the version of the JWT. All headers and values are defined in a version. If a recipient does not understands a version then the JWT must be rejected, if he understands the version then all header fields and values must be understood and there are no extra header fields.

4) For each value of alg and enc there is a new optinal field with the name of the value of alg or enc containing the parameters for this value of alg or enc.
Example:

    {"alg":"ES1024T", /* some new algorithm */

      "ES1024T ":{"param1": "value1","param2":"value2"};

     "notes":"This signature need not be checked when the moon is full"

    }
Recipient must understand alg and its value. If there is a field like ES1024T then recipient must understand all fields in its value e.g. param1, value1
All other header fields like notes can safely be ignored because they are not relevant to alg or enc.
There needs to be wording to prevent name clashes likes this alg="user_jwk"

Axel


From: jose-bounces@ietf.org<mailto:jose-bounces@ietf.org> [mailto:jose-bounces@ietf.org] On Behalf Of Mike Jones
Sent: Tuesday, December 18, 2012 7:36 AM
To: jose@ietf.org<mailto:jose@ietf.org>
Subject: Re: [jose] Whether implementations must understand all JOSE header fields

Are people interested in discussing this, or are we proceed to have the chairs conduct polls and make consensus calls?  Thus far, no one has commented on the note below...

                                                            -- Mike

From: jose-bounces@ietf.org<mailto:jose-bounces@ietf.org> [mailto:jose-bounces@ietf.org] On Behalf Of Mike Jones
Sent: Friday, December 14, 2012 10:17 AM
To: jose@ietf.org<mailto:jose@ietf.org>
Subject: [jose] Whether implementations must understand all JOSE header fields


Currently the JOSE specs contain the following language declaring that all header (and some other) fields must be understood:  "Implementations MUST understand the entire contents of the header; otherwise, the ... MUST be rejected."  There's currently an open issue about whether all header fields should be required to be understood by implementations using them or whether to relax this requirement in some circumstances.  We would like the working group to consider the following potential resolutions to the issue.



1.  Maintain the current requirement that all header fields must be understood by implementations using them.



PRO:  This is a simple rule designed to result in secure implementations.  Representations of existing JWS & JWE objects are unchanged.

CON:  Extensibility is limited to cases where all participating parties understand new fields that are introduced.



2A.  Take an alternative approach where, by default, all fields must be understood, but where an explicit list of fields can be designated as "may be ignored if not understood".  For instance, an "ign" (may be ignored) member could be defined whose value is an array listing the member names that may be safely ignored if not understood.  An example using this field in a JWS header is:



    {"alg":"ES256",

     "ign":["notes"],

     "notes":"This signature need not be checked when the moon is full"

    }



(Obviously, the "ign" field MUST NOT contain the value "ign".)



PRO:  This would enable adding non-critical header fields without breaking implementations.  It would maintain the current semantics, while allowing explicit exceptions to be made in cases where the fields are not security-critical and the structure has a meaningful interpretation without them.  Representations of existing JWS & JWE objects are unchanged.

CON:  Requires coordination of field names and may-be-ignored list, adding some implementation complexity.



2B.  Take an alternative approach where instead of one header object, there would be two header objects.  Implementations would be required to understand all fields in the first header object.  Implementations would be allowed to ignore fields in the second header object if not understood.  An example of this approach, adding the second header object after the first in a JWS, would be:



    eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9

    .

    eyJub3RlcyI6IlRoaXMgc2lnbmF0dXJlIG5lZWQgbm90IGJlIGNoZWNrZWQgd2hlbiB0aGUgbW9vbiBpcyBmdWxsIn0

    .

    eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ

    .

    dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk



The first, third, and fourth fields are from the example JWS in the current spec. The new second field is the base64url encoded representation of the string '{"notes":"This signature need not be checked when the moon is full"}'.



PRO:  May-be-ignored fields are easily distinguishable from must-be-understood fields.

CON:  Implementations must consult/merge two sets of headers to understand the meaning/structure of the object, adding some implementation complexity.  Existing JWS & JWE object representations would become invalid.



After a discussion period, we believe that it would be useful for the chairs to make two formal consensus calls of the following kind:



FIRST POLL:  Should all header fields be critical for implementations to understand?

YES - All header fields must continue to be understood by implementations or the input must be rejected.

NO - A means of listing that specific header fields may be safely ignored should be defined.



SECOND POLL:  Should the result of the first poll be "NO", which syntax would you prefer for designating the header fields that may be ignored if not understood?

A - Define a header field that explicitly lists the fields that may be safely ignored if not understood.

B - Introduce a second header, where implementations must understand all fields in the first but they may ignore not-understood fields in the second.



                                                Thanks for considering these questions,

                                                Richard Barnes, John Bradley, Mike Jones