Re: [OAUTH-WG] application/x-www-form-urlencoded vs JSON (Proposal)

Torsten Lodderstedt <torsten@lodderstedt.net> Wed, 05 May 2010 18:38 UTC

Return-Path: <torsten@lodderstedt.net>
X-Original-To: oauth@core3.amsl.com
Delivered-To: oauth@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id EFC2D3A6989 for <oauth@core3.amsl.com>; Wed, 5 May 2010 11:38:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.595
X-Spam-Level:
X-Spam-Status: No, score=-0.595 tagged_above=-999 required=5 tests=[AWL=-0.761, BAYES_40=-0.185, HELO_EQ_DE=0.35, HTML_MESSAGE=0.001]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sGCtjpmnJH0x for <oauth@core3.amsl.com>; Wed, 5 May 2010 11:38:27 -0700 (PDT)
Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.31.37]) by core3.amsl.com (Postfix) with ESMTP id AD61328C12F for <oauth@ietf.org>; Wed, 5 May 2010 11:38:24 -0700 (PDT)
Received: from p4fff1ebc.dip.t-dialin.net ([79.255.30.188] helo=[127.0.0.1]) by smtprelay03.ispgateway.de with esmtpa (Exim 4.68) (envelope-from <torsten@lodderstedt.net>) id 1O9jU2-0007Ng-Bg; Wed, 05 May 2010 20:38:10 +0200
Message-ID: <4BE1BB10.7060009@lodderstedt.net>
Date: Wed, 05 May 2010 20:38:08 +0200
From: Torsten Lodderstedt <torsten@lodderstedt.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: Evan Gilbert <uidude@google.com>
References: <9890332F-E759-4E63-96FE-DB3071194D84@gmail.com> <4BD9E1E3.7060107@lodderstedt.net> <7C01E631FF4B654FA1E783F1C0265F8C4A3EF0B0@TK5EX14MBXC115.redmond.corp.microsoft.com> <z2yf5bedd151004291440g17693f8du9e19a649bef925e4@mail.gmail.com> <w2odaf5b9571004291509x8895a73k384a4b4ddb12b794@mail.gmail.com> <20100430105935.20255m8kdythy6sc@webmail.df.eu> <90C41DD21FB7C64BB94121FBBC2E723439323D0DB0@P3PW5EX1MB01.EX1.SECURESERVER.NET> <AANLkTik3NSJynWfiNWovruPEOT2Y6G1zcWPFOaS_pHdy@mail.gmail.com> <4BE1AF25.7000308@lodderstedt.net> <AANLkTil2_9KOm1eRoC0jxvH99E55K3BEW-T5cgWLay9H@mail.gmail.com> <AANLkTilWV3VVBROXZuky5OLNzM2hz27pEqwG1l6W2Uc1@mail.gmail.com>
In-Reply-To: <AANLkTilWV3VVBROXZuky5OLNzM2hz27pEqwG1l6W2Uc1@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------030404090108000804000100"
X-Df-Sender: 141509
Cc: "oauth@ietf.org" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] application/x-www-form-urlencoded vs JSON (Proposal)
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/oauth>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 05 May 2010 18:38:29 -0000

Am 05.05.2010 20:01, schrieb Evan Gilbert:
>
>
> On Wed, May 5, 2010 at 10:59 AM, Evan Gilbert <uidude@google.com 
> <mailto:uidude@google.com>> wrote:
>
>
>
>     On Wed, May 5, 2010 at 10:47 AM, Torsten Lodderstedt
>     <torsten@lodderstedt.net <mailto:torsten@lodderstedt.net>> wrote:
>
>         Even if not supported directly by the platform there are many
>         JSON libraries available these days.
>
>
>     It's not hard to add JSON support, but it's a factor in the choice.
>
>
>         http://www.json.org/ lists 3 libraries for Objective-C alone.
>
>         Moreover, the JSON documents we are discussing now are simple,
>         something like
>
>
>         { "access_token": "SlAV32hkKG", "expires_in": "3600",
>         "refresh_token": "8xLOxBtZp8" }
>
>         Parsing such a document is not a challenge even without
>         library support.
>
>
>     Per notes above - the client needs to do understand form encoding
>     anyway. The client needs to parse the redirect_uri and also needs
>     to generate form encoded requests.
>
>
> Also, for the User-Agent flow, parsing potentially untrusted JSON in 
> JavaScript is difficult. The normal path of using eval() is unsafe and 
> leads to XSS holes - you need to run regex matcher to verify that the 
> JSON content has no executable code.

You are right, using eval to parse JSON is dangerous and thus as far as 
I understand, the recommended way is to use a JSON parser (aka native 
JSON support)?

regards,
Torsten.