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

Mike Jones <Michael.Jones@microsoft.com> Wed, 26 June 2013 19:30 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 1D61411E8129 for <jose@ietfa.amsl.com>; Wed, 26 Jun 2013 12:30:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599]
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 hhDKp4NPszVL for <jose@ietfa.amsl.com>; Wed, 26 Jun 2013 12:30:19 -0700 (PDT)
Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0206.outbound.protection.outlook.com [207.46.163.206]) by ietfa.amsl.com (Postfix) with ESMTP id B8BB611E81D0 for <jose@ietf.org>; Wed, 26 Jun 2013 12:30:18 -0700 (PDT)
Received: from BL2FFO11FD017.protection.gbl (10.173.161.204) by BL2FFO11HUB042.protection.gbl (10.173.161.0) with Microsoft SMTP Server (TLS) id 15.0.717.3; Wed, 26 Jun 2013 19:30:11 +0000
Received: from TK5EX14HUBC101.redmond.corp.microsoft.com (131.107.125.37) by BL2FFO11FD017.mail.protection.outlook.com (10.173.161.35) with Microsoft SMTP Server (TLS) id 15.0.707.0 via Frontend Transport; Wed, 26 Jun 2013 19:30:11 +0000
Received: from TK5EX14MBXC283.redmond.corp.microsoft.com ([169.254.2.25]) by TK5EX14HUBC101.redmond.corp.microsoft.com ([157.54.7.153]) with mapi id 14.03.0136.001; Wed, 26 Jun 2013 19:30:00 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: Jim Schaad <ietf@augustcellars.com>, "draft-ietf-jose-json-web-signature@tools.ietf.org" <draft-ietf-jose-json-web-signature@tools.ietf.org>
Thread-Topic: [jose] #27: member names MUST be unique needs additional text
Thread-Index: AQHOcW13mt9O8ZWU/EKeLtDRf+ylY5lHKNsAgAEqlQCAAA6YkA==
Date: Wed, 26 Jun 2013 19:29:59 +0000
Message-ID: <4E1F6AAD24975D4BA5B16804296739436789B4CC@TK5EX14MBXC283.redmond.corp.microsoft.com>
References: <061.bb7bbe0b618ec6b74904f48bdb9bb312@trac.tools.ietf.org> <076.a597050ecb4fb25084cec65f7174dc7e@trac.tools.ietf.org> <033b01ce729b$26ff5c90$74fe15b0$@augustcellars.com>
In-Reply-To: <033b01ce729b$26ff5c90$74fe15b0$@augustcellars.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [157.54.51.72]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-Forefront-Antispam-Report: CIP:131.107.125.37; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(189002)(199002)(377454003)(51704005)(13464003)(4396001)(47976001)(54316002)(74662001)(47446002)(54356001)(69226001)(56776001)(47736001)(74366001)(44976004)(56816003)(55846006)(16406001)(59766001)(77982001)(23676002)(50986001)(79102001)(66066001)(51856001)(63696002)(31966008)(50466002)(76796001)(81342001)(76482001)(49866001)(74706001)(6806003)(81542001)(65816001)(47776003)(46102001)(53806001)(74502001)(80022001)(74876001)(33656001)(76786001)(77096001)(20776003); DIR:OUT; SFP:; SCL:1; SRVR:BL2FFO11HUB042; H:TK5EX14HUBC101.redmond.corp.microsoft.com; CLIP:131.107.125.37; RD:InfoDomainNonexistent; MX:1; A:1; LANG:en;
X-OriginatorOrg: microsoft.onmicrosoft.com
X-O365ENT-EOP-Header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY)
X-Forefront-PRVS: 08897B549D
Cc: "jose@ietf.org" <jose@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: Wed, 26 Jun 2013 19:30:24 -0000

The operable sentence in my suggested text below is this one: "If the platform's JSON parser does not reject input with duplicate member names, the input will first need to be separately parsed to reject these invalid inputs before using the platform's parser".  In other words, if the JSON parser in the development platform you are using does not reject inputs with duplicate member names, you will need to write a separate JSON parser that detects this invalid input and rejects it.

This parser could either just be a validator, returning TRUE or FALSE for whether the JSON is valid for JOSE - in which case you'd then pass any inputs validating as TRUE to the platform's JSON parser, or it could be a replacement parser, in which case your code would not use the development platform's JSON parser at all.  I suspect people would be more likely to do the former than the latter, but both approaches are equivalent.

BTW, if it's your sense that there's a problem occurring in the JSON working group with respect to enabling strict JSON parsing, we probably need to become active there.  For instance, even if the spec allows duplicate member names like the ECMA spec does, the RFC could recommend or require that parsers support a "strict" mode, which rejects these unnecessarily lax inputs.  Then JOSE implementations could use that.

				-- Mike

-----Original Message-----
From: Jim Schaad [mailto:ietf@augustcellars.com] 
Sent: Wednesday, June 26, 2013 11:30 AM
To: 'jose issue tracker'; draft-ietf-jose-json-web-signature@tools.ietf.org; Mike Jones
Cc: jose@ietf.org
Subject: RE: [jose] #27: member names MUST be unique needs additional text

<no hat>

I consider myself to be reasonably competent in both English and Technical English.  I have no idea what I am supposed to be doing to deal with the text below.  Does this mean that I need to write an independent parser?  What about cases where it is coming in on a stream and I don't get to see the data before the parse occurs?  How are they interpreted differently?  What exactly is this supposed to be addressing.  Much of this could be skipped when we said don't do it.  Since this is no longer a viable statement due to the state of parsers, we need to be more explicit and say what is going on.

No I don't consider the suggested text to be adequate.

> -----Original Message-----
> From: jose-bounces@ietf.org [mailto:jose-bounces@ietf.org] On Behalf 
> Of jose issue tracker
> Sent: Tuesday, June 25, 2013 5:41 PM
> To: draft-ietf-jose-json-web-signature@tools.ietf.org;
> michael.jones@microsoft.com
> Cc: jose@ietf.org
> Subject: Re: [jose] #27: member names MUST be unique needs additional 
> text
> 
> #27: member names MUST be unique needs additional text
> 
> 
> Comment (by michael.jones@microsoft.com):
> 
>  The JWS draft currently says:
> 
>          The Header Parameter Names within the JWS Header MUST be unique;
>          JWSs with duplicate Header Parameter Names MUST be rejected.
> 
>  How about changing this to:
> 
>          The Header Parameter Names within the JWS Header MUST be unique;
>          JWSs with duplicate Header Parameter Names MUST be rejected.
>          This is necessary to prevent attacks in which the same JWS 
> might  be interpreted
>          in different ways by different implementations and to prevent  attackers
>          from hiding extra content in duplicate member values.
>          If the platform s JSON parser does not reject input with 
> duplicate member names,
>          the input will first need to be separately parsed to reject 
> these  invalid inputs
>          before using the platform s parser.
> 
> --
> -------------------------+--------------------------------------------
> -------------------------+--
> -------------------------+---
>  Reporter:               |       Owner:  draft-ietf-jose-json-web-
>   ietf@augustcellars.com |  signature@tools.ietf.org
>      Type:  defect       |      Status:  new
>  Priority:  major        |   Milestone:
> Component:  json-web-    |     Version:
>   signature              |  Resolution:
>  Severity:  -            |
>  Keywords:               |
> -------------------------+--------------------------------------------
> -------------------------+--
> -------------------------+---
> 
> Ticket URL: 
> <http://trac.tools.ietf.org/wg/jose/trac/ticket/27#comment:1>
> jose <http://tools.ietf.org/jose/>
> 
> _______________________________________________
> jose mailing list
> jose@ietf.org
> https://www.ietf.org/mailman/listinfo/jose