<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>beer planet &#187; xss</title> <atom:link href="http://beerpla.net/tag/xss/feed/" rel="self" type="application/rss+xml" /><link>http://beerpla.net</link> <description>where things have nothing to do with beer - tutorials, tips, how-tos, thoughts, hacks, and other techy nonsense</description> <lastBuildDate>Fri, 06 Jan 2012 08:50:59 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel='hub' href='http://beerpla.net/?pushpress=hub'/> <item><title>How *Not* To Implement A Web Application That Handles External Authentication, Using BeTwittered.com As An Example</title><link>http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/</link> <comments>http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/#comments</comments> <pubDate>Thu, 04 Feb 2010 02:29:04 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Security]]></category> <category><![CDATA[auth]]></category> <category><![CDATA[authentication]]></category> <category><![CDATA[betwittered]]></category> <category><![CDATA[breach]]></category> <category><![CDATA[clear text]]></category> <category><![CDATA[cookie]]></category> <category><![CDATA[http]]></category> <category><![CDATA[https]]></category> <category><![CDATA[oauth]]></category> <category><![CDATA[password]]></category> <category><![CDATA[sniffing]]></category> <category><![CDATA[ssl]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[username]]></category> <category><![CDATA[xss]]></category> <guid
isPermaLink="false">http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/</guid> <description><![CDATA[<p><img
style="margin: 0px 10px 10px 0px; display: inline" title="lock" alt="lock" align="left" src="http://beerpla.net/wp-content/uploads/HowNotToImplementAWebApplicationThatHand_F181/image.png" width="150" height="150" /> Today I&#039;m going to look at how not to handle user authentication in a web application, taking <a
href="http://www.betwittered.com" rel="nofollow">BeTwittered.com</a> authenticating with Twitter as an example (sorry, guys).</p><p>BeTwittered is a simple and comfortable gadget that you can add to your site, such as your iGoogle homepage.</p><p>Since BeTwittered is just a bridge between you and Twitter, it has to first log you into your account. Here is where things go horribly, horribly wrong.</p><h2>1. BeTwittered does not use SSL to secure requests to its servers</h2><p>All authentication information is transmitted to BeTwittered servers in plain text and is easily sniffable by an attacker, both on your own network and outside of it. You can read more about SSL...<div
class=clear></div> <a
href="http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p><img
style="margin: 0px 10px 10px 0px; display: inline" title="lock" alt="lock" align="left" src="http://beerpla.net/wp-content/uploads/HowNotToImplementAWebApplicationThatHand_F181/image.png" width="150" height="150" /> Today I&#039;m going to look at how not to handle user authentication in a web application, taking <a
href="http://www.betwittered.com" rel="nofollow">BeTwittered.com</a> authenticating with Twitter as an example (sorry, guys).</p><p>BeTwittered is a simple and comfortable gadget that you can add to your site, such as your iGoogle homepage.</p><p>Since BeTwittered is just a bridge between you and Twitter, it has to first log you into your account. Here is where things go horribly, horribly wrong.</p><h2>1. BeTwittered does not use SSL to secure requests to its servers</h2><p>All authentication information is transmitted to BeTwittered servers in plain text and is easily sniffable by an attacker, both on your own network and outside of it. You can read more about SSL encryption <a
href="http://en.wikipedia.org/wiki/Transport_Layer_Security" rel="nofollow">here</a>.</p><p>Since BeTwittered passes your Twitter username and password unencrypted as GET parameters, it may as well be serving them to potential attackers on a silver platter (note that passing this data in a POST request would change nothing, security-wise).</p><p>Here is an example request:</p><p><a
title="http://betwittered.com/api/?_=1265242511260&amp;req=verify_credentials&amp;username=foo&amp;password=bar" href="http://betwittered.com/api/?_=1265242511260&amp;req=verify_credentials&amp;username=foo&amp;password=bar">http://betwittered.com/api/?_=1265242511260&amp;req=verify_credentials<strong><em>&amp;username=foo&amp;password=bar</em></strong></a></p><p>Ugh…</p><h2>2. BeTwittered stores your username and password in unencrypted cookies</h2><p>Because BeTwittered tries to keep you logged into Twitter, it caches the username and password, unencrypted, inside browser cookies.</p><p>This means that an attacker needs to simply look at your cookies to steal this information. This can be done using these methods, among others:</p><ul><li>using an XSS vulnerability</li><li>sniffing the network traffic</li><li>walking up to your computer</li></ul><p><a
href="http://beerpla.net/wp-content/uploads/HowNotToImplementAWebApplicationThatHand_F181/image_3.png" class="lightview" rel="gallery['1412']" title="betwittered username and password in cookies"><img
style="display: block; float: none; margin-left: auto; margin-right: auto" title="betwittered username and password in cookies" alt="betwittered username and password in cookies" src="http://beerpla.net/wp-content/uploads/HowNotToImplementAWebApplicationThatHand_F181/image_thumb.png" width="700" height="512" /></a></p><h2>3. Because BeTwittered passes your authentication information to its servers, it&#039;s already insecure</h2><p>If someone gets access to BeTwittered servers, it&#039;s safe to assume at that time that all accounts are potentially compromised.</p><p>Smaller sites generally cannot dedicate appropriate resources to securing their servers, which can make breaching them easier for hackers. Even Twitter itself was <a
href="http://www.google.com/search?hl=en&amp;q=twitter+hacked" rel="nofollow">hacked numerous times</a>.</p><p>&#160;</p><h2>The Alternative Solution</h2><h3>oAuth</h3><p>If the endpoint application supports <a
href="http://oauth.net/" rel="nofollow">oAuth</a> (Twitter has for months), do us all a favor and use it. Please.</p><p>oAuth allows delegating authentication to Twitter itself and only giving the application easily revokable limited access.</p><p>If BeTwittered were using oAuth, the user would be redirected to Twitter, where he or she would login. Then, the user would be sent back to BeTwittered, but now bearing special tokens. Any requests to Twitter would then be accompanied by these tokens, which would be validated by Twitter every time they&#039;re used &#8211; all of this without ever passing your password around.</p><p>You can find a nice overview of the oAuth architecture <a
href="http://hueniverse.com/2008/10/beginners-guide-to-oauth-part-iii-security-architecture/" rel="nofollow">here</a>.</p><h3>Otherwise</h3><p>If the endpoint application doesn&#039;t support oAuth, then</p><ul><li>use SSL encryption (https)</li><li>store the authentication information on the server side instead of the client side in a cookie. Instead, use the cookie to store some sort of an internal ID pointing to this server-side data. Alternatively, encrypt the username and password via a secure salted two-way hash and only then store the encrypted version in a cookie</li><li>make sure to stay on top of securing your servers (and give your sysadmin a raise). It&#039;s a time-consuming commitment, please take it seriously</li></ul><h2>Conclusion</h2><p>What other secure authentication technique or tips do you know about? Feel free to share in the comments.</p><p>Oh, and this goes without saying &#8211; stop using BeTwittered, at least until they implement a more secure login option. I&#039;ve alerted the creators about the issue and also started these threads on <a
href="http://news.ycombinator.com/item?id=1099356" rel="nofollow">HN</a> and <a
href="http://www.reddit.com/r/reddit.com/comments/axs81/using_betwittered_did_you_know_it_sends_your/" rel="nofollow">Reddit</a>.</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=How+%2ANot%2A+To+Implement+A+Web+Application+That+Handles+External+Authentication%2C+Using+BeTwittered.com+As+An+Example&amp;link=http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/&amp;notes=%20Today%20I%27m%20going%20to%20look%20at%20how%20not%20to%20handle%20user%20authentication%20in%20a%20web%20application%2C%20taking%20BeTwittered.com%20authenticating%20with%20Twitter%20as%20an%20example%20%28sorry%2C%20guys%29.%20%20BeTwittered%20is%20a%20simple%20and%20comfortable%20gadget%20that%20you%20can%20add%20to%20your%20site%2C%20such%20as%20your%20iGoogle%20homepage.%20%20Since%20BeTwittered%20is%20&amp;short_link=http://bit.ly/9xFmlK&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=How+%2ANot%2A+To+Implement+A+Web+Application+That+Handles+External+Authentication%2C+Using+BeTwittered.com+As+An+Example&amp;link=http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/&amp;notes=%20Today%20I%27m%20going%20to%20look%20at%20how%20not%20to%20handle%20user%20authentication%20in%20a%20web%20application%2C%20taking%20BeTwittered.com%20authenticating%20with%20Twitter%20as%20an%20example%20%28sorry%2C%20guys%29.%20%20BeTwittered%20is%20a%20simple%20and%20comfortable%20gadget%20that%20you%20can%20add%20to%20your%20site%2C%20such%20as%20your%20iGoogle%20homepage.%20%20Since%20BeTwittered%20is%20&amp;short_link=http://bit.ly/9xFmlK&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=How+%2ANot%2A+To+Implement+A+Web+Application+That+Handles+External+Authentication%2C+Using+BeTwittered.com+As+An+Example&amp;link=http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/&amp;notes=%20Today%20I%27m%20going%20to%20look%20at%20how%20not%20to%20handle%20user%20authentication%20in%20a%20web%20application%2C%20taking%20BeTwittered.com%20authenticating%20with%20Twitter%20as%20an%20example%20%28sorry%2C%20guys%29.%20%20BeTwittered%20is%20a%20simple%20and%20comfortable%20gadget%20that%20you%20can%20add%20to%20your%20site%2C%20such%20as%20your%20iGoogle%20homepage.%20%20Since%20BeTwittered%20is%20&amp;short_link=http://bit.ly/9xFmlK&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=How+%2ANot%2A+To+Implement+A+Web+Application+That+Handles+External+Authentication%2C+Using+BeTwittered.com+As+An+Example&amp;link=http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/&amp;notes=%20Today%20I%27m%20going%20to%20look%20at%20how%20not%20to%20handle%20user%20authentication%20in%20a%20web%20application%2C%20taking%20BeTwittered.com%20authenticating%20with%20Twitter%20as%20an%20example%20%28sorry%2C%20guys%29.%20%20BeTwittered%20is%20a%20simple%20and%20comfortable%20gadget%20that%20you%20can%20add%20to%20your%20site%2C%20such%20as%20your%20iGoogle%20homepage.%20%20Since%20BeTwittered%20is%20&amp;short_link=http://bit.ly/9xFmlK&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=How+%2ANot%2A+To+Implement+A+Web+Application+That+Handles+External+Authentication%2C+Using+BeTwittered.com+As+An+Example&amp;link=http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/&amp;notes=%20Today%20I%27m%20going%20to%20look%20at%20how%20not%20to%20handle%20user%20authentication%20in%20a%20web%20application%2C%20taking%20BeTwittered.com%20authenticating%20with%20Twitter%20as%20an%20example%20%28sorry%2C%20guys%29.%20%20BeTwittered%20is%20a%20simple%20and%20comfortable%20gadget%20that%20you%20can%20add%20to%20your%20site%2C%20such%20as%20your%20iGoogle%20homepage.%20%20Since%20BeTwittered%20is%20&amp;short_link=http://bit.ly/9xFmlK&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=How+%2ANot%2A+To+Implement+A+Web+Application+That+Handles+External+Authentication%2C+Using+BeTwittered.com+As+An+Example&amp;link=http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/&amp;notes=%20Today%20I%27m%20going%20to%20look%20at%20how%20not%20to%20handle%20user%20authentication%20in%20a%20web%20application%2C%20taking%20BeTwittered.com%20authenticating%20with%20Twitter%20as%20an%20example%20%28sorry%2C%20guys%29.%20%20BeTwittered%20is%20a%20simple%20and%20comfortable%20gadget%20that%20you%20can%20add%20to%20your%20site%2C%20such%20as%20your%20iGoogle%20homepage.%20%20Since%20BeTwittered%20is%20&amp;short_link=http://bit.ly/9xFmlK&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=How+%2ANot%2A+To+Implement+A+Web+Application+That+Handles+External+Authentication%2C+Using+BeTwittered.com+As+An+Example&amp;link=http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/&amp;notes=%20Today%20I%27m%20going%20to%20look%20at%20how%20not%20to%20handle%20user%20authentication%20in%20a%20web%20application%2C%20taking%20BeTwittered.com%20authenticating%20with%20Twitter%20as%20an%20example%20%28sorry%2C%20guys%29.%20%20BeTwittered%20is%20a%20simple%20and%20comfortable%20gadget%20that%20you%20can%20add%20to%20your%20site%2C%20such%20as%20your%20iGoogle%20homepage.%20%20Since%20BeTwittered%20is%20&amp;short_link=http://bit.ly/9xFmlK&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=How%20%2ANot%2A%20To%20Implement%20A%20Web%20Application%20That%20Handles%20External%20Authentication%2C%20Using%20BeTwittered.com%20As%20An%20Example&amp;link=http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/&amp;notes=%20Today%20I%27m%20going%20to%20look%20at%20how%20not%20to%20handle%20user%20authentication%20in%20a%20web%20application%2C%20taking%20BeTwittered.com%20authenticating%20with%20Twitter%20as%20an%20example%20%28sorry%2C%20guys%29.%20%20BeTwittered%20is%20a%20simple%20and%20comfortable%20gadget%20that%20you%20can%20add%20to%20your%20site%2C%20such%20as%20your%20iGoogle%20homepage.%20%20Since%20BeTwittered%20is%20&amp;short_link=http://bit.ly/9xFmlK&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2007/10/12/sysbench-linux-test-bench/" rel="bookmark" title="October 12, 2007">sysbench &#8211; Linux Test Bench</a></li><li><a
href="http://beerpla.net/2008/04/22/do-not-use-this-perl-module-passwdunix/" rel="bookmark" title="April 22, 2008">Do NOT Use This Perl Module: Passwd::Unix</a></li><li><a
href="http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/" rel="bookmark" title="February 12, 2009">How To Fight Clickjacking (Using The Recent Twitter Hijacking As An Example)</a></li><li><a
href="http://beerpla.net/2008/08/15/debugging-weird-sshd-connection-problems-what-happens-when-you-stop-sshd/" rel="bookmark" title="August 15, 2008">Debugging Weird sshd Connection Problems + What Happens When You Stop sshd</a></li><li><a
href="http://beerpla.net/2009/07/14/how-to-fix-palm-pres-error-sending-mail-problem-7/" rel="bookmark" title="July 14, 2009">How To Fix Palm Pre&#039;s &quot;Error Sending Mail&quot; Problem</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2010%2F02%2F03%2Fhow-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example%2F&amp;title=How%20%2ANot%2A%20To%20Implement%20A%20Web%20Application%20That%20Handles%20External%20Authentication%2C%20Using%20BeTwittered.com%20As%20An%20Example" id="wpa2a_2"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Modern-Day Frame Busting With X-FRAME-OPTIONS And &quot;This content cannot be displayed in a frame&quot; Warnings</title><link>http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/</link> <comments>http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/#comments</comments> <pubDate>Fri, 30 Oct 2009 01:10:32 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[click jacking]]></category> <category><![CDATA[clickjacking]]></category> <category><![CDATA[deny]]></category> <category><![CDATA[Firefox]]></category> <category><![CDATA[frame busting]]></category> <category><![CDATA[framebusting]]></category> <category><![CDATA[framekiller]]></category> <category><![CDATA[internet explorer]]></category> <category><![CDATA[same-origin]]></category> <category><![CDATA[sameorigin]]></category> <category><![CDATA[x-frame-options]]></category> <category><![CDATA[xss]]></category> <guid
isPermaLink="false">http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/</guid> <description><![CDATA[<p><a
href="http://beerpla.net/wp-content/uploads/ModernDayFrameBustingWithXFRAMEOPTIONSAn_F770/image.png" class="lightview" rel="gallery['1194']" title="image"><img
style="margin: 0px 10px 10px 0px; display: inline" title="image" alt="image" align="left" src="http://beerpla.net/wp-content/uploads/ModernDayFrameBustingWithXFRAMEOPTIONSAn_F770/image_thumb.png" width="150" height="150" /></a> Today I found out something entirely new about <a
href="http://en.wikipedia.org/wiki/Framekiller" rel="nofollow">framebusting</a> and specifically <a
href="http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/">clickjacking</a> protection techniques.</p><p>I was working with a site that was using frames. Suddenly, one of the frames (which was hosted on a domain that differed from the one it was embedded in) displayed the following message (in Firefox 3.5.4):</p><div
class="wp_syntax"><div
class="code"><pre>This content cannot be displayed in a frame
&#160;
To protect your security, the publisher of this content does
not allow it to be displayed in a frame.
&#160;
Click here to open this content in a new window</pre></div></div><p><a
href="http://beerpla.net/wp-content/uploads/ModernDayFrameBustingWithXFRAMEOPTIONSAn_F770/image_3.png" class="lightview" rel="gallery['1194']" title="image"><img
style="display: block; float: none; margin-left: auto; margin-right: auto" title="image" alt="image" src="http://beerpla.net/wp-content/uploads/ModernDayFrameBustingWithXFRAMEOPTIONSAn_F770/image_thumb_3.png" width="677" height="221" /></a></p><p>Notice how this is a native Firefox window and not a web page rendering. Quite stumped, I started looking at the frame response and...<div
class=clear></div> <a
href="http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<p><a
href="http://beerpla.net/wp-content/uploads/ModernDayFrameBustingWithXFRAMEOPTIONSAn_F770/image.png" class="lightview" rel="gallery['1194']" title="image"><img
style="margin: 0px 10px 10px 0px; display: inline" title="image" alt="image" align="left" src="http://beerpla.net/wp-content/uploads/ModernDayFrameBustingWithXFRAMEOPTIONSAn_F770/image_thumb.png" width="150" height="150" /></a> Today I found out something entirely new about <a
href="http://en.wikipedia.org/wiki/Framekiller" rel="nofollow">framebusting</a> and specifically <a
href="http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/">clickjacking</a> protection techniques.</p><p>I was working with a site that was using frames. Suddenly, one of the frames (which was hosted on a domain that differed from the one it was embedded in) displayed the following message (in Firefox 3.5.4):</p><div
class="wp_syntax"><div
class="code"><pre>This content cannot be displayed in a frame
&nbsp;
To protect your security, the publisher of this content does
not allow it to be displayed in a frame.
&nbsp;
Click here to open this content in a new window</pre></div></div><p><a
href="http://beerpla.net/wp-content/uploads/ModernDayFrameBustingWithXFRAMEOPTIONSAn_F770/image_3.png" class="lightview" rel="gallery['1194']" title="image"><img
style="display: block; float: none; margin-left: auto; margin-right: auto" title="image" alt="image" src="http://beerpla.net/wp-content/uploads/ModernDayFrameBustingWithXFRAMEOPTIONSAn_F770/image_thumb_3.png" width="677" height="221" /></a></p><p>Notice how this is a native Firefox window and not a web page rendering. Quite stumped, I started looking at the frame response and finally found that it included this little header:</p><div
class="wp_syntax"><div
class="code"><pre>X-FRAME-OPTIONS: DENY</pre></div></div><p>Turns out that modern browsers like <strike>Firefox 3.5</strike> (turns out it&#039;s the <a
href="https://addons.mozilla.org/en-US/firefox/addon/722" rel="nofollow">NoScript addon</a> that does this and not Firefox itself) and IE8 treat this header as a precautionary measure and display a generic &quot;warning&quot; to the user instead of the page content in certain conditions described below. This effort, <a
href="http://blogs.msdn.com/ie/archive/2009/01/27/ie8-security-part-vii-clickjacking-defenses.aspx" rel="nofollow">led, surprisingly, by Microsoft</a>, was really to protect users from clickjacking (I wrote about clickjacking <a
href="http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/">here</a> earlier) but can be viewed as an alternative to framebusting.</p><p>Microsoft introduced the new X-FRAME-OPTIONS header with the following possible values:</p><ul><li>DENY &#8211; prevents the page from being rendered if it is contained in a frame</li><li>SAMEORIGIN &#8211; same as above, unless the page belongs to the same domain as the top-level frameset holder.</li></ul><p><strike>Firefox adopted this technique a few months later</strike> (again, I was wrong here &#8211; it was NoScript that did it), and I expect other browsers to follow.</p><p>So what does it mean to you, the developer?</p><ul><li>setting such a header will essentially render frame busting code unnecessary in modern browsers</li><li>but it has a downside of displaying a relatively ugly warning to the user</li><li>no automatic redirect is done as your page (including any framebusting code) is not loaded</li><li>thus requiring an extra click</li><li>and popping up a new tab or window</li><li>it will work even if the user has Javascript disabled, which is more secure</li></ul><p>Some useful discussion on the issue can also be found in <a
href="http://hackademix.net/2009/01/29/x-frame-options-in-firefox/" rel="nofollow">this post</a> on Hackademix.net.</p><p>So is it good practice to use this new X-FRAME-OPTIONS header instead of the traditional framebusting code? I definitely think so, especially if Firefox and other browsers start supporting it. What do you say?</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=Modern-Day+Frame+Busting+With+X-FRAME-OPTIONS+And+%26quot%3BThis+content+cannot+be+displayed+in+a+frame%26quot%3B+Warnings&amp;link=http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/&amp;notes=%20Today%20I%20found%20out%20something%20entirely%20new%20about%20framebusting%20and%20specifically%20clickjacking%20protection%20techniques.%0D%0AI%20was%20working%20with%20a%20site%20that%20was%20using%20frames.%20Suddenly%2C%20one%20of%20the%20frames%20%28which%20was%20hosted%20on%20a%20domain%20that%20differed%20from%20the%20one%20it%20was%20embedded%20in%29%20displayed%20the%20following%20message&amp;short_link=http://bit.ly/chOjyg&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=Modern-Day+Frame+Busting+With+X-FRAME-OPTIONS+And+%26quot%3BThis+content+cannot+be+displayed+in+a+frame%26quot%3B+Warnings&amp;link=http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/&amp;notes=%20Today%20I%20found%20out%20something%20entirely%20new%20about%20framebusting%20and%20specifically%20clickjacking%20protection%20techniques.%0D%0AI%20was%20working%20with%20a%20site%20that%20was%20using%20frames.%20Suddenly%2C%20one%20of%20the%20frames%20%28which%20was%20hosted%20on%20a%20domain%20that%20differed%20from%20the%20one%20it%20was%20embedded%20in%29%20displayed%20the%20following%20message&amp;short_link=http://bit.ly/chOjyg&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=Modern-Day+Frame+Busting+With+X-FRAME-OPTIONS+And+%26quot%3BThis+content+cannot+be+displayed+in+a+frame%26quot%3B+Warnings&amp;link=http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/&amp;notes=%20Today%20I%20found%20out%20something%20entirely%20new%20about%20framebusting%20and%20specifically%20clickjacking%20protection%20techniques.%0D%0AI%20was%20working%20with%20a%20site%20that%20was%20using%20frames.%20Suddenly%2C%20one%20of%20the%20frames%20%28which%20was%20hosted%20on%20a%20domain%20that%20differed%20from%20the%20one%20it%20was%20embedded%20in%29%20displayed%20the%20following%20message&amp;short_link=http://bit.ly/chOjyg&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=Modern-Day+Frame+Busting+With+X-FRAME-OPTIONS+And+%26quot%3BThis+content+cannot+be+displayed+in+a+frame%26quot%3B+Warnings&amp;link=http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/&amp;notes=%20Today%20I%20found%20out%20something%20entirely%20new%20about%20framebusting%20and%20specifically%20clickjacking%20protection%20techniques.%0D%0AI%20was%20working%20with%20a%20site%20that%20was%20using%20frames.%20Suddenly%2C%20one%20of%20the%20frames%20%28which%20was%20hosted%20on%20a%20domain%20that%20differed%20from%20the%20one%20it%20was%20embedded%20in%29%20displayed%20the%20following%20message&amp;short_link=http://bit.ly/chOjyg&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=Modern-Day+Frame+Busting+With+X-FRAME-OPTIONS+And+%26quot%3BThis+content+cannot+be+displayed+in+a+frame%26quot%3B+Warnings&amp;link=http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/&amp;notes=%20Today%20I%20found%20out%20something%20entirely%20new%20about%20framebusting%20and%20specifically%20clickjacking%20protection%20techniques.%0D%0AI%20was%20working%20with%20a%20site%20that%20was%20using%20frames.%20Suddenly%2C%20one%20of%20the%20frames%20%28which%20was%20hosted%20on%20a%20domain%20that%20differed%20from%20the%20one%20it%20was%20embedded%20in%29%20displayed%20the%20following%20message&amp;short_link=http://bit.ly/chOjyg&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=Modern-Day+Frame+Busting+With+X-FRAME-OPTIONS+And+%26quot%3BThis+content+cannot+be+displayed+in+a+frame%26quot%3B+Warnings&amp;link=http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/&amp;notes=%20Today%20I%20found%20out%20something%20entirely%20new%20about%20framebusting%20and%20specifically%20clickjacking%20protection%20techniques.%0D%0AI%20was%20working%20with%20a%20site%20that%20was%20using%20frames.%20Suddenly%2C%20one%20of%20the%20frames%20%28which%20was%20hosted%20on%20a%20domain%20that%20differed%20from%20the%20one%20it%20was%20embedded%20in%29%20displayed%20the%20following%20message&amp;short_link=http://bit.ly/chOjyg&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=Modern-Day+Frame+Busting+With+X-FRAME-OPTIONS+And+%26quot%3BThis+content+cannot+be+displayed+in+a+frame%26quot%3B+Warnings&amp;link=http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/&amp;notes=%20Today%20I%20found%20out%20something%20entirely%20new%20about%20framebusting%20and%20specifically%20clickjacking%20protection%20techniques.%0D%0AI%20was%20working%20with%20a%20site%20that%20was%20using%20frames.%20Suddenly%2C%20one%20of%20the%20frames%20%28which%20was%20hosted%20on%20a%20domain%20that%20differed%20from%20the%20one%20it%20was%20embedded%20in%29%20displayed%20the%20following%20message&amp;short_link=http://bit.ly/chOjyg&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=Modern-Day%20Frame%20Busting%20With%20X-FRAME-OPTIONS%20And%20%26quot%3BThis%20content%20cannot%20be%20displayed%20in%20a%20frame%26quot%3B%20Warnings&amp;link=http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/&amp;notes=%20Today%20I%20found%20out%20something%20entirely%20new%20about%20framebusting%20and%20specifically%20clickjacking%20protection%20techniques.%0D%0AI%20was%20working%20with%20a%20site%20that%20was%20using%20frames.%20Suddenly%2C%20one%20of%20the%20frames%20%28which%20was%20hosted%20on%20a%20domain%20that%20differed%20from%20the%20one%20it%20was%20embedded%20in%29%20displayed%20the%20following%20message&amp;short_link=http://bit.ly/chOjyg&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/" rel="bookmark" title="February 12, 2009">How To Fight Clickjacking (Using The Recent Twitter Hijacking As An Example)</a></li><li><a
href="http://beerpla.net/2009/11/21/meet-firefox-for-mobile-video-feature-highlights-more-info/" rel="bookmark" title="November 21, 2009">Meet Firefox For Mobile [Video + Feature Highlights + More Info]</a></li><li><a
href="http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/" rel="bookmark" title="August 4, 2007">Watch &#8211; A Useful Linux Command You May Have Never Heard Of</a></li><li><a
href="http://beerpla.net/2009/06/09/how-to-make-your-site-lightning-fast-by-compressing-deflategzip-your-html-javascript-css-xml-etc-in-apache/" rel="bookmark" title="June 9, 2009">How To Make Your Site Lightning Fast* By Compressing (deflate/gzip) Your HTML, Javascript, CSS, XML, etc In Apache</a></li><li><a
href="http://beerpla.net/2006/06/12/rendr-a-live-awesome-csshtml-rendering-tool/" rel="bookmark" title="June 12, 2006">Rendr &#8211; a Live Awesome CSS/HTML Rendering Tool</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2009%2F10%2F29%2Fmodern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings%2F&amp;title=Modern-Day%20Frame%20Busting%20With%20X-FRAME-OPTIONS%20And%20%26quot%3BThis%20content%20cannot%20be%20displayed%20in%20a%20frame%26quot%3B%20Warnings" id="wpa2a_4"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>How To Fight Clickjacking (Using The Recent Twitter Hijacking As An Example)</title><link>http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/</link> <comments>http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/#comments</comments> <pubDate>Thu, 12 Feb 2009 19:43:53 +0000</pubDate> <dc:creator>Artem Russakovskii</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[Twitter]]></category> <category><![CDATA[attack]]></category> <category><![CDATA[click]]></category> <category><![CDATA[clickjacking]]></category> <category><![CDATA[combat]]></category> <category><![CDATA[fight]]></category> <category><![CDATA[Firefox]]></category> <category><![CDATA[ie]]></category> <category><![CDATA[injection]]></category> <category><![CDATA[internet explorer]]></category> <category><![CDATA[jacking]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[noscript]]></category> <category><![CDATA[protect]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[xss]]></category> <guid
isPermaLink="false">http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/</guid> <description><![CDATA[<h2><img
style="margin: 0px 10px 10px 0px; display: inline" title="image" alt="image" align="left" src="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image.png" width="150" height="138" /> Introduction</h2><p><a
href="http://en.wikipedia.org/wiki/Clickjacking">Clickjacking</a> is a malicious technique of tricking web users into revealing confidential information or taking control of their computer while clicking on seemingly innocuous web pages. A vulnerability across a variety of browsers and platforms, a clickjacking takes the form of embedded code or script that can execute without the user&#039;s knowledge, such as clicking on a button that appears to perform another function (credit: Wikipedia).</p><p>Clickjacking is hard to combat. From a technical standpoint, the attack is executed using a combination of <a
href="http://en.wikipedia.org/wiki/Css">CSS</a> and <a
href="http://en.wikipedia.org/wiki/IFrame">iFrames</a>, which are both harmless web technologies, and relies mostly on tricking users by means of social engineering. Additionally, the only server side technique against clickjacking known to me is “<a...<div
class=clear></div> <a
href="http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/" class="read_more"><div
class=excerpt-end>Read the rest of this article &#187;</div></a></p>]]></description> <content:encoded><![CDATA[<h2><img
style="margin: 0px 10px 10px 0px; display: inline" title="image" alt="image" align="left" src="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image.png" width="150" height="138" /> Introduction</h2><p><a
href="http://en.wikipedia.org/wiki/Clickjacking">Clickjacking</a> is a malicious technique of tricking web users into revealing confidential information or taking control of their computer while clicking on seemingly innocuous web pages. A vulnerability across a variety of browsers and platforms, a clickjacking takes the form of embedded code or script that can execute without the user&#039;s knowledge, such as clicking on a button that appears to perform another function (credit: Wikipedia).</p><p>Clickjacking is hard to combat. From a technical standpoint, the attack is executed using a combination of <a
href="http://en.wikipedia.org/wiki/Css">CSS</a> and <a
href="http://en.wikipedia.org/wiki/IFrame">iFrames</a>, which are both harmless web technologies, and relies mostly on tricking users by means of social engineering. Additionally, the only server side technique against clickjacking known to me is “<a
href="http://en.wikipedia.org/wiki/Framekiller">frame breaking</a>”, which would cause a legitemate site to break out of any iFrames it may be embedded in. This is not always the desired behavior and is generally frowned upon.</p><p><div
class="note"><div
class="noteclassic"><a
href="http://en.wikipedia.org/wiki/Cross-site_scripting">XSS</a> and <a
href="http://www.codinghorror.com/blog/archives/001171.html">CSRF</a> are examples of similar malicious web attacks.</div></div></p><h2>Generic Example</h2><p>In laymen’s terms, clickjacking means that it is quite possible for websites to trick you into, for example, clicking a button to show a cute kitty while in reality prompting a deletion of all your hotmail email. A malicious site uses an iFrame (which essentially allows embedding sites within other sites) with hotmail loaded inside and hidden using CSS (which is a web language for styling HTML elements). A button named “Show Me The Next Awwww Kitty” is then placed by the malicious site and positioned below the iFrame layer (manipulated by CSS, yet again). However, because the iFrame is hidden, it looks like the “Aww” button is all you’re clicking. Wrong!</p><p><a
href="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_3.png" class="lightview" rel="gallery['774']" title="image"><img
style="display: block; float: none; margin-left: auto; margin-right: auto" title="image" alt="image" src="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_thumb.png" width="351" height="92" /></a>&#160;</p><h2>Latest Example: Twitter</h2><p>This morning a new, though harmless, epidemic hit twitter. Hundreds and thousands of messages saying “Don’t Click: <a
href="http://tinyurl.com/amgzs6" rel="nofollow">http://tinyurl.com/amgzs6</a>” started showing up. Clicking the link shows a simple page with 1 button:</p><p><a
href="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_4.png" class="lightview" rel="gallery['774']" title="image"><img
style="display: block; float: none; margin-left: auto; margin-right: auto" title="image" alt="image" src="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_thumb_3.png" width="183" height="129" /></a> Clicking (which I of course did) uses clickjacking to repost the message to your own twitter account. Take a look yourself: <a
title="http://search.twitter.com/search?q=don%27t+click" href="http://search.twitter.com/search?q=don%27t+click" rel="nofollow">http://search.twitter.com/search?q=don%27t+click</a>.</p><p><a
href="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_5.png" class="lightview" rel="gallery['774']" title="image"><img
style="display: block; float: none; margin-left: auto; margin-right: auto" title="image" alt="image" src="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_thumb_4.png" width="504" height="492" /></a></p><p>All of these are a result of an experiment by <a
href="http://www.korben.info/petit-cours-de-twitt-jacking.html" rel="nofollow">some French guys</a> to mess around with twitter and show the effects of clickjacking. Thank you for that, French guys. Creating awareness via the most social platform on the web is the best thing they could do for us.</p><p><div
class="note"><div
class="notetip">Twitter rolled out a quick fix, using the very “frame breaking” technique I mentioned earlier. Now any site trying to embed twitter in an iFrame will redirect to it.</div></div></p><h2>Fight Clickjacking</h2><p><img
style="margin: 0px 10px 0px 0px; display: inline" title="image" alt="image" align="left" src="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_6.png" width="150" height="150" /> James Padolsey recently wrote an excellent <a
href="http://james.padolsey.com/general/clickjacking-twitter/">blog post about clickjacking</a> and mentioned Twitter specifically. Because clickjacking relies mostly on social hacking (i.e. tricking people into clicking malicious links and buttons), Twitter is nothing but a perfect platform. James gives some nice background info and code examples. He correctly highlights, as I did earlier, that clickjacking is not a software bug – it’s a malicious technique exploiting harmless technologies.</p><h4>So how does one fight clickjacking?</h4><p>At this point the most reliable way is to use Firefox and the <a
href="http://noscript.net/">NoScript extension</a>. NoScript provides a simple, yet amazingly effective feature, called <a
href="http://noscript.net/faq#qa7_4">ClearClick</a>. From their site:</p><p>“…it&#039;s enabled by default, protecting NoScript users from Clickjacking everywhere: it even remains active if you switch NoScript in the less safe <em>Allow scripts globally</em> mode. How does it work? Clickjacking hides or displaces or partially covers something you wouldn&#039;t want to click, if you could see it in its original context. ClearClick does the opposite: whenever you click a plugin object or a framed page, it takes a screenshot of it alone and opaque (i.e. an image of it with no transparencies and no overlaying objects), then compares it with a screenshot of the parent page as you can see it. If the two images differ, a clickjacking attack is probably happening and NoScript raises a &quot;ClearClick warning&quot;, showing you the contextualized and &quot;clear&quot; object you were about to click, so you can evaluate by yourself if that was really something you wanted to do.”</p><p>Did ClearClick work in the earlier twitter attack? Sure did! After I clicked the “Don’t click” button Noscript promptly popped up a warning showing the hidden iFrame (since the original malicious page has been removed, I found <a
href="http://www.korben.info/twitter/ohoh.html" rel="nofollow">another similar page</a> from the same author for screenshot purposes).</p><p><a
href="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_7.png" class="lightview" rel="gallery['774']" title="image"><img
style="display: block; float: none; margin-left: auto; margin-right: auto" title="image" alt="image" src="http://beerpla.net/wp-content/uploads/HowToFightClickjackingUsingTheRecentTwit_8F77/image_thumb_5.png" width="426" height="426" /></a>&#160;</p><p>So, even if you don’t want to enable NoScript globally, install it anyway, just for ClearClick.</p><p><div
class="note"><div
class="noteclassic">Using a browser other than Firefox? The best technique you should use is, as a general rule, don’t click on suspicious buttons and links on pages you are not familiar with. Remember: you’re on the Internet and it is full of traps.</div></div></p><p>That about covers what I had to say about clickjacking. Stay safe, folks!</p><div
class="shr-bookmarks shr-bookmarks-expand"><ul
class="socials"><li
class="shr-twitter"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Fight+Clickjacking+%28Using+The+Recent+Twitter+Hijacking+As+An+Example%29&amp;link=http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/&amp;notes=%20Introduction%20%20Clickjacking%20is%20a%20malicious%20technique%20of%20tricking%20web%20users%20into%20revealing%20confidential%20information%20or%20taking%20control%20of%20their%20computer%20while%20clicking%20on%20seemingly%20innocuous%20web%20pages.%20A%20vulnerability%20across%20a%20variety%20of%20browsers%20and%20platforms%2C%20a%20clickjacking%20takes%20the%20form%20of%20embedde&amp;short_link=http://bit.ly/bXYPgv&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li
class="shr-facebook"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Fight+Clickjacking+%28Using+The+Recent+Twitter+Hijacking+As+An+Example%29&amp;link=http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/&amp;notes=%20Introduction%20%20Clickjacking%20is%20a%20malicious%20technique%20of%20tricking%20web%20users%20into%20revealing%20confidential%20information%20or%20taking%20control%20of%20their%20computer%20while%20clicking%20on%20seemingly%20innocuous%20web%20pages.%20A%20vulnerability%20across%20a%20variety%20of%20browsers%20and%20platforms%2C%20a%20clickjacking%20takes%20the%20form%20of%20embedde&amp;short_link=http://bit.ly/bXYPgv&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li
class="shr-googlebuzz"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Fight+Clickjacking+%28Using+The+Recent+Twitter+Hijacking+As+An+Example%29&amp;link=http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/&amp;notes=%20Introduction%20%20Clickjacking%20is%20a%20malicious%20technique%20of%20tricking%20web%20users%20into%20revealing%20confidential%20information%20or%20taking%20control%20of%20their%20computer%20while%20clicking%20on%20seemingly%20innocuous%20web%20pages.%20A%20vulnerability%20across%20a%20variety%20of%20browsers%20and%20platforms%2C%20a%20clickjacking%20takes%20the%20form%20of%20embedde&amp;short_link=http://bit.ly/bXYPgv&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a></li><li
class="shr-reddit"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Fight+Clickjacking+%28Using+The+Recent+Twitter+Hijacking+As+An+Example%29&amp;link=http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/&amp;notes=%20Introduction%20%20Clickjacking%20is%20a%20malicious%20technique%20of%20tricking%20web%20users%20into%20revealing%20confidential%20information%20or%20taking%20control%20of%20their%20computer%20while%20clicking%20on%20seemingly%20innocuous%20web%20pages.%20A%20vulnerability%20across%20a%20variety%20of%20browsers%20and%20platforms%2C%20a%20clickjacking%20takes%20the%20form%20of%20embedde&amp;short_link=http://bit.ly/bXYPgv&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li
class="shr-hackernews"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Fight+Clickjacking+%28Using+The+Recent+Twitter+Hijacking+As+An+Example%29&amp;link=http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/&amp;notes=%20Introduction%20%20Clickjacking%20is%20a%20malicious%20technique%20of%20tricking%20web%20users%20into%20revealing%20confidential%20information%20or%20taking%20control%20of%20their%20computer%20while%20clicking%20on%20seemingly%20innocuous%20web%20pages.%20A%20vulnerability%20across%20a%20variety%20of%20browsers%20and%20platforms%2C%20a%20clickjacking%20takes%20the%20form%20of%20embedde&amp;short_link=http://bit.ly/bXYPgv&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=202&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a></li><li
class="shr-delicious"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Fight+Clickjacking+%28Using+The+Recent+Twitter+Hijacking+As+An+Example%29&amp;link=http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/&amp;notes=%20Introduction%20%20Clickjacking%20is%20a%20malicious%20technique%20of%20tricking%20web%20users%20into%20revealing%20confidential%20information%20or%20taking%20control%20of%20their%20computer%20while%20clicking%20on%20seemingly%20innocuous%20web%20pages.%20A%20vulnerability%20across%20a%20variety%20of%20browsers%20and%20platforms%2C%20a%20clickjacking%20takes%20the%20form%20of%20embedde&amp;short_link=http://bit.ly/bXYPgv&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li
class="shr-stumbleupon"> <a
href="http://www.shareaholic.com/api/share/?title=How+To+Fight+Clickjacking+%28Using+The+Recent+Twitter+Hijacking+As+An+Example%29&amp;link=http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/&amp;notes=%20Introduction%20%20Clickjacking%20is%20a%20malicious%20technique%20of%20tricking%20web%20users%20into%20revealing%20confidential%20information%20or%20taking%20control%20of%20their%20computer%20while%20clicking%20on%20seemingly%20innocuous%20web%20pages.%20A%20vulnerability%20across%20a%20variety%20of%20browsers%20and%20platforms%2C%20a%20clickjacking%20takes%20the%20form%20of%20embedde&amp;short_link=http://bit.ly/bXYPgv&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li
class="shr-mail"> <a
href="http://www.shareaholic.com/api/share/?title=How%20To%20Fight%20Clickjacking%20%28Using%20The%20Recent%20Twitter%20Hijacking%20As%20An%20Example%29&amp;link=http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/&amp;notes=%20Introduction%20%20Clickjacking%20is%20a%20malicious%20technique%20of%20tricking%20web%20users%20into%20revealing%20confidential%20information%20or%20taking%20control%20of%20their%20computer%20while%20clicking%20on%20seemingly%20innocuous%20web%20pages.%20A%20vulnerability%20across%20a%20variety%20of%20browsers%20and%20platforms%2C%20a%20clickjacking%20takes%20the%20form%20of%20embedde&amp;short_link=http://bit.ly/bXYPgv&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=201&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a></li></ul><div
style="clear: both;"></div></div> Similar Posts:<ul><li><a
href="http://beerpla.net/2009/10/29/modern-day-frame-busting-with-x-frame-options-and-this-content-cannot-be-displayed-in-a-frame-warnings/" rel="bookmark" title="October 29, 2009">Modern-Day Frame Busting With X-FRAME-OPTIONS And &quot;This content cannot be displayed in a frame&quot; Warnings</a></li><li><a
href="http://beerpla.net/2009/12/20/enable-a-twitter-retweet-rt-button-that-lets-you-add-comments-before-retweeting/" rel="bookmark" title="December 20, 2009">Enable A Twitter Retweet (RT) Button That Lets You Add Comments Before Retweeting</a></li><li><a
href="http://beerpla.net/2010/02/03/how-not-to-implement-a-web-application-that-handles-external-authentication-using-betwittered-com-as-an-example/" rel="bookmark" title="February 3, 2010">How *Not* To Implement A Web Application That Handles External Authentication, Using BeTwittered.com As An Example</a></li><li><a
href="http://beerpla.net/2009/10/24/are-you-a-stackoverflow-com-superuser-com-serverfault-com-fan-heres-a-greasemonkey-script-to-keep-track-of-your-accounts-on-all-of-them/" rel="bookmark" title="October 24, 2009">StackOverflow.com, SuperUser.com, ServerFault.com Fan? Here&#039;s A Greasemonkey Script To Keep Track Of All Your Accounts</a></li><li><a
href="http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-useful-lists/" rel="bookmark" title="June 21, 2009">Hidden Features Of Perl, PHP, Javascript, C, C++, C#, Java, Ruby, Python, And Others [Collection Of Incredibly Useful Lists]</a></li></ul><p><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbeerpla.net%2F2009%2F02%2F12%2Fhow-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example%2F&amp;title=How%20To%20Fight%20Clickjacking%20%28Using%20The%20Recent%20Twitter%20Hijacking%20As%20An%20Example%29" id="wpa2a_6"><img
src="http://beerpla.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded> <wfw:commentRss>http://beerpla.net/2009/02/12/how-to-fight-clickjacking-using-the-recent-twitter-hijacking-as-an-example/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> </channel> </rss>
