Jump to content

Recommended Posts

is there any risk of hacks via allowing a simple css file to be uploaded to a site? (please read full question)

 

it'll be run AS css, and not php, HOWEVER, when the file is opened (fopen), and then the string value placed into an edit form, can (not sure the limits of php, hence my question..) the string that's been read from the file execute any php or echo any values? once the contents of file.css are turned into $file_CSS is it JUST $file_CSS, or can it run anything?

 

again, as a .css it's safe (or I beelive so) but when it's a string value floating on the page, can it execute anything IF some wrote say "$User_ID" "$security", etc in the middle of the file?

 

really the question is, can code be executed from within a string variable?

 

Thanks.

I've never heard of anyone doing that but I'm not sure if it can be done.  Your best bet would be to read the css file line by line against some sort of regex to make sure it conforms to css rules.  There are a limited number of characters allowed in css so I think the task would be rather easy and would beef up your security.

again, as a .css it's safe (or I beelive so)

 

At some point you'll attach it to an XHTML page I presume, in which case it is not safe, opens up opportunities for XSS attacks. Disallowing any HTTP links in the uploaded CSS files would fix that I guess.

thanks guys!

it's just transitional for now, but yes, in a year or so I want to make the full switch to xhtml, so the xss attacks, which I'm in the dark on will become a problem. thank you for the early alert so i can plan for it.

 

no exec and eval, got it. I'm good then!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.