What needs to be done if we need to use an unknown custom css file

I am going to allow users to upload a css file and control the color scheme and other things of the site according to their own configuration.

So, before building it, I would like to know what I need to take care of?

+3
source share
2 answers

CSS insertion is almost as good as a script injection. You have it expression()in IE6-7 (and later in the compatibility view), you have it behavior:(HTC) in IE, you have it -moz-binding:in Firefox, you have content:to enter text, and sometimes, mostly in older browsers that don't block it. you have one url(javascript:...). Even without this, you have sufficient risk only from visualizing UI spoofing.

As long as the user style sheet is limited to the user who created it, the user can only compromise himself. The problem occurs when users start sharing style sheets. Perhaps you may want to prevent users from choosing the same address of the external stylesheet as another user to prevent this.

+4
source

: CSS-" JavaScript- CSS. , IE5-7 IE.

expression() . , , IE CSS.

+2

Source: https://habr.com/ru/post/1767316/


All Articles