Re: [websec] Question regarding RFC 6797

"Mehner, Carl" <Carl.Mehner@usaa.com> Mon, 26 November 2018 15:52 UTC

Return-Path: <prvs=5868867b53=carl.mehner@usaa.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 B629F130FBE for <websec@ietfa.amsl.com>; Mon, 26 Nov 2018 07:52:07 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.76
X-Spam-Level:
X-Spam-Status: No, score=-5.76 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.46, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=usaa.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fgw8ixg_3U26 for <websec@ietfa.amsl.com>; Mon, 26 Nov 2018 07:52:03 -0800 (PST)
Received: from prodomx102l.usaa.com (prodomx102l.usaa.com [167.24.25.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 03022130F14 for <websec@ietf.org>; Mon, 26 Nov 2018 07:52:02 -0800 (PST)
Received: from pps.filterd (prodomx102l.usaa.com [127.0.0.1]) by prodomx102l.usaa.com (8.16.0.22/8.16.0.22) with SMTP id wAQFaSr2005212 for <websec@ietf.org>; Mon, 26 Nov 2018 09:52:00 -0600
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usaa.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=201408; bh=DD3nE9FqVkcbJt5AAMw2ViUF6MLCtI/oK4YxrWBUVEk=; b=wPwxqeWovBHFTW7tHaZthheIKVgs4cpK66aSAYYhDwb6P7rFgmvvWbAuxdA6DcW2BqWD FYyeGAe6IqYMVKr5yG58p2JMVFr1Kekp+mysqHv7TLAEQs6UTZTL9E6SbhGcJuCmQTWZ Li7JUBj4fEfbNtIjeDpvt3pOIFFmnGexOdZTyHLFjVSo8uiLHURnoZqlBfNIvZ51qADq hCxXLDmk5NMCYfpbFEzWX3F2Jcu6m45hjF3bq9bQZb7aZfOgeXDN2nh5aAo51g3GbG89 sJcobEl6GtmKqJjvmTBL6jFBcGTL9RbjiOMHyDFwh396m+BOLZbOZFaLZ5yaTASoZF48 pA==
Received: from pps.reinject (localhost [127.0.0.1]) by prodomx102l.usaa.com with ESMTP id 2ny29eua64-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <websec@ietf.org>; Mon, 26 Nov 2018 09:52:00 -0600
Received: from prodomx102l.usaa.com (prodomx102l.usaa.com [127.0.0.1]) by pps.reinject (8.16.0.20/8.16.0.20) with SMTP id wAQFlD39012239 for <websec@ietf.org>; Mon, 26 Nov 2018 09:52:00 -0600
Received: from prodex01wdf.eagle.usaa.com (prodex01wdf.eagle.usaa.com [10.225.39.39]) by prodomx102l.usaa.com with ESMTP id 2ny29eua63-1; Mon, 26 Nov 2018 09:52:00 -0600
Received: from PRODEX02WDF.eagle.usaa.com (10.225.39.40) by PRODEX01WDF.eagle.usaa.com (10.225.39.39) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 26 Nov 2018 09:51:59 -0600
Received: from PRODEX02WDF.eagle.usaa.com ([10.225.39.40]) by PRODEX02WDF.eagle.usaa.com ([10.225.39.40]) with mapi id 15.00.1395.000; Mon, 26 Nov 2018 09:51:59 -0600
From: "Mehner, Carl" <Carl.Mehner@usaa.com>
To: "Ben Andrews (beandrew)" <beandrew@cisco.com>, "websec@ietf.org" <websec@ietf.org>
CC: "Darren McKinnon (darmckin)" <darmckin@cisco.com>
Thread-Topic: Question regarding RFC 6797
Thread-Index: AdR6wiwG2dbwAoTgTByzf5RIQikPIgK2SsKw
Date: Mon, 26 Nov 2018 15:51:59 +0000
Message-ID: <83a390bf984341c0a8e55d251f75601b@PRODEX02WDF.eagle.usaa.com>
References: <879670c11a604e03b7d1f9e8ed0888d9@XCH-ALN-005.cisco.com>
In-Reply-To: <879670c11a604e03b7d1f9e8ed0888d9@XCH-ALN-005.cisco.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL1VTQUEiLCJpZCI6IjdlNWFjM2Q3LWFhYzgtNGNlMC1hMTI3LWRlZjY5OWVjODc0MSIsInByb3BzIjpbeyJuIjoiQ2xhc3NpZmljYXRpb24iLCJ2YWxzIjpbeyJ2YWx1ZSI6IlB1YmxpYyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNy4yLjExLjAiLCJUcnVzdGVkTGFiZWxIYXNoIjoieWRQZk45OEUwOW53ZUd2Y25pZmdVSzNiQVRWb1RGaGJKdGZORVMzWHQxeGY5eDNBTWRVUVAzUmpoWE1uUjZsdiJ9
x-usaa-classification: Public
x-ms-exchange-transport-fromentityheader: Hosted
x-c2processedorg: b8bcc573-fb52-4e08-924e-ca559c360d81
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/websec/u8eIgWI7Zpqa2m9iSQaz-AN3CFQ>
Subject: Re: [websec] Question regarding RFC 6797
X-BeenThere: websec@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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: Mon, 26 Nov 2018 15:52:13 -0000

Hi Ben,

> From: websec [mailto:websec-bounces@ietf.org] On Behalf Of Ben Andrews
> Sent: Tuesday, November 13, 2018 5:48 PM
> 
> - The customer (and SSLLabs) reasoning comes from Section 7.1 where it
> states that “If an STS header field is included, the HSTS Host MUST include
> only one such header field.”
> https://tools.ietf.org/html/rfc6797#section-7.1
> * It’s definitely clear that an individual HSTS Host should never add two HSTS
> headers to the packet.
> * What isn’t clear to me is what happens when you have two HSTS hosts
> involved in the connection especially since that same section specifies the
> following which implies that any HSTS should add an HSTS header if it is
> responding to a secure HTTP request.

Well the rfc does say "include" not add. So, even if you treat a proxy as a host, the proxy MUST only send one header.

> “When replying to an HTTP request that was conveyed over a secure
> transport, an HSTS Host SHOULD include in its response message an STS
> header field that MUST satisfy the grammar specified above in Section 6.1”.
> 
> - However, when you look at both Section 8.1 and Appendix A it’s defining
> specific behaviors for when there are more than one HSTS host/header
> which insinuates that having more than one header is not actually invalid.

Discussing how to dealing with multiple headers does not mean that sending multiple headers is valid. 

> “If a UA receives more than one STS header field in an HTTP response
> message over secure transport, then the UA MUST process only the first
> such header field.”
> * This statement especially specifically defines the UA’s behavior when it
> receives more than one HSTS header is received.. Was this intended simply
> to avoid errors, or was the behavior described specifically to support
> situations when you might have more than one HSTS header?

To avoid errors and to have consistency across UAs on dealing with misconfigured HSTS Hosts.

> “An HSTS Host may update UA notions of HSTS Policy via new HSTS header
> field parameter values.  We chose to have UAs honor the "freshest"
> information received from a server because there is the chance of a web site
> sending out an erroneous HSTS Policy, such as a multi-year max-age value,
> and/or an incorrect includeSubDomains directive.”

This is across multiple requests, not within the same response (so it doesn't apply to your example below).

> For example, if you have 2x HSTS Hosts involved in a connection, once source
> HTTP server (ServerA) on the corporate network and one proxy server
> (ServerB) for external users to reach the HTTP server.
> What would be the correct behavior when ServerB receives an HTTPS packet
> from ServerA with an existing HSTS header that it is supposed to proxy to the
> UA:
> A) ServerB should include its own HSTS header as the second header since it
> was the second host to add the HSTS header to the HTTP packet.
> B) ServerB should include its own HSTS header as the first header since it’s
> the “freshest” information.
> C) ServerB should update the existing HSTS header field with any updated
> HSTS header parameters/directives.
> D) ServerB should include its own HSTS header overwriting ServerA’s HSTS
> header completely
> E) ServerB should forward ServerA’s HSTS header without modifying the
> HSTS header in any way.

Logically, the UA would see both servers as the same "HSTS Host", so I would say, "E". Although, you could do 'C' or 'D' if you chose to or had a need to (e.g internal UAs hitting Server A should get one header, but external UAs hitting proxy Server B should get another).
A) would be wrong, because the HSTS Host would be sending multiple headers
B) doesn't make a lot of sense, because the discussion about 'freshness' is more around fixing an old HSTS directive (e.g. replacing one sent weeks ago for 2 years max-age with one sent now with 2-months max-age.) not events that are happening milliseconds apart.

> This question regarding the behavior of HSTS in non-transparent proxy
> situations also brings up the question of what happens when that proxy
> server’s purpose is to transform an external routable domain to an internal
> only domain. Assuming an error-free secure transport, would the UA add the
> domain it used to reach the proxy or if it’s aware of the internal domain
> should it add the internal domain instead since that was the original source of
> the content? This specifically would be an extremely fringe situation that
> wouldn’t apply to most use cases. Not to mention it likely would fall outside
> of the scope of this RFC especially after reading the rationale within Section
> 14.3 and Appendix A, but it definitely would be a situation where more
> guidance on the expected behavior with HSTS in proxy situations could be
> useful.

The UA would only add the domain it used to reach the HSTS Host. If that domain is the proxy then it would note that one, if the domain is the internal-only one, then it would note the internal domain.

> Please let me know if you have any further comments, questions, issues, or
> concerns.
> 
> Kind regards,
> 
> Ben Andrews
> Cisco TAC
> Business Hours: 09:30-17:30 EST M - F
> Tel: (919)574-6712
> Email: mailto:beandrew@cisco.com<mailto:beandrew@cisco.com>
> 
> Direct Manager: Chris Myers
> Phone: (919) 574-5319
> Email: mailto:chrimyer@cisco.com<mailto:chrimyer@cisco.com>
> 
> CIN contact numbers are:
> North America +1 800 553 2447
> Asia-Pacific +61 2 8448 7107
> Australia +1 800 805 227
> Europe +32 2 704 5555
> UK +44 800 960 547