Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am planning to add iframes to my webpage to sites such as and was wondering if the security of the site would be impaired if i did this. As in, could peoples account be hacked if they used my site to access it?

share|improve this question
up vote 6 down vote accepted

If a site can be loaded into an iframe, then it is vulnerable to clickjacking attacks.

You cannot however use javascript in your site to alter the content and perform actions into the iframe (this applies to different domains), because of the same origin policy mechanism. This applies both ways, a script loaded into the iframe cannot run in the context of the parent frame.

However, there may be drawbacks for loading another site into an iframe. For example, your site is attacked and a persistent XSS is found. The attacker could then replace the dropbox iframe with a fake one he controls and gather user credentials/ data. Because the user cannot easily check the url of the loaded iframe, phising can be more easily done in an iframe.

The other version is also possible . The site you embed in the iframe is hacked and instead of it's normal content it displays a webpage that resembles a login in your page. Using this method, credentials from your site can be collected.

Furthermore, the embedded site can check if it is loaded in an iframe and jump out of it (change window.location) and perform further attacks from there.

As a conclusion, the overall security depends both on the security of your site and of the one you embed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.