Current location: Hot Scripts Forums » Programming Languages » PHP » Is it wafe to let users upload their own CSS?


Is it wafe to let users upload their own CSS?

Reply
  #1 (permalink)  
Old 01-07-06, 01:07 AM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
Is it wafe to let users upload their own CSS?

I'm building a community website and cosidering letting users upload their own CSS so they can modify their personal space.

Will this impose a risk for the website? Can an evil user exploit this to upload malicious code? Is there a way to allow this without risks?


thanks
Reply With Quote
  #2 (permalink)  
Old 01-07-06, 01:18 AM
Christian's Avatar
Christian Christian is offline
Community VIP
 
Join Date: Mar 2005
Location: ProgrammingTalk
Posts: 2,449
Thanks: 0
Thanked 6 Times in 5 Posts
It might become a problem, so what I would do is store the infomation in a mysql database. Just my $.02.
__________________
:: ImperialBB :: New version in the works! :: http://www.imperialbb.com ::

:: Have a question about the board? The Rules? An Infraction/Warning? :: Contact Form ::
Reply With Quote
  #3 (permalink)  
Old 01-07-06, 02:11 AM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
The only problem i can see with CSS (and i see it a lot) is they can code CSS to overlap a image over the entire site so all they see is the image.

There are some turkish hackers that do this to ASP forums (that dont update to latest versions) and they call it hacking, but i call them a bunch of 10 year old noobs.
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #4 (permalink)  
Old 01-07-06, 02:34 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Explorer and a few other inept browsers will also allow JavaScript to be run inside CSS url() elements. This was the basis of the recent MySpace "worm".

If you're going to allow them to upload their own files, pull the file's contents and strip unwanted tags or entities before display rather than just linking to the file.
Reply With Quote
  #5 (permalink)  
Old 01-07-06, 02:18 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Is that the latest version of Explorer or an older version?

I guess i missed the news about that bug...
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #6 (permalink)  
Old 01-07-06, 04:17 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Yes, Explorer 6 allows it to be executed.
Reply With Quote
  #7 (permalink)  
Old 01-11-06, 06:34 AM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
to clarify, i would store their css in the database, not let them upload actual files.

in this case i'm mostly worried about hackers using it to hack into the site etc, not ruin the appearance, since my users can only modify their "own" space - not the public space.

is there a good script available that strips unwanted tags and/or javascript from css?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying this to upload via FTP recedo PHP 3 01-08-06 02:04 PM
Java Applet To Upload Hundreds of Gigabytes thinfile General Advertisements 0 11-19-05 12:49 AM
ASP upload prob minority ASP 1 06-27-05 08:35 AM
PHP Script Request DazzlyWorks Script Requests 0 01-16-05 01:23 PM
best CMS/Portal for letting users upload personal images? stevux Script Requests 1 03-05-04 07:14 PM


All times are GMT -5. The time now is 06:27 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.