Re: Multiple header fields with the same field name - unwritten assumption about quoted commas in values?

Mark Nottingham <mnot@mnot.net> Sun, 20 January 2013 02:52 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 222EE21F8488 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 19 Jan 2013 18:52:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.152
X-Spam-Level:
X-Spam-Status: No, score=-9.152 tagged_above=-999 required=5 tests=[AWL=1.447, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C14ngacewh6O for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 19 Jan 2013 18:52:50 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id F365D21F8496 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 19 Jan 2013 18:52:49 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Twl0k-00080E-OG for ietf-http-wg-dist@listhub.w3.org; Sun, 20 Jan 2013 02:51:54 +0000
Resent-Date: Sun, 20 Jan 2013 02:51:54 +0000
Resent-Message-Id: <E1Twl0k-00080E-OG@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <mnot@mnot.net>) id 1Twl0f-0007zU-W5 for ietf-http-wg@listhub.w3.org; Sun, 20 Jan 2013 02:51:50 +0000
Received: from mxout-07.mxes.net ([216.86.168.182]) by maggie.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <mnot@mnot.net>) id 1Twl0f-00027W-9T for ietf-http-wg@w3.org; Sun, 20 Jan 2013 02:51:49 +0000
Received: from [192.168.1.80] (unknown [118.209.240.13]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 902D122E1F3; Sat, 19 Jan 2013 21:51:24 -0500 (EST)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <20130116194151.GD21039@1wt.eu>
Date: Sun, 20 Jan 2013 13:51:20 +1100
Cc: Zhong Yu <zhong.j.yu@gmail.com>, "Roy T. Fielding" <fielding@gbiv.com>, Nico Williams <nico@cryptonector.com>, Karl Dubost <karld@opera.com>, Julian Reschke <julian.reschke@gmx.de>, Piotr Dobrogost <p@ietf.dobrogost.net>, ietf-http-wg@w3.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <F509ACE8-C27C-4869-91CC-1296E476DF48@mnot.net>
References: <CAK3OfOj8G3gFbTK_vPSnjS0qij+SUB3t9CdG80FYW5tbGgKR3A@mail.gmail.com> <C6A43E78-4F94-4FE3-A049-678555896FEC@mnot.net> <CAK3OfOiS1UPqvsk5H8RWUKyw8MB=uykeMkXzZoffm6732=UjMg@mail.gmail.com> <86DE887E-B189-40D2-A867-C81CFB0434AB@mnot.net> <CAK3OfOiWzJqHr8VSzn6WFcWRGJEr59XiUyh+wGTDnf1ydVL=3g@mail.gmail.com> <1390897A-59CF-451B-B3CD-BB39906BDACD@mnot.net> <CAK3OfOg17M3LTPwFJXFuHrq4AZh505hq27xoeVwJsPTvA7_3aw@mail.gmail.com> <A9D632AF-448F-4B5A-B3A0-33CF9BFDC3B4@gbiv.com> <20130116065254.GA12426@1wt.eu> <CACuKZqH226evA0v26aop5oXtbjm8m=ePFip=1roJmrA3tygrGg@mail.gmail.com> <20130116194151.GD21039@1wt.eu>
To: Willy Tarreau <w@1wt.eu>
X-Mailer: Apple Mail (2.1499)
Received-SPF: pass client-ip=216.86.168.182; envelope-from=mnot@mnot.net; helo=mxout-07.mxes.net
X-W3C-Hub-Spam-Status: No, score=-3.2
X-W3C-Hub-Spam-Report: AWL=-3.214, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1Twl0f-00027W-9T dc9700a02a05113ede7264a56babd158
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Multiple header fields with the same field name - unwritten assumption about quoted commas in values?
Archived-At: <http://www.w3.org/mid/F509ACE8-C27C-4869-91CC-1296E476DF48@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/16034
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 17/01/2013, at 6:41 AM, Willy Tarreau <w@1wt.eu> wrote:

> Hi,
> 
> On Wed, Jan 16, 2013 at 12:32:22PM -0600, Zhong Yu wrote:
>> If different applications interpret duplicate headers differently, we
>> have a serious problem
>> 
>>    Location: http://abc.com
>>    Location: http://xyz.com
>> 
>> Some chooses the 1st one, some chooses the 2nd one, and some may see
>> the merged `http://abc.com,http://xyz.com` (a valid URI)
> 
> Obviously and the issue is the same with many headers. I was just explaining
> that this is an example of a *non-compliant* input which is then turned into
> a different non-compliant output by a middlebox. The problem clearly is with
> the input and not with the operation performed by the middlebox. So we could
> recommend middlebox authors against merging the headers because it's hard to
> do it right, but we have no reason to add a SHOULD NOT which would turn some
> existing implementations to non-compliant for no reason.


I think the middlebox aspect of this is a red herring. What's happening above is that a non-conformant message is being turned into, potentially, conformant input (if there's no space around the comma) -- regardless of where it takes place. I.e., that combination into a single value could just as easily be done in the UA, before the Location is followed.

It seems to me that that's worth at least a note in Security Considerations. I do agree that a requirement -- especially targeted at a particular kind of recipient, rather than *all* recipients -- is probably too much. This is more on the scale of implementation advice. YMMV.

--
Mark Nottingham   http://www.mnot.net/