Re: [websec] Strict-Transport-Security syntax redux

Adam Barth <ietf@adambarth.com> Sat, 29 October 2011 03:09 UTC

Return-Path: <ietf@adambarth.com>
X-Original-To: websec@ietfa.amsl.com
Delivered-To: websec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D599A1F0C3D for <websec@ietfa.amsl.com>; Fri, 28 Oct 2011 20:09:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.364
X-Spam-Level:
X-Spam-Status: No, score=-2.364 tagged_above=-999 required=5 tests=[AWL=0.613, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
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 rroy8LnD1vRw for <websec@ietfa.amsl.com>; Fri, 28 Oct 2011 20:09:09 -0700 (PDT)
Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by ietfa.amsl.com (Postfix) with ESMTP id 01C9F1F0C35 for <websec@ietf.org>; Fri, 28 Oct 2011 20:09:08 -0700 (PDT)
Received: by iabn5 with SMTP id n5so5944337iab.31 for <websec@ietf.org>; Fri, 28 Oct 2011 20:09:08 -0700 (PDT)
Received: by 10.231.82.12 with SMTP id z12mr1841518ibk.36.1319857747483; Fri, 28 Oct 2011 20:09:07 -0700 (PDT)
Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx.google.com with ESMTPS id dd36sm8165933ibb.7.2011.10.28.20.09.05 (version=SSLv3 cipher=OTHER); Fri, 28 Oct 2011 20:09:05 -0700 (PDT)
Received: by iabn5 with SMTP id n5so5944283iab.31 for <websec@ietf.org>; Fri, 28 Oct 2011 20:09:05 -0700 (PDT)
Received: by 10.231.47.206 with SMTP id o14mr1834960ibf.18.1319857745061; Fri, 28 Oct 2011 20:09:05 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.231.205.195 with HTTP; Fri, 28 Oct 2011 20:08:34 -0700 (PDT)
In-Reply-To: <4EAB66B3.4090404@KingsMountain.com>
References: <4EAB66B3.4090404@KingsMountain.com>
From: Adam Barth <ietf@adambarth.com>
Date: Fri, 28 Oct 2011 20:08:34 -0700
Message-ID: <CAJE5ia8SkXpwymXVgbjE7YejeNwoMsieUMMgHyBUbi5w2508iQ@mail.gmail.com>
To: "=JeffH" <Jeff.Hodges@kingsmountain.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: IETF WebSec WG <websec@ietf.org>
Subject: Re: [websec] Strict-Transport-Security syntax redux
X-BeenThere: websec@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Web Application Security Minus Authentication and Transport <websec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/websec>, <mailto:websec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/websec>
List-Post: <mailto:websec@ietf.org>
List-Help: <mailto:websec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/websec>, <mailto:websec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 29 Oct 2011 03:09:10 -0000

On Fri, Oct 28, 2011 at 7:36 PM, =JeffH <Jeff.Hodges@kingsmountain.com> wrote:
>>> Strict-Transport-Security = "Strict-Transport-Security" ":"
>>> directive *( ";" [ directive ] )
>>>
>>> STS directives:
>>>
>>> directive = max-age | includeSubDomains | STS-d-ext
>>>
>>> max-age = "max-age" "=" delta-seconds
>>
>> What happens with
>>
>>    max-age="1"
>>
>> ?
>>
>> Do you expect all recipients to reject this? Depending on the parsing
>> API they use they might not even know that the value was quoted on the
>> wire.
>
> Offhand, I'm not super sure, but after thinking about it while
> researching/writing the below, I'm thinking "yes", max-age="1" is invalid
> according to the ABNF and we should do whatever we do in error cases (which
> is a separate open question). But implementors' parsing API and its problems
> are out-of-scope for a spec such as this.
>
> This obviously isn't the first HTTP response header field with such a syntax
> and thus these potential issues (this one with a delta-seconds value, and
> the issue you note below wrt "includeSubDomains"), yes?
>
> In doing a quick grep on RFCs for delta-seconds, I note that some of the
> specs using it (I didn't look at them all) appear to not directly address
> the case above.
>
> Except for RFC6265, which in the algorithm for parsing "Max-Age=", it
> algorithmically provides for ignoring a value that doesn't match the
> effective value ABNF of..
>
>  ["-"]*DIGIT
>
> ..which would catch the max-age="1" case, but doesn't seem to explicitly
> address..
>
>  max-age=

That's handled by some more general processing rules in the spec.  The
net result is that it's ignored.

> But in any case, perhaps (additional) browser implementor folk could chime
> in here -- do we really need to address such detail-level issues (both of
> the examples above and below) in the syntax/grammar we specify in specs such
> as these? Or is the new ABNF proposed in the original message in this thread
> sufficient?

Generally, we prefer to be instructed exactly how to behave for every
possible input (even illegal ones).  There's a long history of
quoted-string not being implemented correctly by browsers.  I spec
this as just splitting the string on ; and then processing each
substring separately, ignoring bogus/future ones.  I know Julian has a
dream that all HTTP headers will be parsed the same, but quoted-string
is sufficiently ill-defined w.r.t. error handling that I prefer to
avoid it.

>> > includeSubDomains = "includeSubDomains"
>>
>> There's a tiny risk that some implementations will handle value-less
>> parameters the same way as parameters with empty values, such as
>>
>>    includeSubDomains=
>>
>> or
>>
>>    includeSubDomains=""
>>
>> but maybe I'm over-engineering here.
>
> Yes, I'm wondering if this might be over-engineering -- I note that in
> RFC 6266 you didn't distinguish/address this sort of case for "inline" or
> "attachment" -- are you feeling now that you should have, and thus we ought
> to do so going forward?
>
>
>> Also, identifiers "max-age" and "includeSubDomains" are
>> case-insensitive, right? This follows from the ABNF,
>
> yes, and yes.
>
>> but might be worth
>> saying again in prose; in particular because it also needs to be the
>> case for all future extensions.
>
> Agreed. I see how you did it in RFC 6266 and will endeavor to do similarly.
>
> thanks again,
>
> =JeffH
>
>
> _______________________________________________
> websec mailing list
> websec@ietf.org
> https://www.ietf.org/mailman/listinfo/websec
>