Support for @import and @font-face
Title:
Support for @import and @font-face
Area:
styles
Summary:
Update the CSS cleaner to support modern CSS, including the @import and @font-face directives.
Description:
The current CSS cleaner is overly-restrictive in what directives it supports, which makes designing modern layouts unnecessarily difficult.
In particular, the @import and @font-face directives should be supported (at the current time they are stripped out). The former allows for clarity and organisation of code for designers (as well as the use of well-known frameworks and reset styles), while the latter is becoming a staple of "Web 2.0" design.
While care still needs to be taken to protect against malicious XSS attacks, the @import and @font-face directives in-and-of themselves wouldn't seem to be any more dangerous to users than, for example, background-url (which can also be used to import foreign data).
This suggestion:
Should be implemented as-is.
11 (34.4%)
Should be implemented with changes. (please comment)
1 (3.1%)
Shouldn't be implemented.
0 (0.0%)
(I have no opinion)
20 (62.5%)
(Other: please comment)
0 (0.0%)

no subject
We'll have to make some changes in where the CSS comes up in S2, I think, for the best results.
@import is a lot harder, I think, because the imported CSS can't be directly imported, but has to be redirected through the CSS cleaner. I think it might be possible to do, though, with a bit of work.
no subject
I mean, beyond the obvious (ensuring CSS files are, in fact, CSS files); why does it need to vet every line and every directive in every file? How prevalent/severe are CSSXSS attacks? Do other sites that allow foreign CSS clean their files as rigorously? With the current cleaner can you, for instance, load malicious resources (including things like renamed scripts) using already-accepted url() directives?
Semi-rhetorical, I guess; I know the exploits, but the way the cleaner currently functions seems like overkill, especially considering all the other ways I could launch an XSS attack via a journal if I really wanted to.
... and it also just really, really drives me nuts (for seemingly not a great deal of payoff). 6^^
no subject
As to the CSS cleaner, I was there when it was written. We were having some serious issues with browsers (particularly IE6 with its inability to properly handle JS in many cases) getting repeatedly destroyed by various things that you could do in CSS.
User safety is paramount. I'd rather have a site that isn't super snazzy and yet protect people's privacy and their computers than have one that's got all the latest bells and whistles and have to deal with people getting exploited every day.
no subject
If I really had a grudge, the main thing I'd be running is a phishing attack against the reply form in the HTML comment notification email, though. It's kinda obvious, but a good soft entry-point. (Er, not that I would, I should point out, but that form's always annoyed me.)
Is that still a real issue, though? I'd imagine things have moved a bit since then. And by "destroyed" are you talking "pages unreadable" or "user's computer is compromised"?
I'm honestly just really curious now. :P
Sure, but security and usability are different points of the triangle; and I'm not a fan of compromising the latter to "protect" against exploits that can't be actualised in the Really Real World.
That's just me and my professional ideology talking, though. And I'm used to having the unpopular opinion on this one. 6^^
no subject
no subject
Barring that, I'm +1
no subject
I'm not a fan of compromising usability either, and sometimes we'll make concessions in that direction if the needs are dire. But when it comes down to it, I still think I'd rather have a safe site.
no subject
But... wait a sec, you can do that on anything that uses url() (e.g. @font-face and background)... which of course gets us back to the cleaner and its high-byte stripping, again.
Hm.
Okay, so maybe not @import. I still want @font-face, though. :P
no subject