<?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>Startup Security &#187; Authorization</title>
	<atom:link href="http://startupsecurity.info/blog/tag/authorization/feed/" rel="self" type="application/rss+xml" />
	<link>http://startupsecurity.info</link>
	<description>Security, for Startups</description>
	<lastBuildDate>Wed, 16 Dec 2009 18:42:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Twitter Security Fiesta Post-Mortem</title>
		<link>http://startupsecurity.info/blog/2009/01/06/twitter-security-fiesta-post-mortem/</link>
		<comments>http://startupsecurity.info/blog/2009/01/06/twitter-security-fiesta-post-mortem/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 19:15:59 +0000</pubDate>
		<dc:creator>Damon Cortesi</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Authorization]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Phishing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://startupsecurity.info/?p=138</guid>
		<description><![CDATA[Let&#8217;s all take a breath for a moment, shall we?

There. Now let&#8217;s take a look at the recent activity we saw on Twitter over the weekend into Monday. There were two distinct, very likely related events.

The Phish
On Saturday, Twitter was hit with a phishing attack. While the events surrounding that have been widely documented, there [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s all take a breath for a moment, shall we?</p>
<p><br class="spacer_" /><br class="spacer_" /></p>
<p>There. Now let&#8217;s take a look at the recent activity we saw on Twitter over the weekend into Monday. There were two distinct, very likely related events.</p>
<p><br class="spacer_" /></p>
<p><strong>The Phish</strong></p>
<p>On Saturday, Twitter was hit with a <a href="http://blog.twitter.com/2009/01/gone-phishing.html">phishing attack</a>. While the events surrounding that have been widely documented, there was an undercurrent of discussion from developers of third-party Twitter applications claiming that this was exactly why Twitter needed to implement <a href="http://oauth.net/">OAuth</a>. With the <a href="http://simonwillison.net/2009/Jan/2/adactio/">sale of a Twitter application</a> that had been around for one day and accumulated approximately 1,000 accounts, speculation was high that this phishing attack was a direct result of developers being &#8220;forced&#8221; to request user credentials to build their Twitter apps.</p>
<p>There are a couple things to address here. First is that OAuth is most definitely not a web application silver bullet and would not have prevented the phishing attack that occurred.</p>
<p><br class="spacer_" /></p>
<p>Plain and simple.</p>
<p><br class="spacer_" /></p>
<p>OAuth provides a secure manner for interacting with an application&#8217;s API. Phishing is an attempt to retrieve valid user credentials by spoofing or forging the target site. While Twitter users are admittedly lackadaisical with their account credentials (as seen with a test I performed earlier this year on a site called <a href="http://twitterawesomeness.com/">TwitterAwesomeness</a>), the fact is that this attack occurred because somebody created a legitimate looking Twitter login page and some users fell susceptible to the spoof.</p>
<p>For those looking for more details, there was some good discussion on the <a href="http://groups.google.com/group/twitter-development-talk/browse_frm/thread/cf7a0daf4ac61a9d?tvc=1">Twitter Development mailing list</a> if you can wade through the various misconceptions. Chris Messina actually has a fantastic blog post on <a href="http://factoryjoe.com/blog/2009/01/02/twitter-and-the-password-anti-pattern/">password usage and Twitter</a>. Unfortunately, there is still the <a href="http://www.louisgray.com/live/2009/01/hey-twitter-its-not-just-worm-its-app.html">misconception that OAuth would have fixed this</a> and prevented the worm from propagating. To address that &#8211; any application can spoof the Twitter home page. Once those credentials have been obtained, the attackers can automate the Twitter website in a <a href="http://support.microsoft.com/kb/167658">variety</a> of <a href="http://schf.uc.org/articles/2007/02/14/scraping-gmail-with-mechanize-and-hpricot">ways</a>.</p>
<p>While I agree that the pattern of password usage needs to change on Twitter, restricting application access is a different battle from educating users on preventing themselves from being victims of phishing attacks. Not to mention that chances are high that a web application vulnerability such as SQL Injection exists within the numerous third-party web applications that accept Twitter usernames and passwords. Ultimately, however, OAuth will be beneficial in locking down Twitter from an API and third-party application perspective.</p>
<p><br class="spacer_" /></p>
<p><strong>The Hack</strong></p>
<p>On Monday morning, there was a post indicating <a href="http://blog.twitter.com/2009/01/monday-morning-madness.html">Twitter had been &#8220;hacked&#8221;</a> and several high-profile accounts had been compromised and used to post <a href="http://flickr.com/photos/honan/sets/72157612150227775/">fake updates</a>. This is more of an operational issue, but may have been indirectly related to the ongoing phishing attacks if a staff member had been phished. Based on the Twitter blog post, it would appear as if the admin tools utilized by Twitter support staff are available externally and may even share Twitter account information. From a security operations point of view, this is a recipe for disaster. If possible, administrative functions should be logically separated from user activity. Twitter is rather fortunate this happened at the same time and that the attackers didn&#8217;t have more malicious or damaging ideas in mind.</p>
<p>This prank is simply the tip of the iceberg. While Twitter may be able to secure the admin tools, the site will continue to grow and the phishing attacks will continue to advance to take advantage of how Twitter is used. How so? Well many Twitter-folk utilize automatic-follow techniques so they don&#8217;t have to manage it. This means immediate acceptance into a larger network, even more so if you have somebody reply to you. Further, &#8220;re-tweeting&#8221; is a popular concept on Twitter to share links. Finally, any URL over 30 characters is automatically shortened by Twitter and many users do so manually or utilize client applications further obfuscating the destination site.</p>
<p><br class="spacer_" /></p>
<p><strong>A Little Perspective</strong></p>
<p>I urge those people pushing so hard for strong account controls on Twitter, to also direct their resources and energy towards more critical assets. With the <a href="http://www.internetworldstats.com/stats.htm">estimated Internet population</a> at nearly 1.5 billion people, Twitter&#8217;s population accounts for a minuscule fraction of that. Wells Fargo has <a href="http://en.wikipedia.org/wiki/Wells_Fargo">48 million customers</a>. Bank of America employed <a href="http://en.wikipedia.org/wiki/Bank_of_America">206,587 people in 2008</a>. Based on my <a href="http://tweetstats.com/twitter_stats">Twitter stats</a> service that records analysis of every update on Twitter, there were 358,691 distinct users that posted tweets on January 5 of this year. I would love to see more critical assets such as banks implement more secure authentication methods as well, and those user populations are even larger and more critical than our favorite micro-blogging site.</p>
<p><br class="spacer_" /></p>
<p><ins datetime="2009-01-07T05:04:09+00:00"><strong>Update:</strong></ins> Seems it was an unrelated <a href="http://blog.wired.com/27bstroke6/2009/01/professed-twitt.html">brute-force attempt that compromised Twitter&#8217;s Admin tools</a>. Interestingly enough, I&#8217;ve seen this functionality other places and noticed when I had a support ticket that the username was the same. It seems my hope that the systems were somehow logically separated was not to be realized. Oh, Twitter.</p>
<p>There were two failings here, which is why layered security is beneficial. </p>
<ol>
<li>A weak password was being used for a highly-privileged account</li>
<li>The administrative tools were exposed in such a way that an external attacker could continually attempt passwords and not be automatically locked out or noticed</li>
</ol>
<p>Yes. It is just a micro-blogging site. But when the President-elect is relying on it to get his message out and people are staking their reputations and businesses on it&#8230;it suddenly becomes more.</p>
<p>I fully believe that Twitter does realize this and we know they are working to address some of the more pressing issues. Yes it&#8217;s taking a &#8220;long time&#8221; and we can criticize all we want, but who&#8217;s really at fault here &#8211; Twitter for not prioritizing the security of what was originally conceived to be an <a href="http://flickr.com/photos/jackdorsey/182613360/">offline AIM status service</a>, or the developers for propagating what they knew was an inherently insecure method of authentication with only the dollar signs of success in their eyes. In my opinion, why bother throwing blame. Let&#8217;s work together towards building a more secure web 3.0. </p>
<p><br class="spacer_" /></p>
<p>&lt;/soapbox&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://startupsecurity.info/blog/2009/01/06/twitter-security-fiesta-post-mortem/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Private vs Public</title>
		<link>http://startupsecurity.info/blog/2008/10/24/private-vs-public/</link>
		<comments>http://startupsecurity.info/blog/2008/10/24/private-vs-public/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 05:11:15 +0000</pubDate>
		<dc:creator>Damon Cortesi</dc:creator>
				<category><![CDATA[Authorization]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Threat Modeling]]></category>

		<guid isPermaLink="false">http://startupsecurity.info/?p=46</guid>
		<description><![CDATA[Many social networking sites these days (most of which I could consider in the startup phase) have the concept of private and public accounts. In an attempt to appease those that may not want their daily activities indexed by the world, they set a simple flag that indicates the status of the account.
This is inherently [...]]]></description>
			<content:encoded><![CDATA[<p>Many social networking sites these days (most of which I could consider in the startup phase) have the concept of private and public accounts. In an attempt to appease those that may not want their daily activities indexed by the world, they set a simple flag that indicates the status of the account.</p>
<p><strong>This is inherently broken.</strong></p>
<p>Why do I make that statement? Because when there is no enforcement of that &#8220;private&#8221; data other than a database flag, it should be considered public. Let&#8217;s take one of our favorite examples, Twitter. A vulnerability in Twitter was recently announced (and subsequently patched) that <a href="http://valleywag.com/5068550/twitter-bug-reveals-friends+only-messages">revealed protected account&#8217;s messages</a>. The flaw here is simply that Twitter didn&#8217;t really consider this use case when writing the SQL query and forgot to account for protected accounts with a small SQL statement that probably looked like &#8220;<code>AND protected = 1</code>&#8220;. </p>
<p><strong>So why is this a problem?</strong></p>
<p>Because the application server always connects to the database server as the same user and it is the responsibility of the developers to not forget to account for protected accounts. Unfortunately, we as humans are fallible and while this practice continues, mistakes will be made.</p>
<p><strong>How can we fix this?</strong></p>
<p>There are several approaches, but I&#8217;ll talk about a couple. One relies on process, the other on technology.</p>
<ol>
<li><strong>Threat modeling, data flow and data classification</strong>
<p>This really should be done anyway, but there&#8217;s a process known as threat modeling where application developers, business owners and security personnel review an application and identify the data that flows through it, potential avenues of attack and the classification of said data, among various other things. Every application should have this concept of data flow and classification (public vs. private) and verify new code against this model during the development process.</p>
</li>
<li><strong>Build identity into the data layer</strong>
<p>More mature databases such as <a href="http://www.microsoft.com/SQL/default.mspx">Microsoft SQL</a> and <a href="http://www.oracle.com">Oracle</a> have various concepts of <a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/multisec.mspx" title="SQL 2005 row-level security">row</a>-<a href="http://www.sqlpass.org/LearningCenter/TechnicalArticles/articleType/ArticleView/articleId/11.aspx" title="SQL Server Row-Level Security Using Windows Groups">level</a> <a href="http://www.oracle.com/technology/deploy/security/oracle9ir2/pdf/VPD9ir2twp.pdf" title="Oracle Virtual Private Databases">security</a> where options exist to further limit access to data based on a combination of data classification labels and restrictive views. Combined with impersonation, this approach actually relies on the database to enforce privileges, rather than the developer. While I know views and the potential for row-level security exist on <a href="http://thelackthereof.org/TLT/2007.11.30/MySQL_Row_Level_Security" title="MySQL Row-Level Security">MySQL</a>, I don&#8217;t think they&#8217;re considered or used very often.</p>
</li>
</ol>
<p>The moral of the story is that your data may only be as &#8220;private&#8221; as the security awareness of the developer coding your SQL queries. </p>
<p>Oh, another topic I should talk about sometime is security through obscurity or other ineffective means. That link I posted to sqlpass.org? That &#8220;login&#8221; box is simply a CSS overlay that can be removed in about three steps using one of my favorite <a href="/tools/">tools</a>, <a href="https://addons.mozilla.org/firefox/addon/1843">Firebug</a>.</p>
<p><ins datetime="2008-10-25T05:19:13+00:00">Update</ins>: Somebody asked where they could find more resources about Threat Modeling. Microsoft is actually one of the best places for this and the <a href="http://msdn.microsoft.com/en-us/security/aa570413.aspx">Application Threat Modeling</a> page and <a href="http://blogs.msdn.com/threatmodeling/">Threat Modeling blog</a> provide hours of endless entertainment. They also have a fantastic <a href="http://www.microsoft.com/downloads/details.aspx?familyid=59888078-9daf-4e96-b7d1-944703479451&#038;displaylang=en">Threat Modeling Tool</a> that greatly helps the process. Free, no less! And they are apparently releasing an update soon. I&#8217;ve had the pleasure to work with Microsoft in the past and they are very dedicated to the Secure Development Lifecycle. (*I&#8217;ll ignore the peanut gallery&#8217;s comments about the recent out-of-band patch, but that actually is a good example of how well their process works*)</p>
]]></content:encoded>
			<wfw:commentRss>http://startupsecurity.info/blog/2008/10/24/private-vs-public/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
