![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
In a file served with a text/css media type? Yes. http://archivist.incutio.com/viewlist/css-discuss/44263 has a simple example, but expression lets any JavaScript be executed in Internet Explorer (and can call ActiveX controls etc). |
#12
| |||
| |||
|
|
The goal is to limit the possibility of doing something like: http://10.0.0.5:445/ to cause the client machine to connect to a fileserver in their internal network. |
|
and require the filename to end with ".css" (to make it more difficult to cause a script to run). This is unneccessary. The goal here is to reduce the possibility of doing something like: http://www.somesite.com/runsomething.cgi |
|
Something like this: /^https?:\/\/[\w.-]+\/[\w\/:.-]+\.css$/ Why not implementing RFC1738, 3.3 exactly? I explicity don't want to allow some of the reserved characters mentioned in section 2.2 of that RFC, to make it impossible to send queries. Like the above restriction, I expect this to reduce the risk of running executable content. |
#13
| |||
| |||
|
|
So I say, accept any style sheets -- just make sure you replace '"' with '"' and '<' with '<'. |
#14
| |||
| |||
|
|
But look at the bigger picture. If this malicious person has linked to your application like this: iframe src="http://example.org/application.cgi?stylesheet=http://example.net/evil.css" /iframe then the visitor who recieves evil.css is *already* looking at the malicious person's website, so the malicious person has already had ample opportunity to load up evil.css. |
#15
| |||
| |||
|
|
I tried a variety of attacks with stylesheets, to see if I could get JavaScript code to execute. I couldn't get any of them to work in the latest version of FireFox, but in a fully patched IE6 this worked: @import url("javascript:alert('Gotcha!')"); So, it looks like this really isn't a safe thing to do. |
![]() |
| Thread Tools | |
| Display Modes | |
| |