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

YUI violates Content-Security-Policy #1513

Closed
gerardkcohen opened this issue Dec 21, 2013 · 4 comments
Closed

YUI violates Content-Security-Policy #1513

gerardkcohen opened this issue Dec 21, 2013 · 4 comments
Assignees
Labels

Comments

@gerardkcohen
Copy link
Contributor

Line 480 of yui.js uses Function('return this')() as a way to get a reference to the global object.

This poses a problem for sites that that do not allow eval or similar methods for creating code from strings to protect against XSS attacks or data injection via the Content-Security-Policy response header, which would block execution of YUI almost immediately.

The only option would be to enable the unsafe-eval directive, opening up the possibility of various attacks.

@ghost ghost assigned juandopazo Dec 21, 2013
@caridy
Copy link
Member

caridy commented Jan 9, 2014

IIRC the global detection routine was changed to accommodate the detection of global when running in nodejs, we can revisit that one more time :)

@caridy
Copy link
Member

caridy commented Aug 27, 2014

time to bump this up:

we are looking for a brave soul to fix this:
https://github.com/yui/yui3/blob/master/src/yui/js/yui.js#L480

we need a better way to detect global on the browser or at least a way to force to use a global value from config rather than letting YUI to compute it if it doesn't know how to compute it reliably.

this is also the reason why you can't use yui in a brower extension without blowing up the security of it.

@caridy
Copy link
Member

caridy commented Aug 27, 2014

@okuryu
Copy link
Member

okuryu commented Sep 29, 2014

Fixed in #1963.

@okuryu okuryu closed this as completed Sep 29, 2014
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

4 participants