TalkPHP
 
 
Account Login
Latest Articles
» cURL Basics
» Securing your PHP applications Part 1
» The way the function rolls
» Database Abstraction with Zend_Db - Part 2
» CSRF POST Token Protection
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Display Modes
Old 05-12-2008, 03:46 PM   #1 (permalink)
The Frequenter
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 482
Thanks: 15
Village Idiot is on a distinguished road
Default Security when embedding videos

I know this isnt exactly PHP, but the question could easily shift to it.

I have a project coming up where I will have to embed a video in a page. My (potential) client wants it to be any video site, all they have to do is post the HTML code. Now the way I would go about this is to disallow any tag but the embed and related tags that the pages require. However, a user could potentially embed a shockwave file (SWF) which can make calls to javascript and work with the server side files on the server it is on (I know it cant work with the server I am on). The problems with allowing a user to put their own JS in a page are obvious.

Now how do I circumvent this problem? The methods I have thought of are
1. Disallow every extension accept the video ones I will need. Being that those videos cant contain code like that it will be fine

2. To only have set sites allowed to embed, to have the user give me the URL and using regular expressions I can validate the URL and generate the embed code myself. I don't want to do this method because I hate regular expressions and it would be limited.

Is there a better method that I haven't thought of:? Outside scripts are acceptable as long as they are legal to place in a script I am making for a client like this.
__________________
There are two ways to write bug-free code, only the third one works.
Village Idiot is offline  
Reply With Quote
Old 05-13-2008, 12:49 AM   #2 (permalink)
The Acquainted
 
drewbee's Avatar
 
Join Date: May 2008
Posts: 103
Thanks: 7
drewbee is on a distinguished road
Default

Usually with this type of situation, I hear people setting the upload site to a full different URL, and then including that url in an iframe on the main site.

Due to security reasons, the needed javascript code that would run and try to execute would only have access to the url of the upload site, and keep the sensative data on the display site safe and unaccessible.
Send a message via AIM to drewbee
drewbee is offline  
Reply With Quote
Old 05-13-2008, 01:31 AM   #3 (permalink)
The Frequenter
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 482
Thanks: 15
Village Idiot is on a distinguished road
Default

An iframe to the site would not be acceptable. It has to be a video that is embedded.
__________________
There are two ways to write bug-free code, only the third one works.
Village Idiot is offline  
Reply With Quote
Reply



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

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


All times are GMT. The time now is 05:40 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0