Re: [jose] #27: member names MUST be unique needs additional text

"Manger, James H" <James.H.Manger@team.telstra.com> Thu, 27 June 2013 06:30 UTC

Return-Path: <James.H.Manger@team.telstra.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 C2ABC21F9C5B for <jose@ietfa.amsl.com>; Wed, 26 Jun 2013 23:30:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.901
X-Spam-Level:
X-Spam-Status: No, score=-0.901 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, HTML_MESSAGE=0.001, RELAY_IS_203=0.994]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RehNFaFs-XCf for <jose@ietfa.amsl.com>; Wed, 26 Jun 2013 23:30:02 -0700 (PDT)
Received: from ipxbno.tcif.telstra.com.au (ipxbno.tcif.telstra.com.au [203.35.82.204]) by ietfa.amsl.com (Postfix) with ESMTP id DD15D21F9C60 for <jose@ietf.org>; Wed, 26 Jun 2013 23:30:00 -0700 (PDT)
X-IronPort-AV: E=Sophos; i="4.87,950,1363093200"; d="scan'208,217"; a="136441261"
Received: from unknown (HELO ipcani.tcif.telstra.com.au) ([10.97.216.200]) by ipobni.tcif.telstra.com.au with ESMTP; 27 Jun 2013 16:29:59 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7118"; a="91005249"
Received: from wsmsg3756.srv.dir.telstra.com ([172.49.40.84]) by ipcani.tcif.telstra.com.au with ESMTP; 27 Jun 2013 16:29:59 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by wsmsg3756.srv.dir.telstra.com ([172.49.40.84]) with mapi; Thu, 27 Jun 2013 16:29:59 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: Tim Bray <tbray@textuality.com>
Date: Thu, 27 Jun 2013 16:29:58 +1000
Thread-Topic: [jose] #27: member names MUST be unique needs additional text
Thread-Index: Ac5y/csF1c6qnG6VTGGz8Tyy5Pl0wgAABhBQ
Message-ID: <255B9BB34FB7D647A506DC292726F6E1151BEDDD3C@WSMSG3153V.srv.dir.telstra.com>
References: <061.bb7bbe0b618ec6b74904f48bdb9bb312@trac.tools.ietf.org> <076.a597050ecb4fb25084cec65f7174dc7e@trac.tools.ietf.org> <033b01ce729b$26ff5c90$74fe15b0$@augustcellars.com> <4E1F6AAD24975D4BA5B16804296739436789B4CC@TK5EX14MBXC283.redmond.corp.microsoft.com> <03b401ce72e5$002c65f0$008531d0$@augustcellars.com> <4E1F6AAD24975D4BA5B16804296739436789D4EA@TK5EX14MBXC283.redmond.corp.microsoft.com> <CAHBU6ivNow2xhDvRj7gG2gmHQ+C-ejEHCQubK=LwUtrXxdW6MA@mail.gmail.com> <255B9BB34FB7D647A506DC292726F6E1151BE45737@WSMSG3153V.srv.dir.telstra.com> <CAHBU6itHZ4NvGLyRqfDFaC9gkWD1_6dxhY=uVmwpyL+5Ay+j2w@mail.gmail.com>
In-Reply-To: <CAHBU6itHZ4NvGLyRqfDFaC9gkWD1_6dxhY=uVmwpyL+5Ay+j2w@mail.gmail.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: multipart/alternative; boundary="_000_255B9BB34FB7D647A506DC292726F6E1151BEDDD3CWSMSG3153Vsrv_"
MIME-Version: 1.0
Cc: Mike Jones <Michael.Jones@microsoft.com>, Jim Schaad <ietf@augustcellars.com>, "jose@ietf.org" <jose@ietf.org>, "draft-ietf-jose-json-web-signature@tools.ietf.org" <draft-ietf-jose-json-web-signature@tools.ietf.org>
Subject: Re: [jose] #27: member names MUST be unique needs additional text
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: Thu, 27 Jun 2013 06:30:08 -0000

Most JSON libraries that silently accept [sob] dupe keys at least consistently use the last key. Allowing just that behaviour (or rejecting dupes), while forbidding acceptance of a non-last dupe (eg first key), is safe and allows most JSON libraries to be used. Since this accepts most libraries I think it is practical.

Hence I suggest:


>   A creator of a JOSE message MUST NOT put duplicate names in any JSON

> object in a JOSE header.

>   To prevent attacks where a JOSE message is interpreted as different

> valid messages by different recipients, each recipient MUST either

> reject messages with duplicate names or accept only the last name.

This isn’t “truly predictable” as a message with dupes might be accepted or rejected. The crucial point is that if a message is accepted it is predictable.

--
James Manger

From: Tim Bray [mailto:tbray@textuality.com]
Sent: Thursday, 27 June 2013 4:16 PM
To: Manger, James H
Cc: Mike Jones; Jim Schaad; jose@ietf.org; draft-ietf-jose-json-web-signature@tools.ietf.org
Subject: Re: [jose] #27: member names MUST be unique needs additional text

Well, you have a practical problem in that most implementers will want to use a standard JSON library, which is good practice because it will be well-debugged, and most libraries [sob] silently take care of dupe keys and don’t have a way to tell the client software what happened. So if you want truly predictable behavior, you’re forcing the use of hand-constructed JSON parsers. And that sucks, because getting good performance in JSON parsing is surprisingly hard, with dramatic performance differences between implementations. So you’re forcing receiving software which wants to be conformant to use a hand-rolled parser which will probably have lousy performance and have other bugs which in fact may compromise security more than dupe-key tricks could.  -T

On Wed, Jun 26, 2013 at 10:39 PM, Manger, James H <James.H.Manger@team.telstra.com<mailto:James.H.Manger@team.telstra.com>> wrote:
> I think it’s a nice clean minimal solution to say that producers MUST
> NOT generate dupes, end of story.  I don’t think saying anything beyond
> that adds value. -T
Clean and minimal that may be, but it ignores the security issue. We don't want a malicious producer (who is so malicious they ignore a MUST) to create JOSE messages that a JOSE-compliant security layer accepts as "benign interpretation #1" so it passes the message on to the JOSE-compliant backend app that acts on "nasty interpretation #2".

--
James Manger