Re: [jose] JWK member names, was: SECDIR review of draft-ietf-jose-json-web-key-31

Mike Jones <> Fri, 12 September 2014 16:20 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 76F651A6F81; Fri, 12 Sep 2014 09:20:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id DSN-TeVnsqf9; Fri, 12 Sep 2014 09:20:36 -0700 (PDT)
Received: from ( []) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 6A2811A0704; Fri, 12 Sep 2014 09:20:34 -0700 (PDT)
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.1029.13; Fri, 12 Sep 2014 16:20:32 +0000
Received: from (2a01:111:f400:7c0c::190) by (2a01:111:e400:401e::31) with Microsoft SMTP Server (TLS) id 15.0.1029.13 via Frontend Transport; Fri, 12 Sep 2014 16:20:32 +0000
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.1019.14 via Frontend Transport; Fri, 12 Sep 2014 16:20:32 +0000
Received: from ([]) by ([]) with mapi id 14.03.0195.002; Fri, 12 Sep 2014 16:20:17 +0000
From: Mike Jones <>
To: Tim Bray <>
Thread-Topic: [jose] JWK member names, was: SECDIR review of draft-ietf-jose-json-web-key-31
Thread-Index: AQHPzqIHj1de3PnVVUOZ99QaOQrAZJv9q2Yg
Date: Fri, 12 Sep 2014 16:20:15 +0000
Message-ID: <>
References: <> <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
x-originating-ip: []
Content-Type: multipart/alternative; boundary="_000_4E1F6AAD24975D4BA5B16804296739439AEC0929TK5EX14MBXC292r_"
MIME-Version: 1.0
X-EOPAttributedMessage: 0
X-Forefront-Antispam-Report: CIP:; CTRY:US; IPV:CAL; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(438002)(24454002)(377454003)(189002)(43784003)(51444003)(199003)(15975445006)(87936001)(95666004)(92566001)(85306004)(2656002)(92726001)(230783001)(83072002)(85852003)(104016003)(6806004)(80022001)(85806002)(84676001)(83322001)(19580405001)(69596002)(44976005)(68736004)(20776003)(66066001)(19580395003)(15202345003)(19300405004)(71186001)(64706001)(106116001)(90102001)(4396001)(81342001)(110136001)(106466001)(81156004)(107046002)(74502001)(74662001)(16236675004)(33656002)(31966008)(19625215002)(26826002)(50986999)(76176999)(54356999)(99396002)(77096002)(512874002)(21056001)(81542001)(97736003)(86612001)(19617315012)(84326002)(86362001)(79102001)(77982001)(76482001)(46102001)(55846006); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB605;; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en;
X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:;
X-O365ENT-EOP-Header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY)
X-Forefront-PRVS: 0332AACBC3
Received-SPF: Pass ( domain of designates as permitted sender); client-ip=;;
Authentication-Results: spf=pass (sender IP is;
Cc: "" <>, Stephen Kent <>, "" <>, "" <>, Kathleen Moriarty <>, "" <>
Subject: Re: [jose] JWK member names, was: SECDIR review of draft-ietf-jose-json-web-key-31
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Javascript Object Signing and Encryption <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 12 Sep 2014 16:20:42 -0000

I understand that that’s an ideal long-term solution, once I-JSON parsers are common/ubiquitous, but I don’t expect that to be the case for a number of years and people are using JOSE now.  Tim, you were one of the primary advocates for the position that implementers need to be able to use JSON parsers as they actually exist – hence the change from (1) to (2) in draft -12 in July 2013 after extensive working group discussion on the topic.

Unless you’ve changed your tune, I doubt that you’re actually saying that we should move back to (1) now, which would mean that people using today’s JSON parsers would be nonconformant?

Once I-JSON is ubiquitous, I’d be fine doing bis versions of the specs to tighten the requirement in a few years.  But until then, keeping the requirement that producers must not use duplicate member names would mean that if we do update to use I-JSON in the future, nothing would then break.

                                                            -- Mike

From: Tim Bray []
Sent: Friday, September 12, 2014 8:55 AM
To: Mike Jones
Cc: Kathleen Moriarty;;;;; Stephen Kent
Subject: Re: [jose] JWK member names, was: SECDIR review of draft-ietf-jose-json-web-key-31

I’m pretty sure that at some point before the end of the year the IETF will publish I-JSON (see which simply specifies that there MUST NOT be dupe keys.  Depending on the timeframe, referring to this might be a good solution.

On Fri, Sep 12, 2014 at 8:18 AM, Mike Jones <<>> wrote:
Sure.  Here’s an analysis of the requirements about duplicate member names.

There could be two very different kinds of objections to the present text:
A.  People think we have the semantics for duplicate identifiers wrong.
B.  People think we should explain the current semantics for duplicate identifiers more clearly.

I sure hope that we’re dealing with B and not A.  Stephen, which is the nature of your critique of this text?

If we’re in the realm of A, I think there are three possibilities for the semantics:

1.  Require producers not use duplicate members and require consumers to reject inputs with duplicate member names.
Pros:  This is the most locked-down, consistent, and alternative.
Cons:  Real JSON parsers don’t all reject duplicate inputs.  If we force people to write custom parsers, this will result in exploitable bugs (and some just won’t do it and won’t be conformant).

2.  Require producers not to use duplicate members but allow consumers to accept inputs with duplicate member names in the manner defined in ECMAscript.  (This is the current choice.)
Pros:  People can use all standard JSON parsers.  Producers are still required to produce well-formed data structures.
Cons:  The requirements on producers are stricter than those on consumers.

3.  Allow both producers and consumers to use duplicate members, with duplicate member names handled in the manner defined in ECMAscript.
Pros:  People can use ECMAscript parsers (which are more liberal than some JSON parsers).  The requirements on producers and consumers are the same.
Cons:  Hidden content can be inserted into duplicate member names.  This could give attackers a way to manipulate the inputs to crypto operations.  Strict JSON parsers (that reject inputs with duplicate members) can’t be used.

Practically, I think were we presently are (2) is the best compromise between implementability, consistency, and security.  The working group put a lot of discussion into this, including changing from (1) to (2) and it’s my sense that most agree we’ve landed in the right place.  From a security perspective, I don’t think that (3) is a viable option.

If people think that the current semantics are right but are not sufficiently clearly explained or motivated, I’d certainly welcome proposed text to clarify the explanation.

                                                            -- Mike

From: Kathleen Moriarty [<>]
Sent: Friday, September 12, 2014 5:00 AM
To:<>;<>;<>;<>; Stephen Kent; Mike Jones
Subject: JWK member names, was: [jose] SECDIR review of draft-ietf-jose-json-web-key-31

Hi Mike,

The text Steve called out below has been very problematic as you know.  Could you call out some options here as the last time this came up, we didn't resolve it.  The working group was asked for suggestions, but none came through.  If you could provide some options and then have the working group weigh in, I think that would be good.

I snipped away the rest of the review and changed the subject as not to get in the way of the current dialog.


On Wed, Sep 10, 2014 at 8:57 PM, Mike Jones <<>> wrote:
Hi Stephen.  Thanks for your detailed and useful review.  I’ve cc’ed the working group in my reply so they’re aware of the contents of your review.  Replies are inline below…

From: Stephen Kent []
Sent: Tuesday, September 02, 2014 1:09 PM
To:<>; Mike Jones;<>; Moriarty, Kathleen
Subject: SECDIR review of draft-ietf-jose-json-web-key-31


This section imposes a rather wimpy constraint on parameter names:

   The member names within a JWK MUST be unique; recipients MUST either

   reject JWKs with duplicate member names or use a JSON parser that

   returns only the lexically last duplicate member name, as specified

   in Section 15.12 (The JSON Object) of ECMAScript 5.1 [ECMAScript].

This text says that member names MUST be unique, but if they are not, that’s OK too; just use the last instance of a member with a duplicate name. This seems like a terrible design principle. It imposes what appears to be a requirement, then says how to accommodate data structures that fail to meet the requirement. This would seem to encourage sloppy implementations (for JWK generation). I’d like to see the rationale for this.

Unfortunately, the intentional laxness in the spec in this regard is a reflection of the semantics of the actual JSON specifications and implementations.  For instance, says:

   An object whose names are all unique is interoperable in the sense
   that all software implementations receiving that object will agree on
   the name-value mappings.  When the names within an object are not
   unique, the behavior of software that receives such an object is
   unpredictable.  Many implementations report the last name/value pair
   only.  Other implementations report an error or fail to parse the
   object, and some implementations report all of the name/value pairs,
   including duplicates.

This topic has been heavily discussed by the working group, and while the specs used to just say that objects with duplicate member names MUST be rejected, working group members, including Tim Bray (the editor of the JSON spec), prevailed on us to weaken this so that parsers that implement the ECMAscript behavior of returning only the last member name may be legally used.  (The argument was made that there was more security downside in effectively requiring people to write and debug their own strict parsers than in using laxer, but well-supported and debugged parsers.)

However, we also intentionally require that producers use only one instance of each member name, so that legally produced objects will never exercise the ambiguities that are present in real JSON parsers.  That seemed to be the most practical solution to the working group.

                                                            Thanks again, Stephen,
                                                            -- Mike

jose mailing list<>


Best regards,


Best regards,

jose mailing list<>

- Tim Bray (If you’d like to send me a private message, see