Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 672061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:26:34+00:00 2026-05-14T00:26:34+00:00

I’ve been assigned a project for a website where users will be allowed to

  • 0

I’ve been assigned a project for a website where users will be allowed to upload video’s (using a YouTube API) but more importantly (for me) they will also be allowed to submit video embed codes (from numerous video sites, YouTube, Vimeo, etc. etc.).

Having no experience with allowing users to embed video:
How can I best protect against cross site scripting and/or cross site request forgery attacks specifically for video embedding? What are some of the common pitfalls to watch for?

At a minumum I would think to strip all tags except <object>, <param> and <embed>. But I have a feeling this will not be enough, will it?

edit
Also:
Do you think allowing only known video domainnames in the <embed src= and <param name="movie" value= attributes is enough to prevent rogue flash movies from being embedded in those attributes?
/edit

If it is of importance, the environment will be:

  • PHP/Zend Framework
  • MySQL

Bonuspoints:
Is there a common minimum golden rule/code template for video embed codes that are valid across all video sites that I could use to filter the input?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:26:34+00:00Added an answer on May 14, 2026 at 12:26 am

    First and most dangerous xss (?) is that flash can read your DOM… Don’t embed videos on pages where user can input his/hers login data. Login forms should be separated.

    Usually flash embeds uses code that looks similar to:

    Youtube:

    <object width="425" height="350">
      <param name="movie" value="http://www.youtube.com/v/AyPzM5WK8ys" />
      <param name="wmode" value="transparent" />
      <embed src="http://www.youtube.com/v/AyPzM5WK8ys"
             type="application/x-shockwave-flash"
             wmode="transparent" width="425" height="350" />
    </object>
    

    Vimeo:

    <object width="400" height="225">
      <param name="allowfullscreen" value="true" />
      <param name="allowscriptaccess" value="always" />
      <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10239065&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" />
      <embed src="http://vimeo.com/moogaloop.swf?clip_id=10239065&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed>
    </object>
    <p><a href="http://vimeo.com/10239065">La Fete (HD - 2010)</a> from <a href="http://vimeo.com/animalcolm">Malcolm Sutherland</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
    

    Metacafe:

    <embed src="http://www.metacafe.com/fplayer/4317045/bmx_face_slide.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_4317045"> </embed>
    <br><font size = 1><a href="http://www.metacafe.com/watch/4317045/bmx_face_slide/">BMX Face Slide</a> - <a href="http://www.metacafe.com/">Free videos are just a click away</a></font>
    

    Best solution for enabling embeded content is to strip tags with exception for embed, param, object and list of attributes from the the samples that can be used.

    Remember, some attributes can run javascript code as well as anchor’s href…

    Edit:
    Allowing only trusted sites in src and param’s value attribute is kinda good way to prevent hAx0rs from doing bad things but it’s not flawles. Another big thing: read more about allowScriptAccess. Its a Param’s attribute you should remove or set to sameDomain / never. It will prevent SWF from running javascript 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 466k
  • Answers 466k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Check your ulimit -n output to see how many open… May 16, 2026 at 1:45 am
  • Editorial Team
    Editorial Team added an answer not sure what you are asking. do you just want… May 16, 2026 at 1:45 am
  • Editorial Team
    Editorial Team added an answer The programming language doesn't matter; you can create a chatroom… May 16, 2026 at 1:45 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.