Re: [websec] Richard Barnes' Discuss on draft-ietf-websec-x-frame-options-09: (with DISCUSS and COMMENT)

Tobias Gondrom <tobias.gondrom@gondrom.org> Mon, 19 August 2013 14:41 UTC

Return-Path: <tobias.gondrom@gondrom.org>
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 CFEEF21F9B0D for <websec@ietfa.amsl.com>; Mon, 19 Aug 2013 07:41:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -95.361
X-Spam-Level:
X-Spam-Status: No, score=-95.361 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FH_HELO_EQ_D_D_D_D=1.597, FH_HOST_EQ_D_D_D_D=0.765, FM_DDDD_TIMES_2=1.999, HELO_DYNAMIC_IPADDR=2.426, HELO_EQ_DE=0.35, HTML_MESSAGE=0.001, RDNS_DYNAMIC=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 VW17YPVnLGhH for <websec@ietfa.amsl.com>; Mon, 19 Aug 2013 07:41:51 -0700 (PDT)
Received: from lvps176-28-13-69.dedicated.hosteurope.de (lvps176-28-13-69.dedicated.hosteurope.de [176.28.13.69]) by ietfa.amsl.com (Postfix) with ESMTP id D099611E8106 for <websec@ietf.org>; Mon, 19 Aug 2013 07:41:50 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gondrom.org; b=sGQEDcdUKzk2GhljAJp5Wh2lQYVrSCe9ylN/93MkJ+Q1j9UBAEgqzkFePPJZ/aGsWE/+2wETtqrF4gq2o/oTzkK6Nk+bQMdRxMOBD55a97iv6v/r5gXId80qFnuDD42H; h=Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:X-Enigmail-Version:Content-Type;
Received: (qmail 9615 invoked from network); 19 Aug 2013 16:41:49 +0200
Received: from port-83-236-131-2.static.qsc.de (HELO ?10.13.163.52?) (83.236.131.2) by lvps176-28-13-69.dedicated.hosteurope.de with ESMTPSA (DHE-RSA-AES256-SHA encrypted, authenticated); 19 Aug 2013 16:41:49 +0200
Message-ID: <52122EAD.8010503@gondrom.org>
Date: Mon, 19 Aug 2013 16:41:49 +0200
From: Tobias Gondrom <tobias.gondrom@gondrom.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8
MIME-Version: 1.0
To: rlb@ipv.sx
References: <20130815014121.17800.33179.idtracker@ietfa.amsl.com> <520FFD18.2010008@gondrom.org> <CALaySJJLJyHL8ZiWcgqO8n-MdHrkdJ3XRni7Axb4NSLkh2_v6A@mail.gmail.com> <CAL02cgT=8GOWo2ROLpvRaKuW=_Wb=qPEE=wwHPsqSWfkvk4NRw@mail.gmail.com>
In-Reply-To: <CAL02cgT=8GOWo2ROLpvRaKuW=_Wb=qPEE=wwHPsqSWfkvk4NRw@mail.gmail.com>
X-Enigmail-Version: 1.5.2
Content-Type: multipart/alternative; boundary="------------040507080205060407000206"
Cc: draft-ietf-websec-x-frame-options@tools.ietf.org, barryleiba@computer.org, websec@ietf.org, iesg@ietf.org, websec-chairs@tools.ietf.org
Subject: Re: [websec] Richard Barnes' Discuss on draft-ietf-websec-x-frame-options-09: (with DISCUSS and COMMENT)
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: Mon, 19 Aug 2013 14:41:56 -0000

On 19/08/13 15:48, Richard Barnes wrote:
>
>
>
> On Sun, Aug 18, 2013 at 1:58 AM, Barry Leiba <barryleiba@computer.org
> <mailto:barryleiba@computer.org>> wrote:
>
>         > (D2) It seems like this is a value that browsers might
>         cache, to avoid
>         > unnecessary requests if the same page is framed in the
>         future.  If this
>         > is something browsers do today, please say so.
>
>         Actually I like to push back in this case, as I don't think we
>         should go
>         into implementation specific details that have no effect on
>         the bits on
>         the wire nor on the effective behavior of the browser.
>         The X-Frame-Options header determines the behaviour for every
>         individual
>         requested page regarding framing in another web page in the
>         browser.
>         Whether the browser caches this information and compares the
>         request
>         with an existing cache from a request from before AND if the
>         value is
>         identical proceeds as before or whether the browser evaluates the
>         X-Frame-Options header on each request should not be specified
>         in this
>         draft.
>
>
>      I'll note also that this is particularly the case because this is
>     documenting something that exists, but that isn't recommended for
>     implementation.  If this were a PS that we were recommending for
>     new implementations, it might make more sense to talk about how to
>     do caching for better implementations.
>
>     Barry
>
>
> I understand.  Caching is just another aspect of existing
> implementation behavior that I think should be documented.  
>
> Of course, I may be off base here.  If nobody does it, and people
> think it's patently obvious that you never would, then I could clear. 
>
> --Richard
>

Richard,

in short: I think, we really don't need and in fact should not discuss
caching of the existing implementations in this draft.

Some info fyi:
caching has only very limited (or no) benefit here. Because the browser
has to check for every http-request of the resource whether the
X-Frame-Options header has been set and then act accordingly. It is also
a very simple check.

And consider as a page itself might be dynamic, the header can change
with it, too.

As mentioned in my answer before the only mini advantage of caching
might be that the browser sees the header is still the same as before
(with a simple TRUE/FALSE regex) and then doesn't have to evaluate the
ruleset again e.g. if ALLOW-FROM is set if you already did so in your
previous call.
But nearly all of the X-Frame-Options requests are DENY or SAMEORIGIN in
which case the comparison of the header with the previous one would not
be much cheaper than to just run the regex rule for the header itself.

And also, as outlined in section 2.3.2.3., servers may generate
X-Frame-Options header responses depending on the request.
Example case: Consider that we have only one serialized-origin in the
ALLOW-FROM directive. Now imagine a user has multiple pages open in his
browser tabs with one of web page 1 from domain A and the second of web
page 2 from domain B both frame the same page from domain C with the
ALLOW-FROM directive. In that case the page needs to reply to both
requests with different X-Frame-Options headers, the first pointing to
origin A, the second to origin B.
But then many implementations don't support the ALLOW-FROM directive....

So to summarize my answer: we really don't need and in fact should not
discuss caching of the existing implementations.

All the best, Tobias