Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRI: explore the idea of removing the CORS requirement #338

Closed
fmarier opened this issue May 7, 2015 · 8 comments
Closed

SRI: explore the idea of removing the CORS requirement #338

fmarier opened this issue May 7, 2015 · 8 comments
Labels
Milestone

Comments

@fmarier
Copy link
Member

fmarier commented May 7, 2015

During the last teleconf, @mikewest suggested that we may want to revisit the CORS requirement in the next version of the spec if we strip out cookies and auth in these requests.

@fmarier fmarier added the SRI label May 7, 2015
@fmarier fmarier added this to the SRI-next milestone May 7, 2015
@annevk
Copy link
Member

annevk commented May 7, 2015

No, that doesn't solve a thing. Again, the reason we have CORS is firewalls.

@annevk
Copy link
Member

annevk commented May 7, 2015

You already strip out cookies and auth by advocating crossorigin=anonymous as you do in the specification...

@mozfreddyb
Copy link
Contributor

As cool as it would be not to require CORS, I don't think there's a way to do that.

I'll do the work and explain the problem once again.
If we do not require CORS, an attacker can get to know the hash of a resource that is not meant to be exposed at all. For example something that is on an internal network / behind a firewall (e.g. http://192.168.1.1/config.js). This could be wifi config, router passwords or any other thing. If the browser (or someone on evil.com) would get to know the hash of this file, he could learn something about the wifi config and use that for follow-up CSRF attacks.

I'd like to close this issue as WONTFIX, but I'm happy to continue the conversation first.

@mikewest
Copy link
Member

mikewest commented May 7, 2015

Mike certainly didn't mean to suggest that we just throw away cookies and call it done. I think instead the suggestion was that if integrity required CORS, then we should just implicitly apply crossorigin=anonymous to the request without forcing the developer to type extra stuff.

@metromoxie pointed out to me yesterday that that behavior might block future improvements, however, which is worth thinking about.

@annevk
Copy link
Member

annevk commented May 7, 2015

We could maybe consider defaulting later on, but requiring it separately for now seems appropriate. Although I do wonder what improvements @metromoxie had in mind.

@joelweinberger
Copy link
Contributor

I wouldn't call them 'improvements' per se, but if we ever did decide to make a change that allowed breakage of SOP (such as by publicly cacheable), building crossorigin='anonymous' into SRI would be problematic, as you'd now be locked into CORS permanently.

In any case, I'd want to just have a much more thorough discussion about wanting CORS forevermore going forward before making it the default.

@fmarier
Copy link
Member Author

fmarier commented May 9, 2015

In any case, I'd want to just have a much more thorough discussion about wanting CORS forevermore going forward before making it the default.

I think that's key. Making CORS mandatory is the best solution we've found so far to the problem that @mozfreddyb described. If we can specify this requirement such that it could be dropped in the future without breaking existing pages on older browsers, then that would be ideal.

mikewest pushed a commit to mikewest/webappsec that referenced this issue Jun 29, 2015
<{.../...}> syntax ought to support all valid attribute/element characters.
@fmarier
Copy link
Member Author

fmarier commented Sep 23, 2015

I think we can consider this closed/wontfix since we decided to fail closed when CORS attributes are missing on a cross-origin load.

@fmarier fmarier closed this as completed Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants