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

=JeffH <Jeff.Hodges@KingsMountain.com> Thu, 06 October 2011 23:20 UTC

Return-Path: <Jeff.Hodges@KingsMountain.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 B7DFE21F8BFE for <websec@ietfa.amsl.com>; Thu, 6 Oct 2011 16:20:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -100.44
X-Spam-Level:
X-Spam-Status: No, score=-100.44 tagged_above=-999 required=5 tests=[AWL=0.055, BAYES_00=-2.599, FH_RELAY_NODNS=1.451, HELO_MISMATCH_COM=0.553, RDNS_NONE=0.1, 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 VxyPOX+W3wl1 for <websec@ietfa.amsl.com>; Thu, 6 Oct 2011 16:20:45 -0700 (PDT)
Received: from oproxy4-pub.bluehost.com (oproxy4.bluehost.com [IPv6:2605:dc00:100:2::a4]) by ietfa.amsl.com (Postfix) with SMTP id 8B9B421F8BEF for <websec@ietf.org>; Thu, 6 Oct 2011 16:20:45 -0700 (PDT)
Received: (qmail 20911 invoked by uid 0); 6 Oct 2011 23:23:57 -0000
Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by cpoproxy1.bluehost.com with SMTP; 6 Oct 2011 23:23:57 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kingsmountain.com; s=default; h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID; bh=faIpdRHYBkAv4dKk9a2XN+QEK9OPeN6JpiFvQ2xTZhY=; b=p/DrM9loXgPEZfsl2mZBAswo5M8N1qWd3L1t5/I+xrnI/GOorf6kOp1YuIQEe/4j9l1qAnf8IdmdLJRmKvNyJ6as7BPNjF3QEcjEX7Rp3r7r/37TB8hXm2WdaHS7LNZB;
Received: from c-24-4-122-173.hsd1.ca.comcast.net ([24.4.122.173] helo=[192.168.11.10]) by box514.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from <Jeff.Hodges@KingsMountain.com>) id 1RBxIC-0003wg-Pn; Thu, 06 Oct 2011 17:23:56 -0600
Message-ID: <4E8E388B.8020202@KingsMountain.com>
Date: Thu, 06 Oct 2011 16:23:55 -0700
From: =JeffH <Jeff.Hodges@KingsMountain.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15
MIME-Version: 1.0
To: Ryan Sleevi <ryan-ietfhasmat@sleevi.com>, IETF WebSec WG <websec@ietf.org>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Identified-User: {11025:box514.bluehost.com:kingsmou:kingsmountain.com} {sentby:smtp auth 24.4.122.173 authed with jeff.hodges+kingsmountain.com}
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: Thu, 06 Oct 2011 23:20:47 -0000

Hi Ryan, thanks for the detailed feedback.

> Following Julian Reschke's questions, I also had a few questions related
> to the draft-02 syntax. I've been basing my understanding on RFC 5234,
> which I understand to be the most current/relevant to understanding the
> syntax.
>
>
> First, maxAge and includeSubDomains both include value extension points,
> defined as:
>
> 	maxAge     = "max-age"  OWS  "="  OWS  delta-seconds  [ OWS v-ext ]
> 	includeSubDomains =  "includeSubDomains"  [ OWS v-ext ]
> 	v-ext      = value     ; STS extension value
>
> However, the rule for OWS is specified as:
>
> 	OWS       = *( [ CRLF ] WSP )
>
> As written, it would seem that the OWS between either delta-seconds or
> "includeSubDomains" can legitimately be omitted before the v-ext. As best
> I can tell, this would mean that the following values would still be
> valid:
>
> 	max-age=123.456
> 	includeSubDomainsabc
>
> In the first case ".456" is the v-ext, while in the second, "abc" is. In
> both cases, because the OWS is truly optional (valid to have 0
> occurrences), only the v-ext is present.

yes, trying to use the OWS construction there is broken as you point out.


<snip/>
> To remedy this, I believe some form of explicit delimiter between the
> existing values and the v-ext should be defined for the existing headers.
> If the intent was to have extension values whitespace separated, then
> would the following modification to introduce required whitespace solve
> it?
>
> 	maxAge     = "max-age"  OWS  "="  OWS  delta-seconds  [ RWS v-ext ]
> 	includeSubDomains =  "includeSubDomains"  [ RWS v-ext ]
> 	v-ext      = value     ; STS extension value
> 	OWS       = *( [ CRLF ] WSP )
> 	RWS       = 1*( [ CRLF ] WSP )

Yes, using a required whitespace (RWS) construction would seem to fix it. 
However, since we've migrated to base the ABNF on RFC2616 and not HTTPbis, we 
should perhaps whole-hog and use the former's LWS (linear whitespace) construct 
which has the "implied whitespace" notion, and get rid of the OWS stuff.


> Alternatively, can/should the v-ext be dropped entirely, and extensions to
> the STS header be accomplished via defining a new STS-d-ext?

yes, that's a possibility. I put the v-ext thing in there with max-age for 
completeness without a good use case, and maybe it'll just cause more trouble 
than its worth.


> Second, as currently specified, extension directives take the form of:
>
> 	STS-d      = STS-d-cur / STS-d-ext
> 	STS-d-ext  = name      ; STS extension directive
> 	name       = token
> 	token      = 1*tchar
> 	tchar      = "!" / "#" / "$" / "%" / "&" / "'" / "*"
>       	     / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
> 	           / DIGIT / ALPHA
>
> As currently written, STS-d-ext doesn't seem to be able to contain name
> "=" value pairs such as those used by Evans' and Palmer's pinning draft,
> because "=" is not a valid token character. Likewise, it wouldn't be able
> to contain "#rule" style lists, because comma is not a valid tchar.

good catch.


> Should STS-d-ext be defined as "value" instead, so that it contain a wider
> range of characters?

offhand, "value" seems the way to go to me.

Again, thanks much for your review, I'm working on getting new rev out with 
repaired ABNF amongst other things.

=JeffH