Newsgroups: mozilla.dev.security
From: EricLaw <bay...@gmail.com>
Date: Mon, 6 Jul 2009 07:46:21 -0700 (PDT)
Local: Mon, Jul 6 2009 10:46 am
Subject: Re: Content Security Policy Spec questions and feedback
I'm not sure about Usenet etiquette (it's been years) so I'll try
replying inline for now. :-) On Jul 6, 3:02 am, Gervase Markham <g...@mozilla.org> wrote: > Hi Eric, That's what I figured, but I'm not sure I understand how CSP applies. > Some really, really great points here. My thoughts on some of them: > On 06/07/09 01:28, EricLaw wrote:> Server CSP Versioning > > > I also haven't quite got this straight in my head. > I think it would be useful for the spec to contain a lot more detail on > > Style-src > It means <div style="some CSS here"></div> Is it applying to url() statements (if any) that are inlined in the style attribute? Or is there some other way that the style attribute allows retrieval of remote content? > > frame-ancestors Dropping META support has its merits, but that suggests one couldn't > > In addition to IFRAMEs/FRAME tags, this should also restrict OBJECT > > tags that point to HTML pages, correct? > I guess so :-) > > W3C folks have been giving us (IE) a hard time about the number (and > I'm sure we can do that, particularly if we have buy-in or tacit support > > HTTP Header: Final > The very existence of "meta" is now under discussion. But I think that use CSP with any protocol which doesn't allow for headers (FTP/FILE, etc). > > Are relative URIs valid for the report-URI/policy-URI? (Seems like True enough. :-) > > this would be a good thing to support). However, if so, is there any > > interaction/relationship with the BASE tag, which is supposed to also > > appear early in the head? > Very good question. > > What happens to CSP if I save a CSP-protected document to my local > Another good one. Gut reaction: The things CSP is supposed to help with > > Therefore, a site could specify “*.example.com” to match > Hmm. For people not thinking, this would obey the Rule of Least > > Doesn’t make sense to me, because “self” is defined to include the > Or we make the same word serve two purposes, doing the "obvious" thing. > > Parse Errors: Server detection > Will this be a problem in practice, given that presumably the server > > If the “Fail closed” model is used, is there any way for the user to Oh, I think Fail Closed is a fine model, but unless there's some way > > know why the site is broken? Isn’t this going to create a problem, > > where, say, a FF4 user will “downgrade” to a browser that doesn’t > > support CSP (say, Opera 9) because the site “works properly there”? > > Everyone loses. > This is a problem with a "tighten when the header is used, and then use for the user to know why the page is completely busted, it seems likely that they're going to blame the properly-behaving UA rather than the site. Pretty much the same problem one encounters with strict XHTML validation failure-- how do you ensure that the user blames the site, not the UA? > > Agreeing with Sacolcor, I think the spec should explicitly note that Oh, sure, but the scenario I'm trying to cover is the case where a > > CSP isn’t intended to apply to User-Scripts, although I think the > > Greasemonkey guys might find it hard to implement their current > > feature-set considering where CSP is likely to be implemented in the > > browser stacks. > We need to avoid breaking Greasemonkey/GreasemonkIE. > > Scope Creep: exempt HEAD > Yes; CR originally had a way to allow this. I think it would make > > In particular, this could be used by non-JS responses to explicitly > I think using CSP should also mean that the scripts which are permitted cross-domain attacker's site (not using CSP) is trying to steal (via E4X, Script Inclusion, CSS style enumeration, etc) content from the victim site (which uses CSP on all of its pages). Unless there's some way for a resource (e.g. a script, CSS, HTML page) to enforce that its content can only be accessed by appropriate tags (e.g. refuse to load a text/html document in response to a <LINK rel=stylesheet> query) then data theft (leading to CSRF) is possible. After we shipped it, a major web property requested that the "X- > > Scope Creep: Same Origin Only I think I understand the concerns (similar to those voiced by folks > > The claim “Content Security Policy enables a site to specify which > > sites may embed a resource” is currently over-broad, but it shouldn’t > > be. (CSP currently seems to only apply to HTML documents, not > > "resources" in general). > Yes, we need to think more about how CSP applies to non-HTML and > > It seems natural that a subdownload should be able to say e.g. Content- > People have wanted the web to do this for years to prevent people who think frame-busters like X-Frame-Options or CSP's "frame- ancestors" directive are a bad idea, because they break sites that want to frame content they don't own). But I think there's a very legitimate case to be made for the potential security value in preventing unexpected cross-domain data reads. > > I’m not fully convinced that the “Origin” proposal (or at least the I haven't been keeping up on the progress of the Origin proposal, but > > versions I’ve read closely) will prove generally workable. Among > > other problems, every protected resource would need to be served with > > a Vary: Origin header, which is problematic for a number of reasons, > > including legacy IE bugs (http://blogs.msdn.com/ieinternals/archive/ > > 2009/06/17/9769915.aspx). > Presumably you've sent that feedback in the relevant direction? I did ask some probing questions in this vein a long time ago. I was hoping that we'd be able to come up with a different approach which offers improved security / deployability properties, and I think CSP might do just that with a few tweaks. > > --------------- Yeah, that's the basic idea I think (I know very little about ASP.NET > > Feedback from others > > --------------- > > ASP.NET Controls > > Apparently, ASP.NET controls are tightly bound to use of JavaScript: > > protocol URIs, and this isn’t likely to be easily changed. For that > > reason, it might be interesting to have a way to allow only those URIs > > and not inline script blocks, event handlers, etc? > I know nothing about ASP.NET controls. Are these pre-built blocks of myself). I think the idea is that the dev/designer uses the IDE to drop a "HTML component" onto the page (e.g. a date-picker), and the toolkit emits the HTML/script which implements the functionality of the control. > I guess the question is: have we effectively blown up all the protection Well, I think the obvious threat is that a bad guy who finds an XSS > if we allow javascript: URIs? Can every possible exploitation method be > adapted to use them? hole can inject an <A> tag with an onclick method pointing to a JavaScript URI, but this seems to represent a subset of all possible attacks, and may be significantly less compelling to the attacker. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||