Re: [OAUTH-WG] Possible alternative resolution to issue 26

Julian Reschke <julian.reschke@gmx.de> Fri, 07 October 2011 14:27 UTC

Return-Path: <julian.reschke@gmx.de>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6D63721F877F for <oauth@ietfa.amsl.com>; Fri, 7 Oct 2011 07:27:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.306
X-Spam-Level:
X-Spam-Status: No, score=-104.306 tagged_above=-999 required=5 tests=[AWL=-1.707, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 8r391KTR4uVK for <oauth@ietfa.amsl.com>; Fri, 7 Oct 2011 07:27:25 -0700 (PDT)
Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by ietfa.amsl.com (Postfix) with SMTP id 33C6C21F8753 for <oauth@ietf.org>; Fri, 7 Oct 2011 07:27:24 -0700 (PDT)
Received: (qmail invoked by alias); 07 Oct 2011 14:30:37 -0000
Received: from mail.greenbytes.de (EHLO [192.168.1.140]) [217.91.35.233] by mail.gmx.net (mp064) with SMTP; 07 Oct 2011 16:30:37 +0200
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX18WcwpfEO4WH5h9s4dReBxAOm/7ap8QpBf1zTQuJ5 AKJagtChQyYO81
Message-ID: <4E8F0D09.3020601@gmx.de>
Date: Fri, 07 Oct 2011 16:30:33 +0200
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
MIME-Version: 1.0
To: "Manger, James H" <James.H.Manger@team.telstra.com>
References: <4E1F6AAD24975D4BA5B16804296739435C21DD2C@TK5EX14MBXC284.redmond.corp.microsoft.com> <255B9BB34FB7D647A506DC292726F6E1129015546C@WSMSG3153V.srv.dir.telstra.com> <1317621663.4810.YahooMailNeo@web31813.mail.mud.yahoo.com> <4E1F6AAD24975D4BA5B16804296739435C226298@TK5EX14MBXC284.redmond.corp.microsoft.com> <4E1F6AAD24975D4BA5B16804296739435C22CA77@TK5EX14MBXC284.redmond.corp.microsoft.com> <4E8EC720.8030909@gmx.de> <255B9BB34FB7D647A506DC292726F6E112904F03C7@WSMSG3153V.srv.dir.telstra.com>
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E112904F03C7@WSMSG3153V.srv.dir.telstra.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 8bit
X-Y-GMX-Trusted: 0
Cc: "oauth@ietf.org" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Possible alternative resolution to issue 26
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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: Fri, 07 Oct 2011 14:27:26 -0000

On 2011-10-07 16:15, Manger, James H wrote:
>> Option 3 has a serious flaw in that it requires escaping the "\" in
>> "\uNNNN", because it is the escape character in quoted-string. I think
>> it's certain that people will be confused by that, and interop problems
>> will happen (unless you have a strong test suite).
>
> No, the "\" in "\uNNNN" would not be escaped.
> The intention with adopting json-string would be to *replace* quoted-string.

You can't "replace" quoted-string.

A recipient will have to be able to parse multiple challenges in a 
single header field value. To do so, it has to understand the syntax of 
params using double quotes. It can't special-case the parsing based on 
what part of the set of challenges it currently is looking at (because 
to do so, it needs to have parsed them first).

> I suggested this was ok as json-string is backward compatible
> with quoted-string. That is not strictly true.
> While json-string decodes "\u00E8" to a single char "è",
> quoted-string decodes it to the 5 chars "u00E8".

Indeed.

> This clash, however, may only be theoretical.
> It is totally pointless to escape "u" as "\u" in a
> quoted-string. I can confidently say it will never
> have been done legitimately. If it does occurs in the wild,
> 99% of cases will be because the sender forgot to escape
> the slash; and 99% of the remaining 1% will be because
> a malicious sender is trying to bypass a security check by
> escaping a char that the software never anticipated would
> be escaped.

But that's how quoted-string is defined, and what a conforming parser 
will do.

If your suggestion is to change that, you will have to bring that up in 
the HTTPbis WG, not here.

> Quoted-string allows 93 ASCII chars to be used as themselves,
> and defines an escaping mechanism to add 2 more chars:
> double-quote and backslash (the escape char itself).
> An escape mechanism to support the last ASCII visible char
> might have been useful in an ASCII world, but it is pointless
> today if it doesn't allow the other 100,000 Unicode chars.

But that argument doesn't change the fact how it is defined.

If we were free to change things, we'd simply state that everything is 
UTF-8.

> If we specify json-string for a field specified elsewhere as
> quoted-string I suspect we will get lucky and solve our Unicode
> issue without causing any actual problems. That is partly
> because I don't think most/many OAuth HTTP clients use
> frameworks that automatically decode quoted-string values
> in their bowels. Do others who write HTTP clients have
> experience to the contrary?

As I said above: a recipient needs to parse header field values that 
contain multiple challenges, and changing the syntax for "quoted-string" 
based on where the param appears is simply a non-starter.

> I prefer option 3 (of the 3), perhaps with a note in the
> spec saying: "Specifying json-string is a wilful violation
> of RFC 2617 that uses quoted-string. It is done to
> add support for Unicode values while supporting all valid
> quoted-string values that occur in practise."

Yes, it would be a willful intentional violation, without - IMHO - a 
strong technical argument to do so. I sure hope the IESG wouldn't accept 
that.

Best regards, Julian