<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Social Media Security</title>
	
	<link>http://socialmediasecurity.com</link>
	<description>Exposing the insecurities of social media</description>
	<lastBuildDate>Fri, 04 May 2012 02:23:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<copyright>2012 </copyright>
	<managingEditor>feedback@socialmediasecurity.com (Social Media Security)</managingEditor>
	<webMaster>feedback@socialmediasecurity.com (Social Media Security)</webMaster>
	<category>Podcasts</category>
	<ttl>1440</ttl>
	<image>
		<url>http://socialmediasecurity.com/wp-content/uploads/2009/08/skull.jpg</url>
		<title>Social Media Security</title>
		<link>http://socialmediasecurity.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle>Social Media Security Podcast</itunes:subtitle>
	<itunes:summary>A podcast about the security and insecurity of social media.  Hosts are Scott Wright from the Street-Wise Security Zone, Tom Eston founder of socialmediasecurity.com and Kevin Johnson SANS instructor and security consultant with InGuardians.</itunes:summary>
	<itunes:keywords>twitter,facebook,myspace,privacy,security,socialmedia,socialnetworking</itunes:keywords>
	
	<itunes:author>Social Media Security</itunes:author>
	
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://socialmediasecurity.com/wp-content/uploads/2009/08/skull.jpg" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SocialMediaSecurity" /><feedburner:info uri="socialmediasecurity" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><media:copyright>2012</media:copyright><media:thumbnail url="http://socialmediasecurity.com/wp-content/uploads/2009/08/skull.jpg" /><media:keywords>twitter,facebook,myspace,privacy,security,socialmedia,socialnetworking</media:keywords><media:category scheme="http://www.itunes.com/dtds/podcast-1.0.dtd">Technology/Tech News</media:category><itunes:owner><itunes:email>feedback@socialmediasecurity.com</itunes:email></itunes:owner><itunes:category text="Technology"><itunes:category text="Tech News" /></itunes:category><feedburner:emailServiceId>SocialMediaSecurity</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Facebook Privacy and Security Article on ConsumerReports</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/dmAe-Sht614/</link>
		<comments>http://socialmediasecurity.com/2012/05/03/facebook-privacy-and-security-article-on-consumerreports/#comments</comments>
		<pubDate>Fri, 04 May 2012 02:23:31 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Privacy]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=31331</guid>
		<description><![CDATA[I wanted to pass along a really good article on Facebook Privacy that was released on ConsumerReports.org.  There are some good quotes from others in the security and privacy community including Kevin Johnson and Ed Skoudis.  Check out the article here: http://www.consumerreports.org/cro/magazine/2012/06/facebook-your-privacy/index.htm &#160;]]></description>
			<content:encoded><![CDATA[<p>I wanted to pass along a really good article on Facebook Privacy that was released on ConsumerReports.org.  There are some good quotes from others in the security and privacy community including <a href="http://twitter.com/#!/secureideas">Kevin Johnson</a> and <a href="http://twitter.com/#!/edskoudis">Ed Skoudis</a>.  Check out the article here:</p>
<p><a href="http://www.consumerreports.org/cro/magazine/2012/06/facebook-your-privacy/index.htm">http://www.consumerreports.org/cro/magazine/2012/06/facebook-your-privacy/index.htm</a></p>
<p>&nbsp;</p>

<p><a href="http://feedads.g.doubleclick.net/~a/uRNyN9gBnK3VsxP69IBtrsY8brQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/uRNyN9gBnK3VsxP69IBtrsY8brQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/uRNyN9gBnK3VsxP69IBtrsY8brQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/uRNyN9gBnK3VsxP69IBtrsY8brQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=dmAe-Sht614:qnL71g0r628:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/dmAe-Sht614" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2012/05/03/facebook-privacy-and-security-article-on-consumerreports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://socialmediasecurity.com/2012/05/03/facebook-privacy-and-security-article-on-consumerreports/</feedburner:origLink></item>
		<item>
		<title>Social Media Security Podcast 28 – Facebook Timeline, US Privacy Questions, Twitter Acquisitions</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7EbRewpCgqY/</link>
		<comments>http://socialmediasecurity.com/2012/04/19/social-media-security-podcast-28-facebook-timeline-us-privacy-questions-twitter-acquisitions/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 14:57:42 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[Podcasts]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[socialmedia]]></category>
		<category><![CDATA[socialnetworking]]></category>
		<category><![CDATA[timeline]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=9874</guid>
		<description><![CDATA[This is the 28th episode of the Social Media Security Podcast recorded back a few months ago.  Content is still relevant! This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast: Facebook starts rolling out Timeline to everyone (what you need to know about the [...]]]></description>
			<content:encoded><![CDATA[<p>This is the 28th episode of the Social Media Security Podcast recorded back a few months ago.  Content is still relevant! <img src='http://socialmediasecurity.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  This episode was hosted by <a href="http://twitter.com/agent0x0">Tom Eston</a> and <a href="http://twitter.com/streetsec">Scott Wright</a>.  Below are the show notes, links to articles and news mentioned in the podcast:</p>
<ul>
<li>Facebook starts rolling out <a href="http://www.zdnet.com/blog/facebook/facebook-starts-rolling-out-timeline-to-everyone/7969">Timeline</a> to everyone (<a href="http://howto.cnet.com/8301-11310_39-20112978-285/how-to-protect-your-facebook-timeline-privacy/">what you need to know about the timeline privacy</a>)</li>
<li>Twitter <a href="http://www.pcmag.com/article2/0,2817,2399244,00.asp">Acquires Web Security Firm Dasient</a></li>
<li><a href="http://www.net-security.org/malware_news.php?id=1965">Trojan steals e-cash vouchers </a>from Facebook users</li>
<li>Facebook ducks <a href="http://nakedsecurity.sophos.com/2012/01/11/facebook-ducks-u-s-privacy-questions/">U.S. privacy question</a></li>
<li>LinkedIn Friend Finder&#8230;what you need to know!</li>
</ul>
<p>Don&#8217;t worry! We are still planning on getting back to regular podcasts.  Stay tuned.  Please send any show feedback to <strong>feedback [aT] socialmediasecurity.com</strong> or comment below.  You can also call our voice mail box at <strong>1-613-693-0997</strong> if you have a question for our Q&amp;A section on the next episode.  <strong>You can also <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=329032812">subscribe to the podcast in iTunes</a> </strong>and <strong><a href="http://twitter.com/socialmediasec">follow us on Twitter</a></strong>.  Thanks for listening!</p>
<p>&nbsp;</p>

<p><a href="http://feedads.g.doubleclick.net/~a/B9nwsYG63-2RyN9fSFJ_qj0Bs5A/0/da"><img src="http://feedads.g.doubleclick.net/~a/B9nwsYG63-2RyN9fSFJ_qj0Bs5A/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/B9nwsYG63-2RyN9fSFJ_qj0Bs5A/1/da"><img src="http://feedads.g.doubleclick.net/~a/B9nwsYG63-2RyN9fSFJ_qj0Bs5A/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7EbRewpCgqY:VzDsRe5Zu7o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7EbRewpCgqY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2012/04/19/social-media-security-podcast-28-facebook-timeline-us-privacy-questions-twitter-acquisitions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
			<enclosure url="http://socialmediasecurity.com/podpress_trac/feed/9874/0/SocialMediaSecurityPodcast_28.mp3" length="33325404" type="audio/mpeg" />
		<itunes:duration>0:27:44</itunes:duration>
		<itunes:subtitle>This is the 28th episode of the Social Media Security Podcast recorded back a few months ago.  Content is still relevant!   This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the[...]</itunes:subtitle>
		<itunes:summary>This is the 28th episode of the Social Media Security Podcast recorded back a few months ago.  Content is still relevant!   This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast:

Facebook starts rolling out Timeline to everyone (what you need to know about the timeline privacy)
Twitter Acquires Web Security Firm Dasient
Trojan steals e-cash vouchers from Facebook users
Facebook ducks U.S. privacy question
LinkedIn Friend Finder…what you need to know!

Don’t worry! We are still planning on getting back to regular podcasts.  Stay tuned.  Please send any show feedback to feedback [aT] socialmediasecurity.com or comment below.  You can also call our voice mail box at 1-613-693-0997 if you have a question for our Q&amp;A section on the next episode.  You can also subscribe to the podcast in iTunes and follow us on Twitter.  Thanks for listening!
 </itunes:summary>
		<itunes:keywords>security, socialmedia, privacy, facebook, myspace, twitter, socialnetworking, internet</itunes:keywords>
		<itunes:author>Social Media Security</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>no</itunes:block>
	<media:content url="http://socialmediasecurity.com/podpress_trac/feed/9874/0/SocialMediaSecurityPodcast_28.mp3" fileSize="33325404" type="audio/mpeg" /><feedburner:origLink>http://socialmediasecurity.com/2012/04/19/social-media-security-podcast-28-facebook-timeline-us-privacy-questions-twitter-acquisitions/</feedburner:origLink></item>
		<item>
		<title>Facebook Privacy &amp; Security Guide Updated to v3.0</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/ze847vSDaVg/</link>
		<comments>http://socialmediasecurity.com/2011/11/24/facebook-privacy-security-guide-updated-to-v3-0/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 01:45:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[socialmedia]]></category>
		<category><![CDATA[socialnetworking]]></category>
		<category><![CDATA[socnetsec]]></category>
		<category><![CDATA[tom]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=7282</guid>
		<description><![CDATA[I&#8217;ve finally updated the Facebook Privacy &#38; Security Guide to version 3.0.  This is a major revision which includes directions on how to set the latest privacy and security controls in Facebook.  Maintaining this guide has been challenging over the last year as Facebook has made major changes multiple times in regards to the way [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally updated the Facebook Privacy &amp; Security Guide to version 3.0.  This is a major revision which includes directions on how to set the latest privacy and security controls in Facebook.  Maintaining this guide has been challenging over the last year as Facebook has made major changes multiple times in regards to the way privacy settings are enabled.  Having said that, this is a great time to use my guide and review what your privacy settings are.  Things like enabling secure browsing, login approvals and limiting the audience to what you post are more important then ever.</p>
<p>As always, feel free to distribute this guide to friends and family!  Happy Thanksgiving!</p>
<p><a href="http://socialmediasecurity.com/downloads/Facebook_Privacy_and_Security_Guide.pdf">Download v3.0 of the Facebook Privacy &amp; Security Guide here</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/X7rPGkkJ4GjIyjJPKf3Aw0kzJdI/0/da"><img src="http://feedads.g.doubleclick.net/~a/X7rPGkkJ4GjIyjJPKf3Aw0kzJdI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/X7rPGkkJ4GjIyjJPKf3Aw0kzJdI/1/da"><img src="http://feedads.g.doubleclick.net/~a/X7rPGkkJ4GjIyjJPKf3Aw0kzJdI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=ze847vSDaVg:yngxBOZnpXE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/ze847vSDaVg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/11/24/facebook-privacy-security-guide-updated-to-v3-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<enclosure url="http://socialmediasecurity.com/downloads/Facebook_Privacy_and_Security_Guide.pdf" length="92998" type="application/pdf" /><media:content url="http://socialmediasecurity.com/downloads/Facebook_Privacy_and_Security_Guide.pdf" fileSize="92998" type="application/pdf" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Social Media Security Podcast</itunes:subtitle><itunes:summary>A podcast exposing the insecurity of social media. Hosts are Scott Wright from the Street-Wise Security Zone, Tom Eston founder of SocialMediaSecurity.com and Kevin Johnson SANS instructor and senior security consultant with Secure Ideas.</itunes:summary><itunes:keywords>twitter,facebook,myspace,privacy,security,socialmedia,socialnetworking</itunes:keywords><feedburner:origLink>http://socialmediasecurity.com/2011/11/24/facebook-privacy-security-guide-updated-to-v3-0/</feedburner:origLink></item>
		<item>
		<title>Social Media Security Podcast 27 – Facebook Friend Unlock, The Anti-Facebook, Facebook Games</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/mhBDvle1CTg/</link>
		<comments>http://socialmediasecurity.com/2011/11/24/social-media-security-podcast-27-facebook-friend-unlock-the-anti-facebook-facebook-games/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 17:58:19 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Podcasts]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[socialmedia]]></category>
		<category><![CDATA[socialnetworking]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=7272</guid>
		<description><![CDATA[This is the 27th episode of the Social Media Security Podcast recorded November 11, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast: Locked Out Of Facebook? Your Friends Will Soon Be Able To Help You Get Back In Anti-Facebook Social Network [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2319" title="skull" src="http://socialmediasecurity.com/wp-content/uploads/2010/05/skull.jpg" alt="" width="104" height="102" />This is the 27th episode of the Social Media Security Podcast recorded November 11, 2011.  This episode was hosted by <a href="http://twitter.com/agent0x0">Tom Eston</a> and <a href="http://twitter.com/streetsec">Scott Wright</a>.  Below are the show notes, links to articles and news mentioned in the podcast:</p>
<ul>
<li>Locked Out Of Facebook? <a href="http://techcrunch.com/2011/10/27/locked-out-of-facebook-your-friends-will-soon-be-able-to-unlock-your-account/">Your Friends Will Soon Be Able To Help You Get Back In</a></li>
<li>Anti-Facebook Social Network <a href="http://techcrunch.com/2011/10/25/anti-facebook-social-network-unthink-launches-to-public/">“Unthink” </a>Launches To Public</li>
<li>Most social networks users <a href="http://www.net-security.org/secworld.php?id=11750">don&#8217;t keep up with privacy settings changes</a></li>
<li><a href="http://blogs.csoonline.com/1775/facebook_video_games_are_stupid_anyway">Facebook video games are stupid, anyway</a></li>
</ul>
<div>Please send any show feedback to <strong>feedback [aT] socialmediasecurity.com</strong> or comment below.  You can also call our voice mail box at <strong>1-613-693-0997</strong> if you have a question for our Q&amp;A section on the next episode.  <strong>You can also <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=329032812">subscribe to the podcast in iTunes</a> </strong>and <strong><a href="http://twitter.com/socialmediasec">follow us on Twitter</a></strong>.  Thanks for listening!</div>

<p><a href="http://feedads.g.doubleclick.net/~a/01ys0Rzf7bOByJrfhzS495BL_II/0/da"><img src="http://feedads.g.doubleclick.net/~a/01ys0Rzf7bOByJrfhzS495BL_II/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/01ys0Rzf7bOByJrfhzS495BL_II/1/da"><img src="http://feedads.g.doubleclick.net/~a/01ys0Rzf7bOByJrfhzS495BL_II/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=mhBDvle1CTg:olLi6gbFuhY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/mhBDvle1CTg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/11/24/social-media-security-podcast-27-facebook-friend-unlock-the-anti-facebook-facebook-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
			<enclosure url="http://socialmediasecurity.com/podpress_trac/feed/7272/0/SocialMediaSecurityPodcast_27.mp3" length="28526402" type="audio/mpeg" />
		<itunes:duration>0:23:44</itunes:duration>
		<itunes:subtitle>This is the 27th episode of the Social Media Security Podcast recorded November 11, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast:

Locked Out Of Facebook[...]</itunes:subtitle>
		<itunes:summary>This is the 27th episode of the Social Media Security Podcast recorded November 11, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast:

Locked Out Of Facebook? Your Friends Will Soon Be Able To Help You Get Back In
Anti-Facebook Social Network “Unthink” Launches To Public
Most social networks users don’t keep up with privacy settings changes
Facebook video games are stupid, anyway

Please send any show feedback to feedback [aT] socialmediasecurity.com or comment below.  You can also call our voice mail box at 1-613-693-0997 if you have a question for our Q&amp;A section on the next episode.  You can also subscribe to the podcast in iTunes and follow us on Twitter.  Thanks for listening!</itunes:summary>
		<itunes:keywords>Facebook, Podcasts</itunes:keywords>
		<itunes:author>Social Media Security</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>no</itunes:block>
	<media:content url="http://socialmediasecurity.com/podpress_trac/feed/7272/0/SocialMediaSecurityPodcast_27.mp3" fileSize="28526402" type="audio/mpeg" /><feedburner:origLink>http://socialmediasecurity.com/2011/11/24/social-media-security-podcast-27-facebook-friend-unlock-the-anti-facebook-facebook-games/</feedburner:origLink></item>
		<item>
		<title>The race for the most personal Twitter followers</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/BOaesNYJRqU/</link>
		<comments>http://socialmediasecurity.com/2011/11/13/the-race-for-the-most-personal-twitter-followers/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 01:49:46 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[james]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=7079</guid>
		<description><![CDATA[I have had a great reply on this topic while going around the USA talking about social media security.  During my talk I give an example of why it is NOT okay to allow just anyone the right to follow you or vise versa. I choose a volunteer out of the crowd.  Usually a nice looking woman because&#8230;why [...]]]></description>
			<content:encoded><![CDATA[<p>I have had a great reply on this topic while going around the USA talking about social media security.  During my talk I give an example of why it is NOT okay to allow just anyone the right to follow you or vise versa.</p>
<p>I choose a volunteer out of the crowd.  Usually a nice looking woman because&#8230;why not.  I give a hypothetical situation.  We were dating and things are starting to get serious.  So serious that I take her to meet my mom for the first time. While we are at my ma&#8217;s house, I introduce her to my new brother-in-law.  My brother-in-law was in charge of bringing the dinner rolls and once again forgot.  He asks her to go to the Italian (not french) bakery down the road with him to get these rolls.  She says yes.  While they are picking up the rolls he notices that he forgot his wallet and asked her for $4.98 to cover the rolls.  She just happens to have $5.00 in her left pocket.</p>
<p>Would she give him the $5.00 and why?</p>
<p>The answer has always been &#8220;yes&#8221; and because he is associated or was introduced to her by me.  There is an applied level of trust set prior to them going to the bakery.  Well this level of trust in my opinion can be accomplished within twitter.  If I follow you and we start having a friendly conversation(your favorite sports team) I will then go after your friends and family for a small amount to help me with my &#8220;cure/run/walk&#8221;.  All I have to do is introduce myself as your friend as they can see our past conversations in twitter.  I  have had a over 90% success rate of getting their followers to click my cause link.  This success is based on the applied trust between two strangers.  So although it is really #kwel to have 70,000 twitter followers it can also cost your friends and family $4.98</p>
<p>For more information feel free&#8230;info@unixbox.ws</p>

<p><a href="http://feedads.g.doubleclick.net/~a/CAHHPVraTzaLrtER2D2scolLZUA/0/da"><img src="http://feedads.g.doubleclick.net/~a/CAHHPVraTzaLrtER2D2scolLZUA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CAHHPVraTzaLrtER2D2scolLZUA/1/da"><img src="http://feedads.g.doubleclick.net/~a/CAHHPVraTzaLrtER2D2scolLZUA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=BOaesNYJRqU:Ba7gxOs1pu4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/BOaesNYJRqU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/11/13/the-race-for-the-most-personal-twitter-followers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://socialmediasecurity.com/2011/11/13/the-race-for-the-most-personal-twitter-followers/</feedburner:origLink></item>
		<item>
		<title>Taking over the Facebook Page “buy now” button (Part 2 of 2)</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/VhXld5UWc-Y/</link>
		<comments>http://socialmediasecurity.com/2011/11/13/taking-over-the-facebook-page-buy-now-button-part-2-of-2/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 01:45:39 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[james]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[socialmedia]]></category>
		<category><![CDATA[socialnetworking]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=7076</guid>
		<description><![CDATA[As I have been testing the security settings of companies social media strategies, I have consistently noticed two things, marketing is desperately trying to find its ROI and IT/Security doesn&#8217;t even know they have a FB page.  I do agree that after a number of months, it is time to show the CFO that spending that insame amount of time [...]]]></description>
			<content:encoded><![CDATA[<p>As I have been testing the security settings of companies social media strategies, I have consistently noticed two things, marketing is desperately trying to find its ROI and IT/Security doesn&#8217;t even know they have a FB page.  I do agree that after a number of months, it is time to show the CFO that spending that insame amount of time on their social media sites is worth the payroll checks. Unfortunately, analytics alone have been a blurry way of making that compelling argument and can be defeated by saying, if, I had put those payroll checks into google&#8230;I could see our ROI in a nice neat report. This is one of the reasons that marketing is jumping head first into technologies like Shoutlet, payvment or <a title="Article on e-commerce apps." href="http://www.practicalecommerce.com/articles/2095-Six-Facebook-Applications-to-Sell-Your-Products">others</a> (FB E-commerce). Why not sell your items on your FB Page?  Your team has worked extremely hard to get thousands of new users to click follow/like. Ultimately, this is going to be the future of pages but because IT/Security is not involved in the social media process it also opens a HUGE GAPPING HOLE in your security policy and procedures. And of course here is your example:</p>
<p>The policy of company ACME is &#8220;no social networking allowed&#8221; on internal networks.  Sites are being blocked at the firewall with rules and enforced with a content filtering tool. IT/Security has done its job with social media, right? BUT an exception is made for Marketing because they are special people. A FB page was created as well as an E-Commerce app installed without consulting IT/Security. I know this because after taking over the FB page using our friends Cain and Able, I replaced just one of the &#8220;buy now&#8221; buttons to redirect it my site and used analytics to see how many people clicked this button.  Showing this to Director of IT he replied &#8220;I didn&#8217;t even know we had a FB Page.&#8221;</p>
<p>Part 2</p>
<p>After this meeting we agreed to stop and allow IT/ Security to be a part of the implementation of this new e-com solution and lock down this new site.  After a couple of months we were given the green light that all social media was secure and our attacks would now #fail.  Well they were wrong!  Here is what happened;  Technology constantly changes and therefor we should also be constantly training/testing these changes.  Yes, all https was checked.  Yes, they read www.socialmediasecurity.com on a regular basis.  But they forgot to monitor their social media accounts like they would an email server.  There is still a core failure in my opinion of Facebook pages.  Who?!? owns the data and when is it okay to monitor the admins personal accounts? Because these users of the pages still enjoy using Facebook for personal use. They do not apply the corporate rules to their personal accounts nor should they if that is how they live.  So, we are either forced to create fake accounts or all share one admin account.  Well with our testing we are still targeting the admins of these pages.  There are many many ways to gain access to their accounts and once in, we only have to create our own evil twin account to keep access.  Example: if Bob Alice is the admin of the page just create another Bob Alice and copy the information including the  profile imagine and allow this new user admin rights to the page.  Most common users will just think this is a Facebook glitch and it is showing their profile twice. But in reality it is a way for us to keep a constant admin account to this system.  If you maintain a Facebook page you know that admins just lose their rights to the page all the time out of the blue.  So constantly adding the same person is a regular process.  If the company was monitoring its data it would see these changes or see that there were in fact 2 different accounts attached to this page.  But we are not monitoring these accounts, yet. Social media security can be a full time job depending on the risk and frequency of the sites.   For more information feel free as always to email me.  info@unixbox.ws</p>

<p><a href="http://feedads.g.doubleclick.net/~a/P6_Eji5foYtOW1-kIXB1dxSbXV8/0/da"><img src="http://feedads.g.doubleclick.net/~a/P6_Eji5foYtOW1-kIXB1dxSbXV8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/P6_Eji5foYtOW1-kIXB1dxSbXV8/1/da"><img src="http://feedads.g.doubleclick.net/~a/P6_Eji5foYtOW1-kIXB1dxSbXV8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=VhXld5UWc-Y:M4mENWXBXbc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/VhXld5UWc-Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/11/13/taking-over-the-facebook-page-buy-now-button-part-2-of-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://socialmediasecurity.com/2011/11/13/taking-over-the-facebook-page-buy-now-button-part-2-of-2/</feedburner:origLink></item>
		<item>
		<title>Social Media Security Podcast 26 – Google +, New Facebook Privacy Controls, FBPwn Tool</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/gsu5I35YUx8/</link>
		<comments>http://socialmediasecurity.com/2011/09/20/social-media-security-podcast-26-google-new-facebook-privacy-controls-fbpwn-tool/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 13:37:02 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google +]]></category>
		<category><![CDATA[Podcasts]]></category>
		<category><![CDATA[fbpwn]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=6100</guid>
		<description><![CDATA[This is the 26th episode of the Social Media Security Podcast recorded September 8, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast: Google + Security and Privacy New Facebook Privacy Controls, what&#8217;s changed? New Tool: FBPwn- A cross-platform Java based Facebook profile [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2319" title="skull" src="http://socialmediasecurity.com/wp-content/uploads/2010/05/skull.jpg" alt="" width="104" height="102" />This is the 26th episode of the Social Media Security Podcast recorded September 8, 2011.  This episode was hosted by <a href="http://twitter.com/agent0x0">Tom Eston</a> and <a href="http://twitter.com/streetsec">Scott Wright</a>.  Below are the show notes, links to articles and news mentioned in the podcast:</p>
<ul>
<li><a href="http://lifehacker.com/5827683/a-guide-to-google+-privacy-and-information-control">Google + Security and Privacy</a></li>
<li>New Facebook Privacy Controls, <a href="http://www.aclu.org/blog/technology-and-liberty/aclu-guide-new-facebook-privacy-controls">what&#8217;s changed</a>?</li>
<li>New Tool: F<a href="http://code.google.com/p/fbpwn/">BPwn</a>- A cross-platform Java based Facebook profile dumper</li>
</ul>
<div>Please send any show feedback to <strong>feedback [aT] socialmediasecurity.com</strong> or comment below.  You can also call our voice mail box at <strong>1-613-693-0997</strong> if you have a question for our Q&amp;A section on the next episode.  <strong>You can also <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=329032812">subscribe to the podcast in iTunes</a> </strong>and <strong><a href="http://twitter.com/socialmediasec">follow us on Twitter</a></strong>.  Thanks for listening!</div>

<p><a href="http://feedads.g.doubleclick.net/~a/KcN8ukqhBUd0BkUFeyjY93LBKXs/0/da"><img src="http://feedads.g.doubleclick.net/~a/KcN8ukqhBUd0BkUFeyjY93LBKXs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KcN8ukqhBUd0BkUFeyjY93LBKXs/1/da"><img src="http://feedads.g.doubleclick.net/~a/KcN8ukqhBUd0BkUFeyjY93LBKXs/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=gsu5I35YUx8:8vv5rtIU6n4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/gsu5I35YUx8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/09/20/social-media-security-podcast-26-google-new-facebook-privacy-controls-fbpwn-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
			<enclosure url="http://socialmediasecurity.com/podpress_trac/feed/6100/0/SocialMediaSecurityPodcast_26.mp3" length="35791055" type="audio/mpeg" />
		<itunes:duration>0:29:47</itunes:duration>
		<itunes:subtitle>This is the 26th episode of the Social Media Security Podcast recorded September 8, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast:

Google + Security and [...]</itunes:subtitle>
		<itunes:summary>This is the 26th episode of the Social Media Security Podcast recorded September 8, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast:

Google + Security and Privacy
New Facebook Privacy Controls, what’s changed?
New Tool: FBPwn- A cross-platform Java based Facebook profile dumper

Please send any show feedback to feedback [aT] socialmediasecurity.com or comment below.  You can also call our voice mail box at 1-613-693-0997 if you have a question for our Q&amp;A section on the next episode.  You can also subscribe to the podcast in iTunes and follow us on Twitter.  Thanks for listening!</itunes:summary>
		<itunes:keywords>Facebook, Podcasts</itunes:keywords>
		<itunes:author>Social Media Security</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>no</itunes:block>
	<media:content url="http://socialmediasecurity.com/podpress_trac/feed/6100/0/SocialMediaSecurityPodcast_26.mp3" fileSize="35791055" type="audio/mpeg" /><feedburner:origLink>http://socialmediasecurity.com/2011/09/20/social-media-security-podcast-26-google-new-facebook-privacy-controls-fbpwn-tool/</feedburner:origLink></item>
		<item>
		<title>Implementing a robust Intranet that leverages social media technology</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/msV3djTH99g/VIEW+00000011+00000194</link>
		<comments>http://www.streetwise-security-zone.com/members/streetwise/blog/VIEW+00000011+00000194#00000194#comments</comments>
		<pubDate>Wed, 27 Jul 2011 12:16:24 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=5166</guid>
		<description><![CDATA[<img src="http://www.streetwise-security-zone.com/l1/streetwise/appdata/blog/00000194.jpg" border="0" vspace="5" hspace="5" align="left"> <p style="text-align: justify"><span style="font-size: small">For a while now, I have been keeping an eye out for technologies that might help organizations leverage social media securely, within an Intranet environment for business purposes. Recently, I came across a success story about the Canadian Medical Association&#8217;s recent implementation of a social Intranet using an out-of-the-box product by ThoughtFarmer. That article (posted on the ThoughtFarmer blog) tapped the CMA project leader, Tanis Roadhouse, for tips on some of the key points in her blue-print for the CMA site&#8217;s implementation. So, I decided to check into the story.</span><br /><br /><span style="font-size: small">The article showed that Tanis, while not being a life-long IT project leader, was pretty well organized, and showed some thought leadership. Here&#8217;s a summary of her 7-point blue-print for building a social intranet:</span></p>
<ol>
<li><em><span style="font-size: small">Start with an inspiring vision: the value of a collaborative culture</span></em></li>
<li><em><span style="font-size: small">Secure executive support</span></em></li>
<li><em><span style="font-size: small">Pick a name that matters</span></em></li>
<li><em><span style="font-size: small">Gather requirements to learn the business</span></em></li>
<li><em><span style="font-size: small">Partner with IT early</span></em></li>
<li><em><span style="font-size: small">Treat content owners like royalty</span></em></li>
<li><em><span style="font-size: small">Embrace continuous improvement</span></em></li>
</ol>
<p style="text-align: justify"><span style="font-size: small">Click <a title="ThoughtFarmer Blog: Real Intranet Managers - Tanis Roadhouse's Blueprint for Building a Social Intranet" href="http://www.thoughtfarmer.com/blog/2011/07/12/real-intranet-managers-tanis-roadhouse-blueprint-building-social-intranet/">HERE</a> for the entire article.</span></p>
<p style="text-align: justify"><span style="font-size: small">For each point, the article provides some detailed explanations. I followed up with Tanis via Twitter to see where Risk Management and IT Security fit in, since they weren&#8217;t explicitly listed in the explanations. For the most part, she said they addressed these issues in the IT liaison step.</span></p>
<p style="text-align: justify"><span style="font-size: small">Tanis did mention (over Twitter) that, because the organization is heavily oriented toward finance, a Risk Assessment was performed in order to protect client data. The assessment concluded that there was, &#8220;Limited risk, as it is an Intranet site&#8221;, and that &#8220;Risk to clients was reduced through governance policies.&#8221;</span></p>
<p style="text-align: justify"><span style="font-size: small">I should point out here that you can not infer that an intranet site will be secure simply because you have good governance policies. Any organization that takes on any IT project that will be deployed on their network (internal or external) should do a thorough risk assessment, and use its recommendations to strengthen any identified vulnerabilities. This may result in strengthening policies, technical safeguards, procedures, personnel screening, roles and responsibilities or training. (Disclaimer: I harp on this stuff because it's a big part of what I do for my clients.)<br /></span></p>
<p style="text-align: justify"><span style="font-size: small">I think the lesson here is that organizations are starting to see value in using social media tools that they keep under their own control. In the early years of Facebook and Twitter, I saw some organizations embracing the publicly available tools to initiate internal collaboration, which was (and still is), generally a bad idea. This kind of thing led to hackers employing social engineering tactics to join &#8220;employee groups&#8221; and learn way too much about the vulnerabilities inside the company&#8217;s walls and networks, which of course, leads to data breaches.</span></p>
<p style="text-align: justify"><span style="font-size: small">Now, with some real implementations we can talk about, I&#8217;m hoping to get a closer look at how these tools can be deployed securely in an environment where you&#8217;re not sharing sensitive corporate data with 700 million of your closest friends (e.g. as would happen on Facebook).<br /></span></p>
<p style="text-align: justify"><span style="font-size: small">I should also mention that the ThoughtFarmer blog also seems to be a good source of thought leadership. Not only are they kindly publishing meaningful success stories, but they also demonstrate an understanding of how to use social media to help others think through their problems. One of their subsequent posts has a list of &#8220;81 Intranet Governance Questions to Ask Yourself.&#8221; (Click <a title="ThoughtFarmer Blog: 81 Intranet Governance Questions to Ask Yourself" href="http://www.thoughtfarmer.com/blog/2011/07/25/81-intranet-governance-questions-to-ask-yourself/">HERE</a>)</span></p>
<p style="text-align: justify"><span style="font-size: small">I&#8217;m encouraged by this kind of leadership, both in the vendor community (as demonstrated by ThoughtFarmer) and among the project initiators like Tanis. I hope to follow their progress in the future and share any tips I learn with you.</span></p><p><em>Would your organization be interested in obtaining the right to use my security awareness eLearning content or articles in your enterprise security program? Or would you like help with strategy, risk assessment, program development or training? Please call or email me at the coordinates below...</em><em></em></p>
<p><em><strong>Scott Wright</strong></em></p>
<p><span style="font-size: x-small">The  Streetwise Security Coach</span></p>
<p>Join the Streetwise Security Zone at:<a title="Join the Streetwise  Security Zone" href="http://www.streetwise-security-zone.com/join.html"><br />http://www.streetwise-security-zone.com/join.html</a></p>
<p>Phone: 1-613-693-0997<br />Email: scott@streetwise-security-zone.com<br />Twitter  ID: <a href="http://www.twitter.com/streetsec">http://www.twitter.com/streetsec</a></p>
<p><span style="font-size: x-small"><span style="font-family: times new roman,times">To receive weekly security tips and other notices about helpful content available on this site, please make sure you are on my list by clicking <a title="Free Weekly Streetwise Security Tips Newsletter Signup" href="http://www.streetwise-security-zone.com/members/streetwise/adminpages/weeklytips-signup">HERE</a>, and entering your name and email address.</span></span></p>
<p>&#160;</p>
<p>&#160;</p>
<p><!-- Site Meter --> <a href="http://s49.sitemeter.com/stats.asp?site=s49sw4sw" target="_top"> <img src="http://s49.sitemeter.com/meter.asp?site=s49sw4sw" border="0" alt="Site Meter" /></a> <!-- Copyright (c)2006 Site Meter --></p>
<p><a title="Web Analytics" href="http://getclicky.com/205013"><img src="http://static.getclicky.com/media/links/badge.gif" border="0" alt="Web Analytics" /></a> <img src="http://in.getclicky.com/205013ns.gif" alt=" " width="1" height="1" /></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.streetwise-security-zone.com/l1/streetwise/appdata/blog/00000194.jpg" alt="" align="left" border="0" hspace="5" vspace="5" /></p>
<p style="text-align: justify;"><span style="font-size: small;">For a while now, I have been keeping an eye out for technologies that might help organizations leverage social media securely, within an Intranet environment for business purposes. Recently, I came across a success story about the Canadian Medical Association’s recent implementation of a social Intranet using an out-of-the-box product by ThoughtFarmer. That article (posted on the ThoughtFarmer blog) tapped the CMA project leader, Tanis Roadhouse, for tips on some of the key points in her blue-print for the CMA site’s implementation. So, I decided to check into the story.</span></p>
<p><span style="font-size: small;">The article showed that Tanis, while not being a life-long IT project leader, was pretty well organized, and showed some thought leadership. Here’s a summary of her 7-point blue-print for building a social intranet:</span></p>
<ol>
<li><em><span style="font-size: small;">Start with an inspiring vision: the value of a collaborative culture</span></em></li>
<li><em><span style="font-size: small;">Secure executive support</span></em></li>
<li><em><span style="font-size: small;">Pick a name that matters</span></em></li>
<li><em><span style="font-size: small;">Gather requirements to learn the business</span></em></li>
<li><em><span style="font-size: small;">Partner with IT early</span></em></li>
<li><em><span style="font-size: small;">Treat content owners like royalty</span></em></li>
<li><em><span style="font-size: small;">Embrace continuous improvement</span></em></li>
</ol>
<p style="text-align: justify;"><span style="font-size: small;">Click <a title="ThoughtFarmer Blog: Real Intranet Managers - Tanis Roadhouse's Blueprint for Building a Social Intranet" href="http://www.thoughtfarmer.com/blog/2011/07/12/real-intranet-managers-tanis-roadhouse-blueprint-building-social-intranet/">HERE</a> for the entire article.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">For each point, the article provides some detailed explanations. I followed up with Tanis via Twitter to see where Risk Management and IT Security fit in, since they weren’t explicitly listed in the explanations. For the most part, she said they addressed these issues in the IT liaison step.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Tanis did mention (over Twitter) that, because the organization is heavily oriented toward finance, a Risk Assessment was performed in order to protect client data. The assessment concluded that there was, “Limited risk, as it is an Intranet site”, and that “Risk to clients was reduced through governance policies.”</span></p>
<p style="text-align: justify;"><span style="font-size: small;">I should point out here that you can not infer that an intranet site will be secure simply because you have good governance policies. Any organization that takes on any IT project that will be deployed on their network (internal or external) should do a thorough risk assessment, and use its recommendations to strengthen any identified vulnerabilities. This may result in strengthening policies, technical safeguards, procedures, personnel screening, roles and responsibilities or training. (Disclaimer: I harp on this stuff because it&#8217;s a big part of what I do for my clients.)<br />
</span></p>
<p style="text-align: justify;"><span style="font-size: small;">I think the lesson here is that organizations are starting to see value in using social media tools that they keep under their own control. In the early years of Facebook and Twitter, I saw some organizations embracing the publicly available tools to initiate internal collaboration, which was (and still is), generally a bad idea. This kind of thing led to hackers employing social engineering tactics to join “employee groups” and learn way too much about the vulnerabilities inside the company’s walls and networks, which of course, leads to data breaches.</span></p>
<p style="text-align: justify;"><span style="font-size: small;">Now, with some real implementations we can talk about, I’m hoping to get a closer look at how these tools can be deployed securely in an environment where you’re not sharing sensitive corporate data with 700 million of your closest friends (e.g. as would happen on Facebook).<br />
</span></p>
<p style="text-align: justify;"><span style="font-size: small;">I should also mention that the ThoughtFarmer blog also seems to be a good source of thought leadership. Not only are they kindly publishing meaningful success stories, but they also demonstrate an understanding of how to use social media to help others think through their problems. One of their subsequent posts has a list of “81 Intranet Governance Questions to Ask Yourself.” (Click <a title="ThoughtFarmer Blog: 81 Intranet Governance Questions to Ask Yourself" href="http://www.thoughtfarmer.com/blog/2011/07/25/81-intranet-governance-questions-to-ask-yourself/">HERE</a>)</span></p>
<p style="text-align: justify;"><span style="font-size: small;">I’m encouraged by this kind of leadership, both in the vendor community (as demonstrated by ThoughtFarmer) and among the project initiators like Tanis. I hope to follow their progress in the future and share any tips I learn with you.</span></p>

<p><a href="http://feedads.g.doubleclick.net/~a/3Ppl69kLqzdr6oFHHSmWPBzVmv4/0/da"><img src="http://feedads.g.doubleclick.net/~a/3Ppl69kLqzdr6oFHHSmWPBzVmv4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3Ppl69kLqzdr6oFHHSmWPBzVmv4/1/da"><img src="http://feedads.g.doubleclick.net/~a/3Ppl69kLqzdr6oFHHSmWPBzVmv4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=msV3djTH99g:_Jcw4pftPW0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/msV3djTH99g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/07/27/implementing-a-robust-intranet-that-leverages-social-media-technology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.streetwise-security-zone.com/members/streetwise/blog/VIEW+00000011+00000194#00000194</feedburner:origLink></item>
		<item>
		<title>Social Media Security Podcast 25 – Facebook Security Updates, FaceNiff, Social Media Background Checks</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/P1ihs1DD4Ho/</link>
		<comments>http://socialmediasecurity.com/2011/07/12/social-media-security-podcast-25-facebook-security-updates-faceniff-social-media-background-checks/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 14:14:51 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Podcasts]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[faceniff]]></category>
		<category><![CDATA[firesheep]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[netflix]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[scott]]></category>
		<category><![CDATA[socialmedia]]></category>
		<category><![CDATA[socialnetworking]]></category>
		<category><![CDATA[socnetsec]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tom]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=4894</guid>
		<description><![CDATA[This is the 25th episode of the Social Media Security Podcast recorded July 1, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast: LinkedIn SSL Leaves Accounts Vulnerable to Hijacking Facebook adds two-factor authentication, other new security features Facebook facial recognition. [...]]]></description>
			<content:encoded><![CDATA[<div><img class="alignright size-full wp-image-2319" title="skull" src="http://socialmediasecurity.com/wp-content/uploads/2010/05/skull.jpg" alt="" width="104" height="102" />This is the 25th episode of the Social Media Security Podcast recorded July 1, 2011.  This episode was hosted by <a href="http://twitter.com/agent0x0">Tom Eston</a> and <a href="http://twitter.com/streetsec">Scott Wright</a>.  Below are the show notes, links to articles and news mentioned in the podcast:</div>
<div></p>
<ul>
<li><a href="https://www.infosecisland.com/blogview/13917-LinkedIn-SSL-Leaves-Accounts-Vulnerable-to-Hijacking.html">LinkedIn SSL Leaves Accounts Vulnerable to Hijacking</a></li>
<li><a href="http://www.csoonline.com/article/680114/facebook-adds-two-factor-authentication-other-new-security-features">Facebook adds two-factor authentication, other new security features</a></li>
<li><a href="http://nakedsecurity.sophos.com/2011/06/07/facebook-privacy-settings-facial-recognition-enabled/">Facebook facial recognition</a>. How it <a href="http://facebookprivacyandsecurity.wordpress.com/2011/06/10/facebook-facial-recognition-how-it-looks-fact-and-myth-and-how-we-would-fix-the-problems/">looks, fact and myth, and how we would fix the problems.</a></li>
<li>Firesheep for Android Phones (<a href="http://faceniff.ponury.net/">FaceNiff</a>)</li>
<li>LinkedIn, Foursquare and Netflix on Android <a href="http://phandroid.com/2011/06/09/linkedin-foursquare-and-netflix-on-android-store-your-passwords-in-unencryped-text-files/">Store Your Passwords in Unencryped Text Files</a></li>
<li><a href="http://gizmodo.com/5813829/if-you-agree-to-a-social-media-background-check-your-public-info-could-sit-in-a-file-for-7-years">Social Media Background Checks</a></li>
</ul>
<p>Please send any show feedback to <strong>feedback [aT] socialmediasecurity.com</strong> or comment below.  You can also call our voice mail box at <strong>1-613-693-0997</strong> if you have a question for our Q&amp;A section on the next episode.  <strong>You can also <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=329032812">subscribe to the podcast in iTunes</a> </strong>and <strong><a href="http://twitter.com/socialmediasec">follow us on Twitter</a></strong>.  Thanks for listening!</p>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/p08n2m_hn9eN25nuaQSQ7kdojkw/0/da"><img src="http://feedads.g.doubleclick.net/~a/p08n2m_hn9eN25nuaQSQ7kdojkw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/p08n2m_hn9eN25nuaQSQ7kdojkw/1/da"><img src="http://feedads.g.doubleclick.net/~a/p08n2m_hn9eN25nuaQSQ7kdojkw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=P1ihs1DD4Ho:KfbEm4KbcoY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/P1ihs1DD4Ho" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/07/12/social-media-security-podcast-25-facebook-security-updates-faceniff-social-media-background-checks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
			<enclosure url="http://socialmediasecurity.com/podpress_trac/feed/4894/0/SocialMediaSecurityPodcast_25.mp3" length="42779855" type="audio/mpeg" />
		<itunes:duration>0:35:37</itunes:duration>
		<itunes:subtitle>This is the 25th episode of the Social Media Security Podcast recorded July 1, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast:


LinkedIn SSL Leaves Accoun[...]</itunes:subtitle>
		<itunes:summary>This is the 25th episode of the Social Media Security Podcast recorded July 1, 2011.  This episode was hosted by Tom Eston and Scott Wright.  Below are the show notes, links to articles and news mentioned in the podcast:


LinkedIn SSL Leaves Accounts Vulnerable to Hijacking
Facebook adds two-factor authentication, other new security features
Facebook facial recognition. How it looks, fact and myth, and how we would fix the problems.
Firesheep for Android Phones (FaceNiff)
LinkedIn, Foursquare and Netflix on Android Store Your Passwords in Unencryped Text Files
Social Media Background Checks

Please send any show feedback to feedback [aT] socialmediasecurity.com or comment below.  You can also call our voice mail box at 1-613-693-0997 if you have a question for our Q&amp;A section on the next episode.  You can also subscribe to the podcast in iTunes and follow us on Twitter.  Thanks for listening!
</itunes:summary>
		<itunes:keywords>Podcasts</itunes:keywords>
		<itunes:author>Social Media Security</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>no</itunes:block>
	<media:content url="http://socialmediasecurity.com/podpress_trac/feed/4894/0/SocialMediaSecurityPodcast_25.mp3" fileSize="42779855" type="audio/mpeg" /><feedburner:origLink>http://socialmediasecurity.com/2011/07/12/social-media-security-podcast-25-facebook-security-updates-faceniff-social-media-background-checks/</feedburner:origLink></item>
		<item>
		<title>How to easily create a much stronger password than you need to thwart a brute force attack</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/Wt8ySNh7xm4/VIEW+00000011+00000188</link>
		<comments>http://www.streetwise-security-zone.com/members/streetwise/blog/VIEW+00000011+00000188#00000188#comments</comments>
		<pubDate>Wed, 08 Jun 2011 01:14:23 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=4285</guid>
		<description><![CDATA[<p style="text-align: justify"><span style="font-size: small">If you have been struggling with the problem of how to keep passwords strong, yet memorable, we may have a simple answer for you. In the Security Now Podcast (episode 303) this week, Steve Gibson presents a very interesting analysis on what makes a good password these days. He calls it Password Haystacks, and there is a pretty simple solution to having to remember strong passwords.</span><br /><br /><span style="font-size: small">Steve's conclusions are very compatible with my usual prefered strategy for choosing passwords - like using the first characters from a song or movie quote, and adding some special characters and numbers. But his advice is interesting about how simple the basic password root can be, and how to easily make it much stronger. It's pretty cool and simple.</span><br /><br /><span style="font-size: small">The bottom line is that by adding length to a good, short password (regardless of whether or not they are repeated characters or patterns) you will massively improve resistance to a brute force attack. This is because today's attacker doesn't know how long the password is, for sure, and will always start with the easy dictionary words and patterns, and then they will move to the shortest possible character combinations in a brute force attack, followed by the next shortest combinations, and so on...&#160;</span></p>
<p style="text-align: justify"><span style="font-size: small">As an example, using this logic, a 23 character random password is not "usefully" stronger than a 3 character random password with 21 repeated characters.&#160; </span></p>
<p style="text-align: justify"><span style="font-size: small">There are some minor caveats in using this approach, to keep the passwords strong, such as having at least one lower, one upper case, one number and one special character in the root of the password. The rest of the characters don't really matter, as long as you don't reveal what pattern you use in the repeated characters or patterns. </span></p>
<p style="text-align: justify"><span style="font-size: small">For example "..B.o.B.........." is a pretty good password, since it would take at least 2 billion centuries with massive cracking array scenario to go through all combinations. So, you don't need a very long song title or movie phrase. You simply need to keep your simple pattern or strategy a secret.<br /></span></p>
<p style="text-align: justify"><span style="font-size: small">The Security Now podcast episode (in text or audio format) where the rationale for this approach is described is at the following link:<br /></span></p>
<p style="text-align: justify"><span style="font-size: small"><a title="Security Now Episode 303 - Password Haystacks" href="http://www.grc.com/securitynow.htm">http://www.grc.com/securitynow.htm</a> (look for Episode 303)</span><br /><br /><span style="font-size: small">Steve also has a web page that analyzes passwords in terms of how long a given password can be expected to stand up to various brute force attacks. You don't have to enter your real password, but try entering something that has the same length, and number of upper, lower case, numbers and special characters as your real password, and see how long it would take an attacker to try all combinations using a brute force approach.</span> <br /><br /><a href="http://www.grc.com/haystack.htm"><span style="font-size: small">http://www.grc.com/haystack.htm</span></a><br /><br /><span style="font-size: small"><span style="font-size: small">If you aren't convinced, or if you want to learn more, post a question or comment below.</span></span></p>
<p style="text-align: justify"><span style="font-size: small">Something to ponder...</span><br /><br /><span style="font-size: small">- Scott</span></p><p><em>I am now offering monthly briefings, tailored to organizations that want to build and sustain security awareness for staff. Just because your security team is too busy to do its own training and awareness doesn't mean you can't have an economical way to address human security risks. Please call or email me at the coordinates below...</em><em></em></p>
<p><em><strong>Scott Wright</strong></em></p>
<p><span style="font-size: x-small">The Streetwise Security Coach</span></p>
<p>Join the Streetwise Security Zone at:<a title="Join the Streetwise  Security Zone" href="http://www.streetwise-security-zone.com/join.html"><br />http://www.streetwise-security-zone.com/join.html</a></p>
<p>Phone: 1-613-693-0997<br />Email: scott@streetwise-security-zone.com<br />Twitter ID: <a href="http://www.twitter.com/streetsec">http://www.twitter.com/streetsec</a></p>
<p><span style="font-size: x-small"><span style="font-family: times new roman,times">To receive weekly security tips and other notices about helpful content available on this site, please make sure you are on my list by clicking <a title="Free Weekly Streetwise Security Tips Newsletter Signup" href="http://www.streetwise-security-zone.com/members/streetwise/adminpages/weeklytips-signup">HERE</a>, and entering your name and email address.</span></span></p>
<p>&#160;</p>
<p>&#160;</p>
<p><!-- Site Meter --> <a href="http://s49.sitemeter.com/stats.asp?site=s49sw4sw" target="_top"> <img src="http://s49.sitemeter.com/meter.asp?site=s49sw4sw" alt="Site Meter" border="0" /></a> <!-- Copyright (c)2006 Site Meter --></p>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><span style="font-size: small;">If you have been struggling with the problem of how to keep passwords strong, yet memorable, we may have a simple answer for you. In the Security Now Podcast (episode 303) this week, Steve Gibson presents a very interesting analysis on what makes a good password these days. He calls it Password Haystacks, and there is a pretty simple solution to having to remember strong passwords.</span></p>
<p><span style="font-size: small;">Steve&#8217;s conclusions are very compatible with my usual prefered strategy for choosing passwords &#8211; like using the first characters from a song or movie quote, and adding some special characters and numbers. But his advice is interesting about how simple the basic password root can be, and how to easily make it much stronger. It&#8217;s pretty cool and simple.</span></p>
<p><span style="font-size: small;">The bottom line is that by adding length to a good, short password (regardless of whether or not they are repeated characters or patterns) you will massively improve resistance to a brute force attack. This is because today&#8217;s attacker doesn&#8217;t know how long the password is, for sure, and will always start with the easy dictionary words and patterns, and then they will move to the shortest possible character combinations in a brute force attack, followed by the next shortest combinations, and so on&#8230;&nbsp;</span></p>
<p style="text-align: justify;"><span style="font-size: small;">As an example, using this logic, a 23 character random password is not &#8220;usefully&#8221; stronger than a 3 character random password with 21 repeated characters.&nbsp; </span></p>
<p style="text-align: justify;"><span style="font-size: small;">There are some minor caveats in using this approach, to keep the passwords strong, such as having at least one lower, one upper case, one number and one special character in the root of the password. The rest of the characters don&#8217;t really matter, as long as you don&#8217;t reveal what pattern you use in the repeated characters or patterns. </span></p>
<p style="text-align: justify;"><span style="font-size: small;">For example &#8220;..B.o.B&#8230;&#8230;&#8230;.&#8221; is a pretty good password, since it would take at least 2 billion centuries with massive cracking array scenario to go through all combinations. So, you don&#8217;t need a very long song title or movie phrase. You simply need to keep your simple pattern or strategy a secret.<br /></span></p>
<p style="text-align: justify;"><span style="font-size: small;">The Security Now podcast episode (in text or audio format) where the rationale for this approach is described is at the following link:<br /></span></p>
<p style="text-align: justify;"><span style="font-size: small;"><a title="Security Now Episode 303 - Password Haystacks" href="http://www.grc.com/securitynow.htm">http://www.grc.com/securitynow.htm</a> (look for Episode 303)</span></p>
<p><span style="font-size: small;">Steve also has a web page that analyzes passwords in terms of how long a given password can be expected to stand up to various brute force attacks. You don&#8217;t have to enter your real password, but try entering something that has the same length, and number of upper, lower case, numbers and special characters as your real password, and see how long it would take an attacker to try all combinations using a brute force approach.</span> </p>
<p><a href="http://www.grc.com/haystack.htm"><span style="font-size: small;">http://www.grc.com/haystack.htm</span></a></p>
<p><span style="font-size: small;"><span style="font-size: small;">If you aren&#8217;t convinced, or if you want to learn more, post a question or comment below.</span></span></p>
<p style="text-align: justify;"><span style="font-size: small;">Something to ponder&#8230;</span></p>
<p><span style="font-size: small;">- Scott</span></p>
<p><em>I am now offering monthly briefings, tailored to organizations that want to build and sustain security awareness for staff. Just because your security team is too busy to do its own training and awareness doesn&#8217;t mean you can&#8217;t have an economical way to address human security risks. Please call or email me at the coordinates below&#8230;</em><em></em></p>
<p><em><strong>Scott Wright</strong></em></p>
<p><span style="font-size: x-small;">The Streetwise Security Coach</span></p>
<p>Join the Streetwise Security Zone at:<a title="Join the Streetwise  Security Zone" href="http://www.streetwise-security-zone.com/join.html"><br />http://www.streetwise-security-zone.com/join.html</a></p>
<p>Phone: 1-613-693-0997<br />Email: scott@streetwise-security-zone.com<br />Twitter ID: <a href="http://www.twitter.com/streetsec">http://www.twitter.com/streetsec</a></p>
<p><span style="font-size: x-small;"><span style="font-family: times new roman,times;">To receive weekly security tips and other notices about helpful content available on this site, please make sure you are on my list by clicking <a title="Free Weekly Streetwise Security Tips Newsletter Signup" href="http://www.streetwise-security-zone.com/members/streetwise/adminpages/weeklytips-signup">HERE</a>, and entering your name and email address.</span></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><!-- Site Meter --> <a href="http://s49.sitemeter.com/stats.asp?site=s49sw4sw" > <img src="http://s49.sitemeter.com/meter.asp?site=s49sw4sw" alt="Site Meter" border="0" /></a> <!-- Copyright (c)2006 Site Meter --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/FgH972iRXgX4wGyOYgqaPgSDKSE/0/da"><img src="http://feedads.g.doubleclick.net/~a/FgH972iRXgX4wGyOYgqaPgSDKSE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FgH972iRXgX4wGyOYgqaPgSDKSE/1/da"><img src="http://feedads.g.doubleclick.net/~a/FgH972iRXgX4wGyOYgqaPgSDKSE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=Wt8ySNh7xm4:QBJDU9s-oY0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/Wt8ySNh7xm4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/06/07/how-to-easily-create-a-much-stronger-password-than-you-need-to-thwart-a-brute-force-attack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.streetwise-security-zone.com/members/streetwise/blog/VIEW+00000011+00000188#00000188</feedburner:origLink></item>
		<item>
		<title>Taking over the Facebook Page “buy now” button (Part 1 of 2)</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/VJ5bqGpzeXI/</link>
		<comments>http://socialmediasecurity.com/2011/05/25/taking-over-the-facebook-page-buy-now-button-part-1-of-2/#comments</comments>
		<pubDate>Wed, 25 May 2011 16:40:56 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Social Networking]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=4144</guid>
		<description><![CDATA[As I have been testing the security settings of companies social media strategies, I have consistently noticed two things, marketing is desperately trying to find its ROI and IT/Security doesn&#8217;t even know they have a FB page.  I do agree that after a number of months, it is time to show the CFO that spending that insame amount of time [...]]]></description>
			<content:encoded><![CDATA[<p>As I have been testing the security settings of companies social media strategies, I have consistently noticed two things, marketing is desperately trying to find its ROI and IT/Security doesn&#8217;t even know they have a FB page.  I do agree that after a number of months, it is time to show the CFO that spending that insame amount of time on their social media sites is worth the payroll checks. Unfortunately, analytics alone have been a blurry way of making that compelling argument and can be defeated by saying, if, I had put those payroll checks into google&#8230;I could see our ROI in a nice neat report. This is one of the reasons that marketing is jumping head first into technologies like Shoutlet, payvment or <a title="Article on e-commerce apps." href="http://www.practicalecommerce.com/articles/2095-Six-Facebook-Applications-to-Sell-Your-Products">others</a> (FB E-commerce). Why not sell your items on your FB Page?  Your team has worked extremely hard to get thousands of new users to click follow/like. Ultimately, this is going to be the future of pages but because IT/Security is not involved in the social media process it also opens a HUGE GAPPING HOLE in your security policy and procedures. And of course here is your example:</p>
<p>The policy of company ACME is &#8220;no social networking allowed&#8221; on internal networks.  Sites are being blocked at the firewall with rules and enforced with a content filtering tool. IT/Security has done its job with social media, right? BUT an exception is made for Marketing because they are special people. A FB page was created as well as an E-Commerce app installed without consulting IT/Security. I know this because after taking over the FB page using our friends Cain and Able, I replaced just one of the &#8220;buy now&#8221; buttons to redirect it my site and used analytics to see how many people clicked this button.  Showing this to Director of IT he replied &#8220;I didn&#8217;t even know we had a FB Page.&#8221; Part two is coming&#8230;but I leave you with this..</p>
<p>Who is in charge of these buttons?  Have these tools been tested and approved by IT/Sec before you took the 6 mins to install on your facebook page? What permissions are you giving this solution? HEY! IT/Sec does your company have a FB page?  Have you seen it lately? Is it part of your compliance testing?</p>

<p><a href="http://feedads.g.doubleclick.net/~a/JLcw3rMANmvNf7yVE3ClEluQxaE/0/da"><img src="http://feedads.g.doubleclick.net/~a/JLcw3rMANmvNf7yVE3ClEluQxaE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/JLcw3rMANmvNf7yVE3ClEluQxaE/1/da"><img src="http://feedads.g.doubleclick.net/~a/JLcw3rMANmvNf7yVE3ClEluQxaE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=VJ5bqGpzeXI:kCnHF1-T1G8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/VJ5bqGpzeXI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/05/25/taking-over-the-facebook-page-buy-now-button-part-1-of-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://socialmediasecurity.com/2011/05/25/taking-over-the-facebook-page-buy-now-button-part-1-of-2/</feedburner:origLink></item>
		<item>
		<title>Firesheep’s Revenge</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/SVecKDXkazs/</link>
		<comments>http://socialmediasecurity.com/2011/05/02/firesheeps-revenge/#comments</comments>
		<pubDate>Tue, 03 May 2011 02:58:03 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google Buzz]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Social Networking]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[firesheep]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[jruffer]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[socialmedia]]></category>

		<guid isPermaLink="false">http://socialmediasecurity.com/?p=3873</guid>
		<description><![CDATA[No, this is not an article on the new version or even newly added super hero features for firesheep? #titlefail? Maybe but please read on then decide. I know firesheep has lost its shiny coin syndrome with most but the attack is still working quite well in the field.  While the readers/listeners have been doing [...]]]></description>
			<content:encoded><![CDATA[<p>No, this is not an article on the new version or even newly added super hero features for firesheep? #titlefail? Maybe but please read on then decide.</p>
<p>I know firesheep has lost its shiny coin syndrome with most but the attack is still working quite well in the field.  While the readers/listeners have been doing a good job of enabling secure browsing options in Twitter and Facebook, we still have a long way to go. Please keep spreading the word and keep pleading to social networking sites to enable secure browsing by default.  So, Why the &#8220;Firesheep&#8217;s Revenge&#8221; title?  Well these last month’s, a couple of us have been testing common social media monitoring (SMM) tools.  These tools are generally used by small businesses, internal marketing, or external marketing companies to help update social media accounts without the hassle of logging into every social networking site individually.  We have been testing these SSM&#8217;s and found that:</p>
<p><a href="http://hootsuite.com/dashboard#">http://hootsuite.com/dashboard#<br />
</a><a href="http://sproutsocial.com/dashboard">http://sproutsocial.com/dashboard<br />
</a><a href="http://standard.cotweet.com/channels">http://standard.cotweet.com/channels#</a></p>
<p>Are not using secure browsing by default, allowing us to hijack sessions.  What does this mean? Well by adding your social media accounts into these SMM tools, you are granting the tool permission or full control over that account(s). By gaining control over the tool we are bypassing all the hard work you did by enabling secure browsing in each of your twitter and facebook accounts.  Try explaining to the VP of Marketing that even though you checked the “defeat firesheep” box it still works. And not only will it work on Facebook/Twitter but now LinkedIn, Foursquare, ping.fm and Ning accounts all in one interface. Most of the time we were looking at full access to the corporations social media strategy. So, we are right back to where we started, teaching the user that security is usually the last thing on the mind of these rapid development firms. If you do not see the option of “secure browsing”, then please be careful of where you update your social media accounts. Ask your tool makers where this option is located.  If they do not have this option then maybe you should look for another tool.</p>
<p>James F. Ruffer III<br />
Unixbox<br />
@jruffer</p>

<p><a href="http://feedads.g.doubleclick.net/~a/JabVbyUhr0uTd2NXOlUd-RBA5XM/0/da"><img src="http://feedads.g.doubleclick.net/~a/JabVbyUhr0uTd2NXOlUd-RBA5XM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/JabVbyUhr0uTd2NXOlUd-RBA5XM/1/da"><img src="http://feedads.g.doubleclick.net/~a/JabVbyUhr0uTd2NXOlUd-RBA5XM/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=SVecKDXkazs:XALBoPLahTo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/SVecKDXkazs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://socialmediasecurity.com/2011/05/02/firesheeps-revenge/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://socialmediasecurity.com/2011/05/02/firesheeps-revenge/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
		<item>
		<title>Recent Facebook XSS Attacks Show Increasing Sophistication</title>
		<link>http://feedproxy.google.com/~r/SocialMediaSecurity/~3/7JEeNUPCSvQ/</link>
		<comments>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 19:37:22 +0000</pubDate>
		<dc:creator>feedback@socialmediasecurity.com</dc:creator>
				<category><![CDATA[Contributors]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[socnetsec]]></category>

		<guid isPermaLink="false">http://theharmonyguy.com/?p=1066</guid>
		<description><![CDATA[A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated. The first issue came [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, three separate cross-site scripting (XSS) vulnerabilities on Facebook sites were uncovered within a period of about 10 days. At least two of these holes were used to launch viral links or attacks on users &#8211; and it&#8217;s clear that attacks against Facebook users are becoming increasingly sophisticated.</p>
<p>The first issue came from a page on the mobile version of Facebook&#8217;s site. The interface was a prompt for posting stories to a user&#8217;s wall, and the parameter for the text of the prompt did not properly escape output. On March 28, a blogger identifying themselves as &#8220;Joy CrazyDaVinci&#8221; <a title="Autopost Spamming using Facebook Mobile XSS" href="http://blog.crazydavinci.net/2011/03/autopost-spamming-using-facebook-mobile-xss/">posted code</a> that demonstrated how the vulnerability could be used to spread viral links:<span id="more-1066"></span></p>
<blockquote><p>&lt;iframe id=&#8221;CrazyDaVinci&#8221; style=&#8221;display:none;&#8221;<br />
src=&#8221;http://m.facebook.com/connect/prompt_feed.php?display=wap&amp;user_message_prompt=&#8217;&lt;script&gt;window.onload=function(){document.forms[0].message.value=&#8217;<span style="color: red;">Just visited http://y.ahoo.it/gajeBA Wow.. cool! nice page dude!!!</span>&#8216;;document.forms[0].submit();}&lt;/script&gt;&#8221;&gt;&lt;/iframe&gt;</p>
</blockquote>
<p>This bit of HTML would be included in a viral page. The code sets the content of the wall post to a message that includes a link to a viral page, then submits the prompt automatically. Anyone clicking the link would get the same code executed on their account. The viral page could be used for malware distribution or phishing attacks, but in most cases where I saw this trick used, the page simply loaded advertisements or &#8220;offer spam&#8221;.</p>
<p>By the next day, several links were spreading virally and <a title="New XSS Facebook Worm Allows Automatic Wall Posts" href="http://www.symantec.com/connect/blogs/new-xss-facebook-worm-allows-automatic-wall-posts">caught the attention</a> of security researchers. Facebook moved quickly to patch the issue, and Crazy DaVinci issued <a title="Statement of Apology" href="http://blog.crazydavinci.net/2011/03/statement-of-apology/">an apology</a> for the example code, explaining that versions of it had actually been circulating for several days prior and that the demonstration was intended to push Facebook for a fix.</p>
<p>On April 3, another XSS problem <a title="Channel.facebook.com cross-site-scripting (XSS) vulnerability by Edgard Chammas" href="http://www.thehackernews.com/2011/04/channelfacebookcom-cross-site-scripting.html">came to light</a>, this time with a Facebook &#8220;channel&#8221; page used for session management. Both another security researcher and I had previously looked at this interface and found it properly escaped, so it&#8217;s likely a code update mistakenly changed the page&#8217;s behavior. Facebook again patched the problem soon after news of it spread.</p>
<p>I didn&#8217;t observe any viral exploitation of the second vulnerability in the wild, but after the first problem came to light, I noted that it was mostly used to submit a form already on the page for posting links. The payload made use of functionality within the vulnerable page, but XSS allows an attacker to do far more. I wondered when we might see a Facebook attack that made greater use of cross-site scripting&#8217;s potential.</p>
<h3>What a Difference a Space Makes</h3>
<p>I didn&#8217;t have to wait long. On April 7, I got word via Twitter of a Facebook app that had live XSS, but the app had disappeared before I got to see it in action. At first, I thought this was yet another case of XSS within the context of a Facebook app. But I soon found other version of the app which were still online, and I quickly realized this was actually an XSS problem with the Facebook Platform. Also, the XSS payload being used did much more than submit a form.</p>
<p>The attack used FBML-based Facebook apps, which render in the context of an apps.facebook.com page. Normally, Facebook filters code to prevent any scripts from directly modifying the page&#8217;s DOM, but the XSS problem gave attackers a bypass. When a user visited the app page, they would see what appeared to be a fairly benign page with a popular video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss.jpg"><img class="aligncenter size-medium wp-image-1067" title="Screenshot of XSS-based attack page." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss-471x400.jpg" alt="" width="471" height="400" /></a></p>
<p>Unlike many Facebook page scams, the promised video actually works &#8211; if you click play, the video will load and nothing unusual seems to happen. But as the code screenshot below reveals, that click does much more than load the video.</p>
<p><a href="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg"><img class="aligncenter size-full wp-image-1069" title="Screenshot of Facebook XSS code." src="http://theharmonyguy.com/wp-content/uploads/2011/04/bullypalxss2.jpg" alt="" width="471" height="176" /></a></p>
<p>When the page first loads, the &#8220;video&#8221; is actually just an image placeholder with a link. Part of the href parameter for that link is shown above. Note the space after the opening quotation mark &#8211; that&#8217;s where the XSS comes in. Normally, Facebook would block a link to a javascript: URL. Adding the space worked around Facebook&#8217;s filters, but the browser would still execute the rest of parameter.</p>
<p>According to Facebook, it turned out that some older code was using PHP&#8217;s built-in parse_url function to determine allowable URLs. For example, while parse_url(&#8220;javascript:alert(1)&#8221;) yields a scheme of &#8220;javascript&#8221; and a path of &#8220;alert(1)&#8221;, adding whitespace gives a different result: parse_url(&#8221; javascript:alert(1)&#8221;) does not return a scheme and has a path of &#8220;javascript:alert(1)&#8221;. Other PHP developers should take note of the difference if parse_url is being used in security-related code.</p>
<h3>A More Advanced Attack</h3>
<p>Clicking the link executed an inline script that in turn added a script element to the page. This loaded more code from a remote address and included several parameters in the GET request. The parameters set variables within the remote code that specified what video to load, what URLs to use for viral posts, and so on. Multiple Facebook apps and domains were used for the viral links, but the main script always came from the same host. This helped the attack persist, since blocking one site would not stop it and the central code was loaded dynamically.</p>
<p>The remote code handled actually loading the video, but also included a number of functions which make use of having script access in a facebook.com context. The script would set the user as attending spam events, invite friends to those events, &#8220;like&#8221; a viral link, and even send IMs to friends using Facebook Chat.</p>
<p>When I came across the attack, one block of code had been commented out, but one blogger <a title="Preliminary analysis of Facebook clickjacking (aprilfoolsprank)" href="http://ashishb.net/uncategorized/a-preliminary-analysis-of-facebook-clickjacking-aprilfoolsprank/">discovered a version of the attack</a> a few days prior and saw it in action. This part loaded a fake login form which actually sent the entered username and password to a log interface on the attacker&#8217;s server. (Remember, this phishing form would appear in the context of a page with typical Facebook chrome.) Since the attack page would load even if a user was not logged in to Facebook, this could have also been a way to make sure a session was available before launching the other functions.</p>
<p>Fake videos and viral links are nothing new on Facebook, but most of these scams tend to be fairly simple. In fact, it&#8217;s not hard to find forums where people offer boilerplate code for launching such schemes &#8211; much like the first XSS worm above which simply submitted a form. But the April XSS attack involved multiple domains, multiple user accounts, and multiple methods for spreading and hijacking user accounts. And it still only scratched the surface of what&#8217;s possible with an XSS vulnerability. I expect we&#8217;ll see more XSS-based attacks and more powerful payloads in the future.</p>
<h3>Postscript on Real-Time Research</h3>
<p>I came across the April attack late one afternoon as I was preparing to leave work&#8230; so I could present on XSS at a local OWASP meeting! Those following me on Twitter saw a somewhat frantic stream of tweets as I tried to find live examples of the attack and sorted through the code while closely watching the clock and wrapping up last-minute presentation details. Earlier this week, I did some searching to review information for this post, and I came across this article from eWEEK: &#8220;<a title="Facebook Bully Video Actually an XSS Exploit" href="http://www.eweek.com/c/a/Security/Facebook-Bully-Video-Actually-a-XSS-Exploit-121829/">Facebook Bully Video Actually an XSS Exploit</a>&#8220;.</p>
<p>I was a bit surprised by it, as I hadn&#8217;t known about it before and saw that it quoted me. I then realized it was quoting my tweets! I then read that I had &#8220;confirmed to eWEEK on Twitter&#8221; one aspect of the story. At first I was confused, but then remembered that during my flood of tweeting, another user had sent an @ reply asking about the very detail the story talked about. Checking that tweet again, I found out the question had come from the article&#8217;s author.</p>
<p>I relate all this not because any of it bothered me, simply because (1) I found it somewhat fascinating that a few quick Twitter updates could become the primary source for a news article and (2) I was humbled to realize that a few quick Twitter updates could become the primary source for a news article! While it&#8217;s great that a story can spread so fast, it was certainly gave me a reminder to be careful when discussing topics of interest on a public forum. But I&#8217;m glad I can do my part in helping raise awareness of online dangers, particular the implications of XSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/theharmonyguy?a=oktHDSCAKwM:w406MFk_aqQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/theharmonyguy?d=YwkR-u9nhCs" border="0"></img></a>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/xGtekrZCyCyocG2f67kylIRG9Qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SocialMediaSecurity?a=7JEeNUPCSvQ:w406MFk_aqQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SocialMediaSecurity?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SocialMediaSecurity/~4/7JEeNUPCSvQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://theharmonyguy.com/2011/04/21/recent-facebook-xss-attacks-show-increasing-sophistication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://feedproxy.google.com/~r/theharmonyguy/~3/oktHDSCAKwM/</feedburner:origLink></item>
	<media:credit role="author">Social Media Security</media:credit><media:rating>nonadult</media:rating><media:description type="plain">Social Media Security Podcast</media:description></channel>
</rss>

