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

Willy Tarreau <w@1wt.eu> Mon, 21 January 2013 00:44 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 5155521F8700 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 20 Jan 2013 16:44:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8
X-Spam-Level:
X-Spam-Status: No, score=-8 tagged_above=-999 required=5 tests=[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 5yiWG4cVpdUt for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 20 Jan 2013 16:44:32 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 6DCBF21F86FC for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 20 Jan 2013 16:44:32 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Tx5UN-0003gp-Ob for ietf-http-wg-dist@listhub.w3.org; Mon, 21 Jan 2013 00:43:51 +0000
Resent-Date: Mon, 21 Jan 2013 00:43:51 +0000
Resent-Message-Id: <E1Tx5UN-0003gp-Ob@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <w@1wt.eu>) id 1Tx5UH-0003g9-BV for ietf-http-wg@listhub.w3.org; Mon, 21 Jan 2013 00:43:45 +0000
Received: from 1wt.eu ([62.212.114.60]) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <w@1wt.eu>) id 1Tx5UF-0002Id-Vf for ietf-http-wg@w3.org; Mon, 21 Jan 2013 00:43:45 +0000
Received: (from willy@localhost) by mail.home.local (8.14.4/8.14.4/Submit) id r0L0grsw017029; Mon, 21 Jan 2013 01:42:53 +0100
Date: Mon, 21 Jan 2013 01:42:53 +0100
From: Willy Tarreau <w@1wt.eu>
To: Mark Nottingham <mnot@mnot.net>
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
Message-ID: <20130121004253.GU6838@1wt.eu>
References: <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> <CA0A2954-F3D6-4255-A38F-3BD5D7E0FE0C@mnot.net> <20130120071517.GG6838@1wt.eu> <742F7073-42A1-44BC-9889-75E33115F84C@mnot.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <742F7073-42A1-44BC-9889-75E33115F84C@mnot.net>
User-Agent: Mutt/1.4.2.3i
Received-SPF: pass client-ip=62.212.114.60; envelope-from=w@1wt.eu; helo=1wt.eu
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: AWL=-2.034, BAYES_00=-1.9, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1Tx5UF-0002Id-Vf ece7789250233311520922fadd777a82
X-Original-To: ietf-http-wg@w3.org
Subject: Re: #429: Multiple header fields with the same field name - unwritten assumption about quoted commas in values?
Archived-At: <http://www.w3.org/mid/20130121004253.GU6838@1wt.eu>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/16069
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>

Hi Mark,

On Mon, Jan 21, 2013 at 11:17:14AM +1100, Mark Nottingham wrote:
> 
> On 20/01/2013, at 6:15 PM, Willy Tarreau <w@1wt.eu> wrote:
> 
> > Hi Mark,
> > 
> > On Sun, Jan 20, 2013 at 01:53:39PM +1100, Mark Nottingham wrote:
> >> Now <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/429>.
> > 
> > Quite frankly, I'd prefer to stay on Roy's side which consists in saying
> > that when a compliant message is passed to an intermediary, the output is
> > a compliant message, and when a non-compliant message is passed, the
> > output is indetermined.
> > 
> > Otherwise we'll have to document all possible corner cases, which will
> > result in even worse implementations givent that we won't be exhaustive.
> > 
> > Probably that all the trouble comes from the obligations made to senders,
> > with senders sometimes being intermediaries. I've been bothered by this
> > in the past. So the point above at least would solve the issue for them :
> > they have to emit clean things but if they forward stupid things, well,
> > it's the other side's fault.
> 
> 
> I know, and agree with the spirit of what you're saying. 
> 
> Digging around, it's gratifying to see that we already cover this somewhat in [1]:
> 
> > Whether the field is a single value, or whether it can be a list (delimited
> > by commas; see Section 3.2 of [Part1]).
> > 
> > If it does not use the list syntax, document how to treat messages where
> > the field occurs multiple times (a sensible default would be to ignore the
> > field, but this might not always be the right choice).
> > 
> > Note that intermediaries and software libraries might combine multiple
> > header field instances into a single one, despite the field's definition
> > not allowing the list syntax. A robust format enables recipients to
> > discover these situations (good example: "Content-Type", as the comma can
> > only appear inside quoted strings; bad example: "Location", as a comma can
> > occur inside a URI).

Oh Great.

> I think the remaining questions are:
> 
>  - Is it necessary to say anything regarding Location? The security aspect
>  here is pretty limited, AFAICT; while it can certainly cause interop
>  problems (the easy answer to which is "don't do that"), I don't see how it's
>  useful to say anything about the security risks, because if an attacker can
>  insert a new Location header in your response, they can do pretty much
>  anything else they want too... And, unlike Content-Length (where we *have*
>  said something), it doesn't affect framing.

Location has no special status here in my opinion. I provided it as an
example but it's harmless (at least as harmless as many other fields).

>  - Are there any other headers that we define where something should be said?
>  I think we've already reviewed and said no. Anyone?

In my opinion, as long as framing is not affected, I don't think so.
And the other fields which affect framing already support commas (eg:
Connection, Transfer-Encoding). I suspect that Content-Length was the
only one to have such a nasty effect.

One might consider that Max-Forwards could affect how far the message
goes, but this is seldom used and more for tracing than anything else.

> So, absent any further discussion, I'll close the issue.

I think that's OK.

Cheers,
Willy