<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web 2.1 &#187; OAuth</title>
	<atom:link href="http://web.2point1.com/tag/oauth/feed/" rel="self" type="application/rss+xml" />
	<link>http://web.2point1.com</link>
	<description>Tim Whitlock&#039;s home in the Blogohedron</description>
	<lastBuildDate>Thu, 13 May 2010 21:26:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OAuth 2.0</title>
		<link>http://web.2point1.com/2010/05/06/oauth-2/</link>
		<comments>http://web.2point1.com/2010/05/06/oauth-2/#comments</comments>
		<pubDate>Thu, 06 May 2010 20:52:16 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://web.2point1.com/?p=421</guid>
		<description><![CDATA[Off the back of all the recent Facebook changes I just read the OAuth 2.0 spec &#8211; it&#8217;s currently in a draft state, and according to this page, Facebook is currently the only implementation in the wild. This new spec attempts to pull together various authentication journeys rather than just the typical web app model. [...]]]></description>
			<content:encoded><![CDATA[<p>Off the back of all the recent Facebook changes I just read the <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2" target="_blank">OAuth 2.0 spec</a> &#8211; it&#8217;s currently in a draft state, and according to <a href="http://wiki.oauth.net/OAuth-2" target="_blank">this page</a>, Facebook is currently the only implementation in the wild. This new spec attempts to pull together various authentication journeys rather than just the typical web app model. This is a great news &#8211; It seems to accommodate many different situations across differing devices with different capabilities, while maintaining a good level of consistency.</p>
<p>You didn&#8217;t expect me to have only nice things to say, did you? There are a couple of things I have to question.<span id="more-421"></span></p>
<h3>It&#8217;s only a draft</h3>
<p>Despite this spec being a draft, Facebook (who are represented in the <a href="https://www.ietf.org/mailman/listinfo/oauth" target="_blank">working group</a>) have gone ahead and implemented it anyway. Although this is a step up from the non-standard methods they&#8217;ve employed to date, it does make me wonder. Will the spec be finalised according to their implementation? Will they change their implementation if the spec changes? Or will they end up going in separate directions? (think ECMAScript 4/ActionScript). As with my gripes about the <a href="http://web.2point1.com/2010/04/25/f8-and-the-open-graph/" target="_self">Open Graph</a>, how &#8220;open&#8221; are standards when we have self-interested corporations in the driving seat.</p>
<h3>Looser security for JavaScript clients</h3>
<p>The so-called <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-01#section-3.5.1" target="_blank">&#8220;user_agent&#8221; journey</a> serves the needs of front-end applications that don&#8217;t have access to a web server. (i.e. JavaScript only apps). This support comes at a cost to security because request signing is not required. (More to the point, signing would be redundant). The risk is a limited one &#8211; the &#8220;bearer tokens&#8221; must only be sent over SSL, so the worst you can do is take control of an app under the authentication of your own account. Still, I imagine it would be possible to post content that the app did not intend. (use your imagination!) My main gripe here is in justifying the trade off. The loosening of security is in favour of making apps easier to implement for more people &#8211; i.e. a Facebook business interest. I don&#8217;t think that&#8217;s a good enough reason to weaken the specification.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2010/05/06/oauth-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Beating noisy Twitter apps</title>
		<link>http://web.2point1.com/2009/11/29/beating-noisy-twitter-apps/</link>
		<comments>http://web.2point1.com/2009/11/29/beating-noisy-twitter-apps/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 12:25:51 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[viral]]></category>

		<guid isPermaLink="false">http://web.2point1.com/?p=269</guid>
		<description><![CDATA[I woke up this morning to the apparent viral spread of the TweetCloud app that unoriginally, but very nicely displays your most tweeted words of the year, or month, or .. you get the idea. Here&#8217;s mine -&#62;
If you&#8217;re impatient, you may wish to skip to the good bit.
Preamble
Now, how did this app manage such [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://web.2point1.com/wp-content/uploads/2009/11/tweetcloud.png"><img class="alignright size-full wp-image-271" title="tweetcloud" src="http://web.2point1.com/wp-content/uploads/2009/11/tweetcloud.png" alt="tweetcloud" width="234" height="188" /></a>I woke up this morning to the apparent viral spread of the TweetCloud app that unoriginally, but very nicely displays your most tweeted words of the year, or month, or .. you get the idea. Here&#8217;s mine -&gt;</p>
<p><span id="more-269"></span>If you&#8217;re impatient, you may wish to <a href="#goodbit">skip to the good bit</a>.</p>
<h3>Preamble</h3>
<p>Now, how did this app manage such spread when there are so many like it? <em>Possibly</em> because it tweets from your account when your results are ready. This is not uncommon and it can be a nice feature that I might recommend. With the difference that it should be a 100% opt-in feature. TweetCloud&#8217;s start button says &#8220;<em>make and tweet cloud</em>&#8220;, so it does warn you. But people don&#8217;t read &#8211; they click.</p>
<p>TweetCloud insists that you log in before you can use it. It uses OAuth for this which is good (+1 point). Doing this means it can make calls to the Twitter API within <em>your</em> hourly request limit, rather than exhaust its own. (useful if you&#8217;re not whitelisted). But the real reason you must authenticate with TweetCloud is so that it can update your status. When building an app you have to seriously justify asking the user to authenticate/register etc.. As a general rule, the user should see that this action is for their benefit, not yours.</p>
<p>Good examples of this done right would be:</p>
<ul>
<li><em>TwitPic</em>, which has a genuine use for tweeting on your behalf.</li>
<li><em>Canabalt</em>, a game where you <em>want</em> to share your score for social kudos.</li>
</ul>
<p>Both of these apps make the tweet opt-in <em>each</em> time.</p>
<p><a name="goodbit"></a></p>
<h3>The good bit</h3>
<p>While TweetCloud was busy generating the cloud (which took a minute or so) I dived off to my Twitter settings and revoked the permission I had granted the app. If you don&#8217;t know how to do this, it&#8217;s under &#8220;settings &gt; connections&#8221;, or here: <a href="http://twitter.com/account/connections" target="_blank">http://twitter.com/account/connections</a></p>
<p><a href="http://web.2point1.com/wp-content/uploads/2009/11/tweetrevoke.png"><img class="alignnone size-full wp-image-273" title="tweetrevoke" src="http://web.2point1.com/wp-content/uploads/2009/11/tweetrevoke.png" alt="tweetrevoke" width="517" height="217" /></a></p>
<p>As soon as you revoke this permission the app can no longer use the access key that it has obtained. It needs this for any API call that <em>must</em> be authenticated. <em>e.g.</em> getting your public timeline of tweets does not require authentication, whereas updating your status does.</p>
<p>Interestingly the cloud generation continued to churn away. This suggests that the app was actually paging through my timeline without even using authentication. i.e. making public API calls under its own rate limit.</p>
<p>Lo and behold, upon completion there was no tweet from my account.</p>
<p>I also decided to post my cloud as a <a href="http://twitpic.com/rfxe0" target="_blank">TwitPic</a>, just to say &#8230; well, you know.  TwitPic doesn&#8217;t use OAuth, which it should, but that&#8217;s another post.</p>
<p>A few other things to note about &#8220;connections&#8221;:</p>
<ul>
<li>When you grant access to an app, it can store its access key <strong>forever</strong>. i.e. Twitter don&#8217;t provide a key expiry feature like Facebook do. So you should revoke permissions from any app that you&#8217;ve stopped using.</li>
<li>My statistics from <a href="http://twitblock.org" target="_blank">TwitBlock</a> suggest that about 1% of people actually do this. (about 400 of 30,000 users have revoked my key)</li>
<li>Signing out of Twitter does not prevent the app using this access. An app with an access key can tweet from your account whenever it wants until you revoke</li>
<li>The read/write permission you can see is set by the app, not by you. Twitter doesn&#8217;t offer granular permissions like Facebook do</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2009/11/29/beating-noisy-twitter-apps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is Facebook Connect a phishing scam waiting to happen?</title>
		<link>http://web.2point1.com/2009/10/14/is-facebook-connect-a-phishing-scam-waiting-to-happen/</link>
		<comments>http://web.2point1.com/2009/10/14/is-facebook-connect-a-phishing-scam-waiting-to-happen/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 23:07:06 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[phishing]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://web.2point1.com/?p=192</guid>
		<description><![CDATA[Two things happened today that inspired me to write this post tonight.

A brief back-and-forth on Twitter with @kaigani where I outlandishly claimed that Facebook Connect is a phishing scam waiting to happen
The warning of another Twitter scam that typically exploits the layman&#8217;s inability to spot a fake URL.

Facebook and Twitter both offer authentication services arguably [...]]]></description>
			<content:encoded><![CDATA[<p>Two things happened today that inspired me to write this post tonight.</p>
<ol>
<li>A brief back-and-forth on Twitter with <a href="http://twitter.com/kaigani/status/4858023858" target="_blank">@kaigani</a> where I outlandishly claimed that Facebook Connect is a <a href="http://twitter.com/timwhitlock/status/4858148685" target="_blank">phishing scam waiting to happen</a></li>
<li>The warning of another <a href="http://mashable.com/2009/10/14/twitter-phishing-scam/" target="_blank">Twitter scam</a> that typically exploits the <em>layman</em>&#8217;s inability to spot a fake URL.</li>
</ol>
<p>Facebook and Twitter both offer authentication services <a href="http://en.wikipedia.org/wiki/Single_sign-on#Shared_Authentication_Schemes_which_are_not_Single_Sign-On" target="_blank">arguably</a> known as &#8220;single sign-on&#8221;. <a href="http://developers.facebook.com/connect.php" target="_blank">Facebook Connect</a> is a proprietary system, and Twitter offers a system based on the <a href="http://oauth.net/about" target="_blank">OAuth</a> standard. These services do something quite marvellous &#8211; They allow you to authenticate with a another website without the third party ever seeing your password. What&#8217;s makes it even more handy is that you&#8217;re probably already signed in to these popular services, so you may not need to enter your password at all. <strong>The problem is when you do</strong>.</p>
<p><span id="more-192"></span>If the <em>mother</em> service decides you aren&#8217;t logged in, it will have to present you with a username/password prompt just as if you were entering the main site. Here&#8217;s an example Facebook Connect popup:</p>
<p><img class="alignnone size-full wp-image-197" title="fbconnect_popup" src="http://web.2point1.com/wp-content/uploads/2009/10/fbconnect_popup.png" alt="fbconnect_popup" width="464" height="499" /></p>
<p>A complacent user is likely to fill in these credentials without checking whether this <em>page</em> belongs to Facebook. This is the classic <a href="http://en.wikipedia.org/wiki/Phishing" target="_blank">Phishing</a> model, and I would argue that it is made worse by the additional trust the user may place in this familiar system. Furthermore, some implementations present this dialogue in a overlay form where no address bar appears at all.</p>
<h4>There are various lines of defence available to the user at this point, and they are all in the browser.</h4>
<p><strong>1. The URL</strong><br />
Most phishing scams use <a href="http://en.wikipedia.org/wiki/Phishing#Link_manipulation" target="_blank">cleverly manipulated URLs</a> that can easily trick an untrained eye. The fact is that the address bar and the URL are (from an end-user perspective) quite technical aspects of using the Internet. These &#8220;connect&#8221; dialogues are prone to this problem, and to make it easier for the phishing gangs they don&#8217;t have to recreate the whole home page,  just one small window. Even for Internet professionals, an accurately copied design may provide little reason to glance at the address bar.</p>
<p><strong>2. The SSL Certificate<br />
</strong>In the unlikely event that hackers have infiltrated your ISP, you still have the server certificate to ensure the site is legit. Observant readers will notice that the above image does not show a secure page. This is a failing of the vendor and of Facebook. A secure page does exist for Facebook Connect [see below] but Facebook should not offer standard HTTP at all and in this example the vendor should have used the SSL version.</p>
<p><img class="alignnone size-full wp-image-201" title="fbconnect_popup_ssl_cert" src="http://web.2point1.com/wp-content/uploads/2009/10/fbconnect_popup_ssl_cert.png" alt="fbconnect_popup_ssl_cert" width="464" height="414" /></p>
<p>Twitter also fails to restrict their authentication screen exclusively to SSL. To make matters worse their SSL screen does not contain full identity information (see below). Many Twitter apps don&#8217;t use the SSL page, and in fact the application settings page for developers lists the OAuth service URLs as HTTP variants only.</p>
<p><img class="alignnone size-full wp-image-205" style="border: 1px solid black;" title="twitter_ssl_cert_crop" src="http://web.2point1.com/wp-content/uploads/2009/10/twitter_ssl_cert_crop.png" alt="twitter_ssl_cert_crop" width="427" height="298" /></p>
<h4>Is this a technology problem, or a human problem?</h4>
<p>These scams exploit ignorance and complacency &#8211; Two things that user-friendly web services like these can only perpetuate. All the cryptography magic and clever security models behind these services can&#8217;t actually prevent phishing scams, and as they become more common and more trusted, perhaps they just make phishing scams easier to pull off.</p>
<p>I&#8217;m not convinced these problems can be solved by technology; at least not by technology in the websites themselves.  I think this can only be solved by something that sits between the user and the trap &#8211; For example: the web browser, your ISP, or the HTTP protocol itself.</p>
<ul>
<li>Chrome and IE8 both offer a neat address bar feature where the host name is bolder than the rest of the URL making fake URLs much easier to spot;</li>
<li>Firefox has more obvious server certificate and identity information, makes more of song and dance about invalid certificates and shows the host name in the status bar;</li>
<li>Various browsers offer warnings of known scam URLs and no doubt many ISPs aid this effort</li>
</ul>
<p>However, these features still require education and awareness. Above all, any solution requires the attention of the complacent masses who just want to get on with their life and click &#8220;OK&#8221; until they get what they want.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2009/10/14/is-facebook-connect-a-phishing-scam-waiting-to-happen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OAuth Fail</title>
		<link>http://web.2point1.com/2009/07/28/oauth-fail/</link>
		<comments>http://web.2point1.com/2009/07/28/oauth-fail/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 22:34:27 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Fail]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2009/07/28/oauth-fail/</guid>
		<description><![CDATA[The day a thousand apps stool still
I noticed some weeks ago that Twitter&#8217;s OAuth implementation didn&#8217;t appear to be verifying signatures. I knew this because I purposefully set an invalid access token which was accepted unconditionally. I thought this was odd, but as a newbie to OAuth I was just happy that my app was [...]]]></description>
			<content:encoded><![CDATA[<h3>The day a thousand apps stool still</h3>
<p><strong>I noticed <a href="http://twitter.com/timwhitlock/status/2697185141" target="_blank">some weeks ago</a> that Twitter&#8217;s <a href="http://oauth.net/" target="_blank">OAuth</a> implementation didn&#8217;t appear to be verifying signatures</strong>. I knew this because I purposefully set an invalid access token which was accepted unconditionally. I thought this was odd, but as a newbie to OAuth I was just happy that my app was working, so I filed the problem at the back of my mind under &#8220;deal with it if it becomes a problem&#8221;. Today (the week I release by beloved <a href="http://twitblock.org/" target="_blank">TwitBlock</a> app) it very suddenly became a problem.</p>
<p><span id="more-126"></span>It seems that eventually they decided to fix the security hole, except they did it without telling anyone. In their defence this needed to be done quickly, and they were only going to be implementing what we all believed was already in place, namely the well-documented <a href="http://oauth.net/core/1.0a" target="_blank">OAuth standard</a>. The problem was that many people, including myself have publicly released apps that could never have been fully tested.</p>
<p>The damage was already done, i.e. broken apps in the public domain; but the clean up operation didn&#8217;t go well either. At the time of writing, no warning has been posted on <a href="http://status.twitter.com/" target="_blank">status.twitter.com</a>. The first we all knew about the change was broken apps, and disappointed users. A few threads popped up on <a href="http://groups.google.com/group/twitter-development-talk/browse_thread/thread/8d82abd005002ce0/a969b150d73f0c11">this Google Group</a> where devs banged their heads together to work out what was wrong with their code libraries. In my case I eventually tracked down the bug: The main cause of my broken library was that I was signing the full request URL complete with query string. This is incorrect, as <a href="http://oauth.net/core/1.0a#rfc.section.9.1.2" target="_blank">section.9.1.2</a> demonstrates. A bug that, if I&#8217;d been able to test properly in development, would not have made it into production.</p>
<h4>Twitter&#8217;s response</h4>
<p>Although I&#8217;ve not seen an official response, I did see a post on the afore-mentioned Google Group by one of the Twitter API developers. He admitted that they did not approach the situation as they should, but this post may have been deleted because I can no longer find it. I shall post it if I find it again.</p>
<h4>URL encoding bug</h4>
<p>Another bug (which was not actually the main problem) is that PHP&#8217;s rawurlencode function doesn&#8217;t quite fit the bill. <a href="http://oauth.net/core/1.0a#encoding_parameters" target="_blank">OAuth parameter encoding</a> implements RFC3986 whereas <a href="http://php.net/manual/en/function.rawurlencode.php" target="_blank">PHP&#8217;s rawurlencode function</a> implements RFC1738&#8230; the difference is that PHP will encode the &#8220;~&#8221; character. A simple fix is to retro decode the offending character, as follows:</p>
<pre class="code">function oauth_urlencode( $str ){
return str_replace('%7E', '~', rawurlencode($str) );
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2009/07/28/oauth-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
