Subject: Re: [websec] Coordinating Frame-Options and CSP UI Safety directives

From: =JeffH <[email-masked]>
Date: Thu, 12 Jul 2012 17:30:04 -0700

thanks for your thoughts Dave,

 > My concern is mostly around the degree to which a move to CSP might
 > complicate or stall the process.

by this I presume you mean the process of producing a spec for a standardized 
"frame-options" (i.e., the successor to "x-frame-options").

I don't think leveraging CSP as a framework, per se, would necessarily slow this 
down.

 >  I'd also prefer not to see additional use
 > cases pop up (eg: click fraud prevention) that just were never in scope
 > before.

I think it's reasonable to discuss whether the "frame-options" policy directive 
(aka "frame-ancestors", "embed-ancestors") should be specified as a part of the 
nascent "UI Safety directives" spec (in W3C WebAppSec), or the CSP 1.1 spec (in 
W3C WebAppSec), or as a stand-alone spec.

 > I think that w.r.t. header bloat,

Ah, so there's two aspects to "header bloat" in this discussion..

1. "header bloat" in relation to possibly defining yet another HTTP header field 
to convey a security policy, i.e. a stand-alone "frame-options" header field.

2. "header value bloat" in terms of having a header field into which server 
operators may feel obliged to cram a huge list of items (i.e., origins).

 From a high-level perspective, casting "frame-options" as a CSP directive 
works towards addressing (1).

 > the most sensible approach is to only allow one origin to be specified.

And this statement is addressing (2).

 > CSP by-design facilitates the use of multiple origins.

However, the ABNF of any particular CSP directive can be crafted in order to 
allow only one origin to be specified as a value, e.g. like so..

   directive-name  = "frame-options"
   directive-value = host-source

[ where host-source is defined as..

   host-source       = [ scheme "://" ] host [ port ]
]

 > As we've discussed w/Frame-Options, there is a design pattern to
 > make the more basic single-origin approach functional.

understood.

(fwiw, I'd term what you're calling a "design pattern" as a "implementation and 
deployment technique")

 > With regard to obsolescence of X-FRAME-OPTIONS, it's easy to specify exactly
 > what happens in the FRAME-OPTIONS spec.  I don't see that CSP inherently
 > improves on that but I may be missing something there.

regardless of which specification vehicle we use for the "frame-options" policy 
directive, we'll be able to denote (in some fashion) that it supersedes the old 
"x-frame-options" header. (this is going to be somewhat messy in any case)

 > The advantage I see of bringing FRAME-OPTIONS into CSP is that it makes CSP
 > more comprehensive.  But I suspect there are plenty of other header-related
 > security features that aren't defined by CSP (eg: the origin header, cookie
 > security).

well, of course CSP doesn't encompass "everything" and isn't intended to. But we 
certainly should be carefully considering consolidating  policy directive 
conveyance as appropriate, and the "frame-options" (aka "frame-ancestors", 
"embed-ancestors") notion seems to fall reasonably within the "content security 
policy" space -- a key aspect being that it is regarding a particular resource 
representation (as I presently understand it).

 > Finally, as Brad pointed out in the rosetta stone thread, Frame-Options
 > provides the flexibility to perform only a top level origin check as opposed
 > to a full ancestor check.  (Specified via the "AllAncestors" flag.)

Well, the "AllAncestors" flag can certainly be added to a CSP-based 
"frame-options" policy directive. e.g. by defining a new "keyword-source" of 
'all-ancestors'.

=JeffH

---

From: David Ross <[email-masked]>
Date: Mon, 16 Jul 2012 17:55:20 +0000

In the interest of bloat as measured in bits, in this case it makes sense to optimize for (2), reducing header value bloat, even if this is at the expense of (1), reducing header name bloat.  I was worried that with CSP we can't achieve on (2).  But if we can specify the ABNF as you suggest below, that solves the problem.

I also would like to see the inclusion of the AllAncestors flag as you suggest below.  Or if it makes more sense here, a "NoAncestors" flag.

Dave

-----Original Message-----
From: =JeffH [mailto:[email-masked]] 
Sent: Thursday, July 12, 2012 5:30 PM
To: David Ross; IETF WebSec WG
Subject: Re: [websec] Coordinating Frame-Options and CSP UI Safety directives

 > My concern is mostly around the degree to which a move to CSP might  > complicate or stall the process.

by this I presume you mean the process of producing a spec for a standardized "frame-options" (i.e., the successor to "x-frame-options").

I don't think leveraging CSP as a framework, per se, would necessarily slow this down.

 >  I'd also prefer not to see additional use  > cases pop up (eg: click fraud prevention) that just were never in scope  > before.

I think it's reasonable to discuss whether the "frame-options" policy directive (aka "frame-ancestors", "embed-ancestors") should be specified as a part of the nascent "UI Safety directives" spec (in W3C WebAppSec), or the CSP 1.1 spec (in W3C WebAppSec), or as a stand-alone spec.

1. "header bloat" in relation to possibly defining yet another HTTP header field to convey a security policy, i.e. a stand-alone "frame-options" header field.

2. "header value bloat" in terms of having a header field into which server operators may feel obliged to cram a huge list of items (i.e., origins).

 From a high-level perspective, casting "frame-options" as a CSP directive works towards addressing (1).

understood.

=JeffH

---

From: "Hill, Brad" <[email-masked]>
Date: Tue, 17 Jul 2012 23:33:16 +0000

Dave,

  What's the case for the "NoAncestors" behavior?  Is it just a performance optimization?  I'm a little bit concerned that walking the full ancestors stack is going to become quite important as more sites start using constructs like seamless, sandboxed iframes to display untrusted content.

Thanks,

Brad

> From: [email-masked] [mailto:[email-masked]] On
> Behalf Of David Ross
> Sent: Monday, July 16, 2012 10:55 AM
> To: =JeffH; IETF WebSec WG
> In the interest of bloat as measured in bits, in this case it makes sense to
> optimize for (2), reducing header value bloat, even if this is at the expense of
> (1), reducing header name bloat.  I was worried that with CSP we can't
> achieve on (2).  But if we can specify the ABNF as you suggest below, that
> solves the problem.
> 
> I also would like to see the inclusion of the AllAncestors flag as you suggest
> below.  Or if it makes more sense here, a "NoAncestors" flag.
> 
> Dave
> 
> by this I presume you mean the process of producing a spec for a
> standardized "frame-options" (i.e., the successor to "x-frame-options").
> 
>  >  I'd also prefer not to see additional use  > cases pop up (eg: click fraud
> prevention) that just were never in scope  > before.
> 
> (aka "frame-ancestors", "embed-ancestors") should be specified as a part of
> the nascent "UI Safety directives" spec (in W3C WebAppSec), or the CSP 1.1
> spec (in W3C WebAppSec), or as a stand-alone spec.
> 
> 
> 1. "header bloat" in relation to possibly defining yet another HTTP header
> field to convey a security policy, i.e. a stand-alone "frame-options" header
> field.
> 
>  > As we've discussed w/Frame-Options, there is a design pattern to  > make
> the more basic single-origin approach functional.
> 
> understood.
> 
> (fwiw, I'd term what you're calling a "design pattern" as a "implementation
> and deployment technique")
> 
> 
> _______________________________________________
> websec mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/websec

---

From: David Ross <[email-masked]>
Date: Thu, 19 Jul 2012 19:50:22 +0000

The full ancestor stack walk may be considered an artificial / unnecessary limitation given that users can only make trust decisions based on the UI at the top level.  (This is in a world where the top level is conservative, avoiding framing untrusted content.)

"I'm a little bit concerned that walking the full ancestors stack is going to become quite important as more sites start using constructs like seamless, sandboxed iframes to display untrusted content."
That's a great argument to go with AllAncestors by default and NoAncestors as opt-in.

Dave

-----Original Message-----
From: Hill, Brad [mailto:[email-masked]] 
Sent: Tuesday, July 17, 2012 4:33 PM
To: David Ross; =JeffH; IETF WebSec WG
Subject: RE: [websec] Coordinating Frame-Options and CSP UI Safety directives

Dave,

Thanks,

Brad

> In the interest of bloat as measured in bits, in this case it makes 
> sense to optimize for (2), reducing header value bloat, even if this 
> is at the expense of (1), reducing header name bloat.  I was worried 
> that with CSP we can't achieve on (2).  But if we can specify the ABNF 
> as you suggest below, that solves the problem.
> 
> I also would like to see the inclusion of the AllAncestors flag as you 
> suggest below.  Or if it makes more sense here, a "NoAncestors" flag.
> 
> Dave
> 
> I think it's reasonable to discuss whether the "frame-options" policy 
> directive (aka "frame-ancestors", "embed-ancestors") should be 
> specified as a part of the nascent "UI Safety directives" spec (in W3C 
> WebAppSec), or the CSP 1.1 spec (in W3C WebAppSec), or as a stand-alone spec.
> 
> 
> 1. "header bloat" in relation to possibly defining yet another HTTP 
> header field to convey a security policy, i.e. a stand-alone 
> "frame-options" header field.
> 
> 2. "header value bloat" in terms of having a header field into which 
> server operators may feel obliged to cram a huge list of items (i.e., origins).
> 
> However, the ABNF of any particular CSP directive can be crafted in 
> order to allow only one origin to be specified as a value, e.g. like so..
> 
>  > As we've discussed w/Frame-Options, there is a design pattern to  > 
> (fwiw, I'd term what you're calling a "design pattern" as a 
> "implementation and deployment technique")
> 
> 
>  > With regard to obsolescence of X-FRAME-OPTIONS, it's easy to 
> specify exactly  > what happens in the FRAME-OPTIONS spec.  I don't 
> see that CSP inherently  > improves on that but I may be missing 
> something there.
> 
> directive, we'll be able to denote (in some fashion) that it 
> supersedes the old "x-frame-options" header. (this is going to be 
> somewhat messy in any case)
> 
> 
>  > The advantage I see of bringing FRAME-OPTIONS into CSP is that it 
> makes CSP  > more comprehensive.  But I suspect there are plenty of 
> other header- related  > security features that aren't defined by CSP 
> (eg: the origin header, cookie  > security).
> 
> certainly should be carefully considering consolidating  policy 
> directive conveyance as appropriate, and the "frame-options" (aka 
> "frame-ancestors",
> "embed-ancestors") notion seems to fall reasonably within the "content 
> security policy" space -- a key aspect being that it is regarding a 
> particular resource representation (as I presently understand it).
> 
> 
>  > Finally, as Brad pointed out in the rosetta stone thread, 
> Frame-Options  > provides the flexibility to perform only a top level 
> origin check as opposed  > to a full ancestor check.  (Specified via 
> the "AllAncestors" flag.)
> 
> "frame-options" policy directive. e.g. by defining a new 
> "keyword-source" of 'all-ancestors'.
> 
> =JeffH
> 
> 
> 
> 
> 
> 
> 
> 
>