Re: [websec] FYI: New draft draft-gondrom-frame-options-01

Devdatta Akhawe <dev.akhawe@gmail.com> Fri, 08 July 2011 01:02 UTC

Return-Path: <dev.akhawe@gmail.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 D06F821F8A3E for <websec@ietfa.amsl.com>; Thu, 7 Jul 2011 18:02:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 uus+eFo1i98a for <websec@ietfa.amsl.com>; Thu, 7 Jul 2011 18:02:12 -0700 (PDT)
Received: from mail-gx0-f172.google.com (mail-gx0-f172.google.com [209.85.161.172]) by ietfa.amsl.com (Postfix) with ESMTP id F11F621F8A36 for <websec@ietf.org>; Thu, 7 Jul 2011 18:02:11 -0700 (PDT)
Received: by gxk19 with SMTP id 19so85843gxk.31 for <websec@ietf.org>; Thu, 07 Jul 2011 18:02:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=EkrjI05JYF4PLdgQ9G9usrhRrtPbNYHvmSD0b2TlZd0=; b=bZd7YmpngKMskUVsUFnIuVQzWwMF1ISwuHvJiuq6/xQwdtczDkbAN0I9HArpTZsosV lnB/pl8BQM+pYJalpdBZFY0Rreff3qsdAwMnqIiWuCNjJLwwW6oa/9xVfDV3let5FPfm qpJ1KzpfhxLwXmtEEiL3u7z1En/Cz0PGuvCiA=
Received: by 10.150.141.13 with SMTP id o13mr1562464ybd.287.1310086930065; Thu, 07 Jul 2011 18:02:10 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.151.113.14 with HTTP; Thu, 7 Jul 2011 18:01:50 -0700 (PDT)
In-Reply-To: <F94D1172DEEC714BBD7F76476442D7151FD3AD46@TK5EX14MBXW651.wingroup.windeploy.ntdev.microsoft.com>
References: <F94D1172DEEC714BBD7F76476442D7151FD3AD46@TK5EX14MBXW651.wingroup.windeploy.ntdev.microsoft.com>
From: Devdatta Akhawe <dev.akhawe@gmail.com>
Date: Thu, 07 Jul 2011 18:01:50 -0700
Message-ID: <CAPfop_0LNvpxtxPuZDVUGOYH-05ZKYNvu0Os1Tjr6TWdPjFg-g@mail.gmail.com>
To: David Ross <dross@microsoft.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: "websec@ietf.org" <websec@ietf.org>
Subject: Re: [websec] FYI: New draft draft-gondrom-frame-options-01
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: Fri, 08 Jul 2011 01:02:12 -0000

I don't understand. A list of origins also allows a list of only one,
right? (1), (2), (4) don't seem to be an issue: a server concerned
about them can just use a single origin for each response.

With regards to (3), why do we even have wildcard support? Why not
just a list with no wildcard support ?

If a site wants to allow foo.example.com and bar.example.com, it can
just reply with both in the list instead of having to figure out when
to reply with foo and when to reply with bar (with the concomitant
programming hassle/bugs those cases) or worse reply with *.example.com


thanks
devdatta




> 1)  For privacy / security purposes, it would be preferable for the server not to have to explicitly expose the full list of possible frame hosting URLs.
>
> 2)  Responses may become bloated when there are a lot of sites in the ALLOW-FROM list.
>
> 3)  Support for wildcards as a solution to list bloat would introduce a new level of complexity w.r.t. parsing, etc.  Even dealing with the delimiter between static URLs in a list can get slightly problematic.
>
> 4)  Servers would have to enumerate a list of sites in advance and ensure that the list is actively maintained.
>
> Relying on custom server-side validation logic instead of permitting lists of origins in ALLOW-FROM would help alleviate these problems.  Eg: Server-side code validating URLs are of the form: https://[five alpha-numeric characters].contoso.com.
>
> Given this, I would suggest a single-origin syntax for ALLOW-FROM similar to X-FRAME-OPTIONS:
> http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx
>
> ---
> Note that the Allow-From token does not support wildcards or listing of multiple origins. For cases where the server wishes to allow more than one page to frame its content, the following design pattern is recommended:
>
> 1)  The outer IFRAME supplies its own origin information, using a querystring parameter on the Inner IFRAME's src attribute. This can obviously be specified by an attacker, but that's OK.
>
> 2)  The server for the Inner IFRAME verifies the supplied Origin information meets whatever criteria business practices call for. For example, the server that serves the IFRAME containing a social network's "Like" button, might check to see that the supplied Origin matches the Origin expected for that Like button, and that the owner of the specified Origin has a valid affiliate relationship, etc.
>
> 3)  If satisfied with the information supplied, the server for the Inner IFRAME sends an X-FRAME-OPTIONS: allow-from suppliedorigin header
>
> 4)  The Browser then enforces the X-FRAME-OPTIONS directive.
>
> If an attacker had specified an origin in step #1 different than the actual origin of the outermost page, he'd be blocked at step #4 when the browser actually enforces the origin.
> ---
>
> David Ross
> dross@microsoft.com
>
> _______________________________________________
> websec mailing list
> websec@ietf.org
> https://www.ietf.org/mailman/listinfo/websec
>