I’m working on a site that customers will use by embedding it in an iframe in their site. I want to give them the ability to customize the styling of the contents so they can make it fit in with the styles of their site.
The basic idea I have is to let them give me the URL to a CSS file I should include in the page I serve to them to fill the iframe. As far as I know this is safe, but I’m not particularly familiar with CSS (especially the newer versions), so I want to verify this.
Is there any way someone could construct a CSS file that would let them inject code into my site or otherwise gain access to things like my domain’s cookies? Is this really safe, or do I need to come up with a different solution?
No it is unsafe.
expressionand-moz-bindingare known ways to cause arbitrary script execution on certain browsers via CSS. LiveJournal suffered a very public XSS attack that was due to JavaScript embedded in user-supplied CSS.From Caja’s attack vector wiki: