<?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>Benlog &#187; identity</title>
	<atom:link href="http://benlog.com/articles/category/identity/feed/" rel="self" type="application/rss+xml" />
	<link>http://benlog.com</link>
	<description>security, privacy, transparency.</description>
	<lastBuildDate>Thu, 17 May 2012 17:09:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>BrowserID and me</title>
		<link>http://benlog.com/articles/2011/09/21/browserid-and-me/</link>
		<comments>http://benlog.com/articles/2011/09/21/browserid-and-me/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 22:27:54 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1769</guid>
		<description><![CDATA[A few weeks ago, I became Tech Lead on Identity and User Data at Mozilla. This is an awesome and challenging responsibility, and I&#8217;ve been busy. When I took on this new responsibility, BrowserID was already well under way, so &#8230; <a href="http://benlog.com/articles/2011/09/21/browserid-and-me/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I became Tech Lead on Identity and User Data at Mozilla. This is an awesome and challenging responsibility, and I&#8217;ve been busy. When I took on this new responsibility, <a href="https://browserid.org">BrowserID</a> was already well under way, so we were able to launch it in my second week on the project (early July). It&#8217;s been a very fun ride.</p>
<p>Here&#8217;s the BrowserID demo at the Mozilla All-Hands last week:</p>
<p><iframe width="640" height="360" src="http://www.youtube-nocookie.com/embed/6x45Nt1fOMM" frameborder="0" allowfullscreen></iframe></p>
<p>Given my prior work on email-based authentication (<a href="http://assets.adida.net/research/w2sp2008-emid.pdf">EmID</a>, <a href="http://assets.adida.net/research/lightweight-signatures-for-email.pdf">Lightweight Email Signatures</a>, <a href="http://assets.adida.net/research/beamauth-ccs2007.pdf">BeamAuth</a>), you might think BrowserID was my brainchild. In fact, it really wasn&#8217;t. And, in a testament to the shrinking impact of academic publication venues, none of the BrowserID team had ever heard of my work on email-based authentication before I arrived at Mozila, even though Mozilla folks are quite well versed in the state of the art. But who cares: when I found out about the ongoing work and how we agreed on just about every design principle, I was incredibly excited. And when I realized the fantastic work the team had already done on defining a scaffolding and adoption path for the technology, I was super impressed.</p>
<p>BrowserID started with the <a href="https://wiki.mozilla.org/Identity/Verified_Email_Protocol">Verified Email Protocol</a>, designed by <a href="http://www.open-mike.org/">Mike Hanson</a> and <a href="http://twitter.com/thunder">Dan Mills</a>, who came up with the approach after extensive exploration of web-based identity approaches over the last two years. It&#8217;s a simple idea: users can prove to web sites that they own a particular email address. That&#8217;s how they register, and that&#8217;s how they log back in the next time they visit the site. BrowserID, the code and site, was initially bootstrapped by <a href="http://lloyd.io/">Lloyd Hilaiel</a> and Mike Hanson. <a href="http://www.shanetomlinson.com/">Shane Tomlinson</a> and I joined the team in June. We now also have an awesome UX design team (Bryan and Andy) and the team continues to grow (yay Austin!)</p>
<p>So, that&#8217;s what I&#8217;m working on these days: BrowserID and other Identity+UserData efforts at Mozilla. I&#8217;m excited to be leading this technical effort. The team is amazing, and we&#8217;ve got big aggressive plans to help you control your identity and data on the Web.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2011/09/21/browserid-and-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>and the laws of physics changed</title>
		<link>http://benlog.com/articles/2011/07/03/and-the-laws-of-physics-changed/</link>
		<comments>http://benlog.com/articles/2011/07/03/and-the-laws-of-physics-changed/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 20:39:44 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=1758</guid>
		<description><![CDATA[Google just introduced Google Plus, their take on social networking. Unsurprisingly, Arvind has one of the first great reviews of its most important feature, Circles. Google Circles effectively let you map all the complexities of real-world privacy into your online &#8230; <a href="http://benlog.com/articles/2011/07/03/and-the-laws-of-physics-changed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Google just introduced <a href="http://plus.google.com">Google Plus</a>, their take on social networking. Unsurprisingly, Arvind has <a href="http://33bits.org/2011/07/03/google-and-privacy-a-roundup/">one of the first great reviews</a> of its most important feature, Circles. Google Circles effectively let you map all the complexities of real-world privacy into your online identity, and that&#8217;s simply awesome.</p>
<p>You can think of Circles as the actual circles of friends you have. The things that are easy to do in real life, like sharing a fun anecdote with the friends you generally go out with on Saturday nights, are easy to do in Circles. The things that are hard to do in real life, like planning your best friend&#8217;s surprise birthday party with all of his close friends but <em>without</em> him, are no easier in Circles: you have to make a new list of &#8220;everyone except Bob.&#8221; That&#8217;s great, because I don&#8217;t think our brains have evolved yet to really feel comfortable with a social model that supports all set operations, e.g. this circle <em>minus</em> this other circle. That&#8217;s usually how we get caught lying. (I mean the lies everyone tells as part of their normal social interactions.)</p>
<p>The most important point is that this feature shatters the previously universally accepted idea that privacy must change dramatically given social networking. For a few years, Facebook has defined the Laws of Physics of social networking. On Facebook, it&#8217;s not possible to show different people a different face. On Facebook, relationships are, for the most part, symmetrical. And so we all believed that this was the inevitable path forward with social networking. We conflated the fact that users wanted to connect online with the constraints that Facebook created, and we assumed users wanted those constraints. We forgot that software engineers define the Laws of Physics of the worlds they create. We weren&#8217;t living in the inherent world of social networking. We were living in Facebook&#8217;s definition of social networking.</p>
<p>We now know it doesn&#8217;t have to be this way. The Laws of Physics in the online world are mutable. Google just busted open a world of possibility. Users will question, now more than ever, why sharing must work the way it does on Facebook, given that Google has shown it can work differently.</p>
<p>It will make Facebook better. Which will make Google better. And so on. We may be witnessing the beginning of a new era of online privacy, a maturation of sorts. This is an incredibly exciting time.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2011/07/03/and-the-laws-of-physics-changed/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The evolution of OpenID: you&#8217;re not a URL after all</title>
		<link>http://benlog.com/articles/2009/09/09/the-evolution-of-openid-youre-not-a-url-after-all/</link>
		<comments>http://benlog.com/articles/2009/09/09/the-evolution-of-openid-youre-not-a-url-after-all/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 20:27:41 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=777</guid>
		<description><![CDATA[The US government has just announced a pilot program to integrate OpenID (and Information Cards) into public government web sites. This is very interesting news, as it will likely catalyze even greater OpenID deployment and use. [I've poo-poo'ed OpenID here &#8230; <a href="http://benlog.com/articles/2009/09/09/the-evolution-of-openid-youre-not-a-url-after-all/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The US government has just announced <a href="http://openid.net/2009/09/09/open-identity-for-the-government/">a pilot program to integrate OpenID</a> (and Information Cards) into public government web sites. This is very interesting news, as it will likely catalyze even greater OpenID deployment and use.</p>
<p>[I've poo-poo'ed OpenID <a href="http://benlog.com/articles/2007/07/03/facebook-platform-bad-login-practices-openid-doesnt-work/">here</a> and <a href="http://benlog.com/articles/2007/10/12/the-password-anti-pattern-and-the-login-redirection-anti-pattern/">here</a>, because of phishing and privacy concerns. I'm still very worried. I've suggested <a href="http://benlog.com/articles/2007/02/06/beamauth-two-factor-web-authentication-with-a-bookmark/">ways to defend OpenID against phishing</a>, and I helped <a href="http://benlog.com/articles/2008/12/05/openid-and-creative-commons/">Creative Commons deploy a privacy-conscious OpenID service</a>.]</p>
<p>What&#8217;s fascinating to me is the evolution of OpenID. The pitch used to be &#8220;log in with your URL.&#8221; The backend protocol was cool, but it didn&#8217;t really matter. Authentication was reduced to proving that you own a particular URL: I can prove that I control <tt>http://ben.adida.net</tt>, thus, for all intents and purposes, that URL is my identity. I *am* <tt>http://ben.adida.net</tt>. *How* I prove that I own that URL, that&#8217;s a good thing to define precisely, but it wasn&#8217;t central to the OpenID story.</p>
<p>A lot of folks, myself included, think URLs as human identifiers are not ideal. People aren&#8217;t used to them. They don&#8217;t provide a communication channel. It is awkward to type a URL into what is effectively a &#8220;username&#8221; box. Plus, if you give every site your URL, then multiple sites can correlate identities easily, and that&#8217;s probably not a good thing when all you really want is single sign-on.</p>
<p>So OpenID evolved. In version 2.0, instead of typing your full OpenID URL, you can just type the domain name of your provider, i.e. <tt>yahoo.com</tt>. Then, you get redirected to Yahoo, where you log in, and when you&#8217;re done, Yahoo provides a pseudonymous identifier to the third-party web site where you want to log in. And as it turns out, that&#8217;s exactly the mode of authentication that the government is requiring for its approved OpenID providers, because they don&#8217;t want the NIH and CDC to have the ability to correlate your activities across government services. (In passing&#8230; how refreshing to see this privacy concern come out of the US government!). So the NIH thinks you&#8217;re <tt>83nbxcvndfs34@google.com</tt> and the CDC thinks you&#8217;re <tt>j23nsnsblkjsdfl45@google.com</tt>. </p>
<p>My guess is that URLs as human identifiers are effectively dead. OpenID is now the <em>backend protocol</em>. Identifiers are pseudonyms, not public URLs.</p>
<p>I also suspect the next step is a communication channel for these pseudonyms: identity providers will give relying parties a way to send messages to the pseudonyms that logged into their sites, the same way Facebook lets apps notify its users. Something missing in your NIH grant application? The NIH will make an API call to Google saying &#8220;please deliver this note to user <tt>83nbxcvndfs34</tt>&#8221; and Google will forward it appropriately. (Maybe this feature already exists in OpenID 2.0 and I just don&#8217;t know about it?)</p>
<p>On the phishing front, OpenID providers will probably duke it out with various mitigating solutions. It would be nice if the OpenID standard tackled the issue, though.</p>
<p>On the privacy front, only the core OpenID protocol can help. I&#8217;d like to use my Google credentials to log in everywhere, but I don&#8217;t see why Google needs to look over my shoulder every time I log in to every weird site I visit. The only way to fix this is with cryptographic credentials. I don&#8217;t see that anywhere in the OpenID spec&#8217;s future, but without it, there are going to be deep privacy issues.</p>
<p>In the end, OpenID 2009 looks almost nothing like OpenID 2006. That&#8217;s okay, though. One lesson is that, in the end, the OpenID effort inspired and coalesced a number of disparate efforts to achieve an open-standard for web-based single sign-on. Though the solution has evolved significantly, OpenID has succeeded: we have an open web-based single sign-on system. Now, OpenID will have to deal with the consequences of its success. It will get attacked, a lot. Its issues with phishing and privacy will become greater concerns. It should be a fun ride.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2009/09/09/the-evolution-of-openid-youre-not-a-url-after-all/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Hash Secrets</title>
		<link>http://benlog.com/articles/2008/06/19/dont-hash-secrets/</link>
		<comments>http://benlog.com/articles/2008/06/19/dont-hash-secrets/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 01:34:16 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/?p=168</guid>
		<description><![CDATA[Building secure systems is difficult. It would be nice if we had a bunch of well-designed crypto building blocks that we could assemble in all sorts of ways and be certain that they would, no matter what, yield a secure &#8230; <a href="http://benlog.com/articles/2008/06/19/dont-hash-secrets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Building secure systems is difficult. It would be nice if we had a bunch of well-designed crypto building blocks that we could assemble in all sorts of ways and be certain that they would, no matter what, yield a secure system overall. There are, in fact, folks working on such things at a theoretical level [<a href="http://en.wikipedia.org/wiki/Universal_composability">Universal Composability</a>].</p>
<p>But even if you had these building blocks, you would still have to use them in their intended way. A component can only be secure <em>under certain well-defined circumstances</em>, not for <em>any</em> use that happens to look similar.</p>
<p>One area of secure protocol development that seems to consistently yield poor design choices is the use of hash functions. What I&#8217;m going to say is not 100% correct, but it is on the conservative side of correct, so if you follow the rule, you (probably) can&#8217;t go wrong. You might be considered overly paranoid, but as they say, just because you&#8217;re paranoid doesn&#8217;t mean they&#8217;re not after you.</p>
<p>So here it is: Don&#8217;t hash secrets. Never. No, sorry, I know you think your case is special but it&#8217;s not. No. Stop it. Just don&#8217;t do it. You&#8217;re making the cryptographers cry.</p>
<p>What the heck am I talking about, you say? I&#8217;ll explain. But before we get lost in the details, just remember. Don&#8217;t hash secrets. Ever. Kapish?</p>
<h4>What exactly do you mean by &#8220;Hash&#8221;?</h4>
<p>A hash function takes any document, big or small, and creates a short fingerprint. That gigabyte movie of your newborn baby? Hash it with SHA1, and you&#8217;ve got yourself a 160 bit (~30 alphanumeric characters) fingerprint. Now, hold on, you say, 30 characters? You&#8217;ve hashed my baby to pieces and all that&#8217;s left is a measly 30 characters? No, no, don&#8217;t worry, your baby is still a unique snowflake. You can&#8217;t take those 30 characters and, from them, recover your gigabyte video. This is not uber-data-compression.</p>
<p>But it&#8217;s going to be darn hard for you to find any other document, big or small, that hashes to the same 30 characters. In fact, it&#8217;s so hard, even the most powerful computer in the world dedicated to this one task for hundreds of years won&#8217;t succeed at finding that doppelganger document. You&#8217;ve got lots of computers you say? You&#8217;re Google and you have hundreds of thousands of computers? Yeah, well&#8230;. tough. You still won&#8217;t succeed.</p>
<p>In fact, you can try something that should be easier: rather than find another document that hashes specifically to those 30 characters that represent your baby, you can go looking for <em>any two</em> documents that happen to hash to the same thing (collide). And you won&#8217;t find any such pair. Promised. We call that &#8220;collision resistance&#8221;. That thing about how you can&#8217;t find another document that hashes to the same value as your baby video? We call that &#8220;second pre-image resistance.&#8221;</p>
<p>Oh, and I forgot to mention that this magical function, SHA1, is public. Anyone can see the code. There are no secrets. Even if you see the code, you can&#8217;t find a collision. No, really, I&#8217;m not screwing with you.</p>
<h4>I want to hash <u>everything</u>!</h4>
<p>That&#8217;s usually the reaction after discovering the amazing power of hash functions. There are all sorts of nails just waiting for this magical hammer, so let&#8217;s start hashing everything in sight. De-duplicating large documents? Hash and compare! Passwords in a database? Hash and store! Anonymizing names in a database? Hash and pseudonymize!</p>
<p>After all, the magical power of a hash function is that you can&#8217;t &#8220;go back,&#8221; right? Given a hash, it&#8217;s impossible to get that pre-image, so hash away, my magical crypto friends!</p>
<h4>Wrong.</h4>
<p>Yeah, so it&#8217;s not quite that magical.</p>
<p>Let&#8217;s say I give you a SHA1 hash value <tt>29b0d7c86b88565b78efffeea634cee81a209c92</tt>. From that hash alone, you can&#8217;t tell what I hashed. But if I tell you that I hashed a password, then all you need to do is try a bunch of common passwords and see which one matches. In this case, I hashed &#8220;love&#8221;, one of the most common passwords there is.</p>
<p>Now you start to see how this &#8220;you can&#8217;t go back&#8221; reasoning fails: if you know the domain of possible pre-images, and that domain is not too large, then you can just try them all and see which one matches. That&#8217;s a big strike against the &#8220;hash everything&#8221; approach.</p>
<h4>Sprinkle in some Salt</h4>
<p>It gets more interesting with the complete password use-case. Many web developers already know that they shouldn&#8217;t store user passwords in the clear in the database, just in case a break-in reveals every user&#8217;s password. So, instead of storing passwords in the clear, let&#8217;s store a SHA1 hash of the password, against which a candidate password can be easily checked: hash it and compare.</p>
<p>Now the web developers who have been around the block a few times know that, if you just apply SHA1 blindly, you&#8217;ve got the &#8220;small domain&#8221; problem I just mentioned. An attacker can build up a huge dictionary of hashed passwords just once, and, when he breaks into your web site, check the hashes against this pre-built dictionary.</p>
<p>To prevent these &#8220;dictionary attacks&#8221;, we add salt to the hashing process, so that each user&#8217;s password is hashed differently, and generic attacks don&#8217;t work: you have to rebuild the dictionary for <em>each</em> user you choose to attack. Sprinkling in salt is easy: just concatenate the password with a random string:</p>
<pre>
SHA1("TheAnswerIs42" || "love") = ce75a1c90ed564a231de85d93520f1e47726df64
</pre>
<p>Then, when a user types in a password, e.g. &#8220;lvoe&#8221; (a typo), the system checks:</p>
<pre>
SHA1("TheAnswerIs42" || "lvoe") = f832b210d62251c19a374a175bff760935c540d4
                               != ce75a1c90ed564a231de85d93520f1e47726df64
</pre>
<p>and sure enough, that doesn&#8217;t match, so the password is rejected.</p>
<p>Of course, the system has to keep the salt &#8220;TheAnswerIs42&#8243; around to check the password, otherwise, it can&#8217;t re-perform the hash. So, if an attacker breaks in, he&#8217;ll find the salts, of course. This means that salting won&#8217;t protect a user with a weak password. But it will provide better protection for users with reasonable passwords, since, even with the salt in hand, the attacker will have to re-compute the dictionary for each salt, and thus each user.</p>
<p>So the moral of the story is that hashing the secret password directly is a bad idea.</p>
<p>And this is typically where most developers stand. They understand that hashing is good, they vaguely understand the notion of salting, and they figure that salt+hash is all they need to know. Except it&#8217;s not.</p>
<h4>When hashing is really a signature</h4>
<p>One interesting application of hash functions that has spread like wildfire in the last few years is in the realm of cheap signatures. Consider an application, <b>SuperAnnoyingPoke</b> that wants to send an authenticated message to <b>MyFace</b>. It could apply a full digital signature, using say RSA, so that MyFace can be sure that the message really came from SuperAnnoyingPoke. But that actually takes milliseconds on an average computer, and milliseconds are a lot. Plus, there&#8217;s all sorts of weird padding issues and size limitations that might require hybrid encryption, so it&#8217;s messy.</p>
<p>But hey, let&#8217;s take out our trusty cryptographic Swiss Army Knife, the hash function! Let&#8217;s salt+hash! We&#8217;ll just make sure that SuperAnnoyingPoke and MyFace share a secret string that&#8217;s a good 20 characters long or so, and when SuperAnnoyingPoke wants to send a message to MyFace, it will also send along a &#8220;Message Authentication Code&#8221; (MAC) that is computed as:</p>
<pre>
MAC = SHA1(secret_string || message)
</pre>
<p>MyFace can easily look at the message that is sent, recompute the MAC given the secret string it shares with SuperAnnoyingPoke, and compare it to the MAC sent along with the message. Heck, you can even put a timestamp in there to make sure the message can&#8217;t be re-played by an attacker at a later date. After all, since the hash function makes it hard to &#8220;go back&#8221; when you&#8217;re using a salt (the secret string), this should be a secure and cheap way to sign messages! Super!</p>
<p>Except this is where things really fall apart.</p>
<p>The security property we want here is that, if the attacker sees a message and its corresponding MAC, then it should not be able to figure out the MAC for a different message. That&#8217;s the whole point of a signature. And, unfortunately, there&#8217;s a property of SHA1 and lots of other hash functions like it that make it a fast hash function, but a terrible way to compute a MAC.</p>
<p>Here&#8217;s the deal: if I tell you that <tt>SHA1(foo)</tt> is X, then it turns out, in a lot of cases, to be quite easy for you to determine what <tt>SHA1(foo || bar)</tt> is. You don&#8217;t need to know what <tt>foo</tt> is. It&#8217;s just that, because SHA1 is iterative and works block by block, if you know the hash of <tt>foo</tt>, then you can <em>extend</em> the computation to determine the hash of <tt>foo || bar</tt>.</p>
<p>Oh crap.</p>
<p>That means that if you know <tt>SHA1(secret || message)</tt>, then you can compute <tt>SHA1(secret || message || ANYTHING)</tt>, which is a valid signature for <tt>message || ANYTHING</tt>. So to break this system, you just need to see one signature from SuperAnnoyingPoke, and then you can impersonate SuperAnnoyingPoke for lots of other messages.</p>
<p>Why? How??? But&#8230;. I thought hash functions didn&#8217;t let me &#8220;go back!&#8221; Well, note how I didn&#8217;t say the attacker would recover the secret. It&#8217;s just that, given one hash, they can compute others for related pre-images. That&#8217;s why you have to be careful about using hash functions when you&#8217;re hashing secrets. Another strike against using hash functions willy-nilly.</p>
<p>(If you&#8217;re keeping up, your next suggestion is &#8220;well, put the secret AFTER the message, not before&#8221;. And yeah, that&#8217;s a reasonable suggestion, but it points out how you&#8217;re now assuming some extra properties of the SHA1 hash function in your design, and that&#8217;s bad. What if you upgrade to a different hash function in 5 years, do you then have to update your protocol to match? The point is that you shouldn&#8217;t be using a hash function for this, that&#8217;s not its purpose!)</p>
<h4>HMAC</h4>
<p>What you should be using is HMAC: Hash-function Message Authentication Code. You don&#8217;t need to know exactly how it works, just like you don&#8217;t need to know exactly how SHA1 works. You just need to know that HMAC is <em>specifically built</em> for message authentication codes and the use case of SuperAnnoyingPoke/MyFace. Under the hood, what&#8217;s approximately going on is two hashes, one after the other, with the secret combined after the first hash&#8230; but don&#8217;t worry about it! That&#8217;s the whole point! HMAC is built for this feature.</p>
<p>HMAC has two inputs and one output: in go a message, and a secret, and out comes a message authentication code (i.e. a signature). The security of HMAC is such that, you can see as many messages and corresponding signatures as your heart desires, and you <em>still</em> won&#8217;t be able to determine the signature on a message you haven&#8217;t seen yet. That&#8217;s the security property you&#8217;re looking for. And HMAC is built on top of a hash function, so more specifically you should be using HMAC-SHA1.</p>
<p>So, again, don&#8217;t hash secrets. HMAC them.</p>
<h4>In Conclusion</h4>
<p>There&#8217;s plenty more to read if you&#8217;re interested in this topic, but chances are, you&#8217;re not and you just want a recommendation. &#8220;Don&#8217;t Hash Secrets&#8221; is not <em>always</em> entirely necessary. In the password example, you <em>can</em> hash a password as long as you salt it correctly. But do you really want to have to worry about that? I don&#8217;t. In fact, I use HMAC for my password databases, too. It&#8217;s overkill, but it lets me use a standard library that likely makes me safer in the long run.</p>
<p>So the next time you&#8217;re using a hash function on <em>anything</em>, ask yourself: is any of the stuff I&#8217;m hashing supposed to stay secret? If so, don&#8217;t hash. Instead, use HMAC.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2008/06/19/dont-hash-secrets/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Open(Social) Will Win ; and now Privacy?</title>
		<link>http://benlog.com/articles/2007/11/02/opensocial-will-win-and-now-privacy/</link>
		<comments>http://benlog.com/articles/2007/11/02/opensocial-will-win-and-now-privacy/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 18:53:29 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/articles/2007/11/02/opensocial-will-win-and-now-privacy/</guid>
		<description><![CDATA[If you&#8217;re hooked into the social networking world, you know about Facebook and the Facebook platform, which lets developers create all sorts of applications that make use of your Facebook social network in interesting ways. Flixster, for example, lets you &#8230; <a href="http://benlog.com/articles/2007/11/02/opensocial-will-win-and-now-privacy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re hooked into the social networking world, you know about Facebook and the Facebook platform, which lets developers create all sorts of applications that make use of your Facebook social network in interesting ways. <a href="http://flixster.com">Flixster</a>, for example, lets you share and compare your movie tastes with your existing Facebook friends. No need to reconnect to your friends in every web-based application.</p>
<p>But there is one problem: if you write a Facebook application, you&#8217;re pretty much stuck with Facebook. <b><em>Facebook never lets the application see the user&#8217;s email address or Instant Messenger account name, or any other fields that would allow the application to contact the user independently</em></b>. So, unless you convince users to reenter their email addresses, you&#8217;re stuck.</p>
<p>Yesterday, Google launched <a href="http://code.google.com/apis/opensocial/">OpenSocial</a>, a generic API for building Facebook-like applications, but this time on top of a dozen competing social networks now all supporting the same programmatic interface. It&#8217;s very cool that you can build an app once and run it on any social network, but what&#8217;s far more interesting to me is <em><b>social network portability</b></em>, the idea that I, as a user, can theoretically pack up my social network and go to a different site altogether, if I so choose. And that as a developer, I can contact users and their friends directly, if users so choose.</p>
<p>I&#8217;m not sure yet if OpenSocial will truly allow this, but it looks like it will: the People API has <tt>gd:email</tt> and <tt>gd:im</tt> fields which are exactly the key to social network portability: global unique identifiers for your friends that can be used for messaging.</p>
<p>And so OpenSocial will win. Because open is better: more competition and the reduction of artificial user lock-in results in better products. Google has done a very good thing.</p>
<p>One interesting wrinkle: I wonder how the social network operators feel right now. Participating in OpenSocial is inevitable at this point, unless you plan on giving up the significant value that&#8217;s about to be created by hordes of developers. But then, how do you compete, as the underlying social network? How do you prevent from bleeding all of your users to a newer, hipper network when users can pack up their friends and applications at the click of a button?</p>
<p>Maybe one way a social network can compete is on privacy: provide very good privacy controls, allow users to present different faces to different sets of friends, and generally make it really worth their while to host their social network with you. Social networks are not going to be judged on their applications anymore, but purely on how well they manage the actual social network data. So maybe, just maybe, privacy will become a competitive advantage.</p>
<p><b>UPDATE</b>: a little birdie tells me that OpenSocial, in its current form, offers no more data portability than Facebook. That&#8217;s unfortunate, but it&#8217;s not entirely surprising because of the argument above: social network platforms don&#8217;t care to be commoditized. So, if there&#8217;s no data portability, but there is application portability, it&#8217;s still hard to move from one network to another, and there&#8217;s less incentive, since you can use any application on your network. This could completely reverse my point: OpenSocial might cause *more* lock-in, not less, and then there&#8217;s no hope for privacy improvements anytime soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2007/11/02/opensocial-will-win-and-now-privacy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Password Anti-Pattern and the Login Redirection Anti-Pattern</title>
		<link>http://benlog.com/articles/2007/10/12/the-password-anti-pattern-and-the-login-redirection-anti-pattern/</link>
		<comments>http://benlog.com/articles/2007/10/12/the-password-anti-pattern-and-the-login-redirection-anti-pattern/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 18:07:34 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[identity]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/articles/2007/10/12/the-password-anti-pattern-and-the-login-redirection-anti-pattern/</guid>
		<description><![CDATA[A few weeks ago, I wrote about about how web sites that manage your data should be more open in order to better protect you. Not so surprisingly, I&#8217;m not the only one thinking about this issue. Jeremy Keith has &#8230; <a href="http://benlog.com/articles/2007/10/12/the-password-anti-pattern-and-the-login-redirection-anti-pattern/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I wrote about about how web sites that manage your data <a href="http://benlog.com/articles/2007/09/13/protecting-data-by-being-more-open/">should be more open in order to better protect you.</a> Not so surprisingly, I&#8217;m not the only one thinking about this issue.</p>
<p>Jeremy Keith has a <a href="http://adactio.com/journal/1357">fantastic detailed write-up</a> regarding what he calls the &#8220;password anti-pattern.&#8221; It gets at the same fundamental issue I was talking about, but with more interesting detail. It lays out the problem concisely and clearly:</p>
<blockquote><p>
[Asking for gmail passwords from your users] teaches people how to be phished.
</p></blockquote>
<p>And it mentions <a href="http://oauth.net">OAuth</a>, an effort I only recently learned about, which standardizes the kind of web-based API that would make this practice go away. Fantastic.</p>
<p>But I want to push this a little bit further. The OAuth site talks about ways in which OpenID authentication can be used in combination with the OAuth application API. But OpenID, in its baseline implementation, suffers from the same kind of problematic anti-pattern: it teaches you to be redirected to a login site where you enter your password. Not as bad as entering your password <em>on a different site</em>, but still pretty bad: you now learn that it&#8217;s okay to be redirected to your identity provider by any web site, whether or not you trust the web site. And if you don&#8217;t check the URL in the address bar (ahem, only security freaks like me do), you&#8217;re being taught to be phished, too.</p>
<p>OpenID <em>can</em> be patched to be more secure. But it&#8217;s important to realize that, in its baseline implementation, it&#8217;s just as bad a user design pattern as the social-network password-based contact importer.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2007/10/12/the-password-anti-pattern-and-the-login-redirection-anti-pattern/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Facebook Platform: bad login practices, OpenID doesn&#8217;t work</title>
		<link>http://benlog.com/articles/2007/07/03/facebook-platform-bad-login-practices-openid-doesnt-work/</link>
		<comments>http://benlog.com/articles/2007/07/03/facebook-platform-bad-login-practices-openid-doesnt-work/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 16:09:55 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/articles/2007/07/03/facebook-platform-bad-login-practices-openid-doesnt-work/</guid>
		<description><![CDATA[Facebook launched a platform that lets third-party developers add Facebook applications. This is visionary, and it&#8217;s very very cool (though I&#8217;m not sure it&#8217;s the revolution everyone is talking about.) The problem, of course, is authentication. Take a look at &#8230; <a href="http://benlog.com/articles/2007/07/03/facebook-platform-bad-login-practices-openid-doesnt-work/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Facebook launched a platform that lets third-party developers add Facebook applications. This is visionary, and it&#8217;s very very cool (though I&#8217;m not sure it&#8217;s the revolution everyone is talking about.) The problem, of course, is authentication. Take a look at <a href="http://www.techcrunch.com/2007/07/02/zoho-launches-facebook-application/">the Zoho Facebook application</a>. Zoho is a separate company. They have their own accounts. So now they have to associate an existing Facebook account with an existing Zoho account. The only way they can do this currently is to ask for the Zoho password from within the Zoho Facebook application, which is served from <tt>facebook.com</tt>. So now verifying the URL before you enter a password doesn&#8217;t mean anything. You have to trust facebook, and by that token all of its third-party developers, with all of your passwords. Great!</p>
<p>People have been saying this for years, but now the rubber meets the road for real: we need some kind of authentication infrastructure. And guess what&#8230; OpenID won&#8217;t cut it here, because the issue is to find some way to provide Facebook with a token that it can forward to Zoho that will let Zoho authenticate the user, and since OpenID only supports direct authentication rather than cryptographic-token-mediated authentication, it won&#8217;t work. I&#8217;m guessing CardSpace won&#8217;t work either, although I don&#8217;t know it well enough to say for sure.</p>
<p>No, what&#8217;s positively fascinating about this is that there&#8217;s a need for some fairly complex authentication mechanism, where the user is specifically asked to associate two different accounts on two different systems. The right solution almost certainly requires cryptographic tokens. I&#8217;m not sure what it will take, but we&#8217;d better think fast, because this kind of application is precipitating the end of the password authentication concept.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2007/07/03/facebook-platform-bad-login-practices-openid-doesnt-work/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>BeamAuth: Two-Factor Web Authentication with a Bookmark.</title>
		<link>http://benlog.com/articles/2007/02/06/beamauth-two-factor-web-authentication-with-a-bookmark/</link>
		<comments>http://benlog.com/articles/2007/02/06/beamauth-two-factor-web-authentication-with-a-bookmark/#comments</comments>
		<pubDate>Tue, 06 Feb 2007 19:40:51 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/articles/2007/02/06/beamauth-two-factor-web-authentication-with-a-bookmark/</guid>
		<description><![CDATA[(There&#8217;s always a dilemma between &#8220;publishing soon&#8221; and &#8220;polishing for peer review.&#8221; This is my first attempt at blog-based collaborative peer-review. Let&#8217;s see how it goes!) The Problem Phishing is a serious issue, and it&#8217;s only getting worse. Through various &#8230; <a href="http://benlog.com/articles/2007/02/06/beamauth-two-factor-web-authentication-with-a-bookmark/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>(There&#8217;s always a dilemma between &#8220;publishing soon&#8221; and &#8220;polishing for peer review.&#8221; This is my first attempt at blog-based collaborative peer-review. Let&#8217;s see how it goes!)</em></p>
<h3>The Problem</h3>
<p>Phishing is a serious issue, and it&#8217;s only getting worse. Through various means, Alice ends up at a spoofed web site she thinks she recognizes (usually her bank). She inevitably ends up providing her login credentials, which the attacker can then use to perform (malicious) actions on Alice&#8217;s behalf. Theoretically, assuming Alice&#8217;s browser is relatively secure, she could check the URL and the SSL certificate and defend against these kinds of attack. In practice, users don&#8217;t check the URL or are easily fooled by similarly spelled URLs and other dirty tricks. </p>
<p>Various anti-phishing solutions in the past help to some degree, though they all tend to have one annoying property: if the user is really not paying attention, if the anti-phishing solution errors out, the user gets phished.</p>
<p>That&#8217;s not okay. We need a solution where, if the proposed solution errors out, the user may get denied access, may become confused, but she <b>cannot get phished</b>. At a high level, this requires two-factor authentication, where even if the user gets fooled into revealing the password she knows, that&#8217;s not enough for an attacker to gain her full login credentials.</p>
<h3>OpenID and CardSpace</h3>
<p>The <a href="http://www.openid.net">OpenID project</a> is a distributed, web-based single sign-on system that requires no changes to the user&#8217;s browser. Unfortunately, as <a href="http://www.identityblog.com/?p=659">Kim Cameron</a> and <a href="http://www.links.org/?p=187">Ben Laurie</a> have recently pointed out, OpenID as it is specified makes phishing worse, because an attacker can simply offer OpenID logins on a semi-legitimate web site and then play Man-in-the-Middle for the user&#8217;s OpenID login page. OpenID folks have mostly ruled this issue out of scope, which is unfortunate. As it stands, OpenID makes things <b>less secure</b> than they currently are. <a href="http://sxipper.com">Some folks</a> are trying to address this issue by augmenting OpenID with other features, for example using a browser plugin. There are also signs that the OpenID community is starting to take this concern more seriously, though no good solution exists yet.</p>
<p>Meanwhile, Microsoft is about to deploy <a href="http://cardspace.netfx3.com/">CardSpace</a>, a radically new way to authenticate to web sites, with a significantly revamped client-side experience. On technical grounds and security, CardSpace appears to be quite solid. I&#8217;m most impressed with the user interface aspects, which really make it much harder to get successfully phished. Unfortunately, deploying CardSpace on both client and server is fairly involved, and may take time.</p>
<p>So the question is: can we find a middle ground? Something that is more secure than the OpenID spec, but not quite as involved as deploying CardSpace? Ideally, something that doesn&#8217;t even require a plugin? We don&#8217;t have to have the entire feature set of CardSpace, but at least we should aim to make phishing far more difficult. And, ideally, we could make this OpenID+, something that only slightly alters the model for OpenID, while leaving the existing protocols in place.</p>
<p><b><i>Last Minute Edit</i></b>: looks like CardSpace and OpenID will soon have <a href="http://www.identityblog.com/?p=668">a collaboration story</a>. I don&#8217;t think this reduces the need for an immediate anti-phishing solution with minimal client-side work, but it&#8217;s an interesting move nevertheless.</p>
<h3>Related Work</h3>
<p>In recent days, <a href="http://simonwillison.net/2007/Jan/19/phishing/">Simon Willinson</a> and then <a href="http://usablesecurity.com/2007/01/20/phishing-and-openid/">Ka-Ping Yee</a> proposed having Alice use a bookmark to reach her OpenID server, rather than rely on the web site to redirect appropriately. This is interesting, and one of the OpenID implementors, <a href="http://janrain.com">JanRain</a>, <a href="http://blog.janrain.com/2007/01/24/myopenidcom-release-hullabaloo/">thinks so too</a>.</p>
<p>(In the interest of full scientific disclosure, I was working on a bookmark-related idea independently and around the same time as Simon and Ka-Ping, but they published their ideas first. There is a substantive difference between their proposal and mine, so this presentation should still be useful.)</p>
<h3>A Proposal: BeamAuth</h3>
<p>What if a bookmark could be a second factor for authentication? In this proposal, the bookmark is more than a server locator: it also contains a secret token. It would be useful if the login process that folks are used to is not radically altered. Because this is BookMark Authentication, or BMAuth, my proposal is called <b>BeamAuth</b>.</p>
<p>With BeamAuth, Alice registers with a web site (which may be an OpenID provider), <tt>http://beamauth.org</tt>, and obtains some kind of confirmation page which presents a special bookmark, &#8220;BeamAuth,&#8221; which she can drag to her bookmarks bar. This bookmark contains, within it, a secondary secret token, randomly generated by <tt>beamauth.org</tt>, that complements Alice&#8217;s password.</p>
<p>Later, when Alice wants to log in, she:</p>
<ol>
<li> visits <tt>http://beamauth.org/login</tt>, either manually or because some other site redirected her there (with OpenID, for example),</li>
<p></p>
<li> clicks her BeamAuth bookmark, which automatically fills in her username into the login form and &#8220;injects&#8221; a secondary secret token into the page scope,</li>
<p></p>
<li> enters her password into the form,</li>
<p></p>
<li> and submits the form.</li>
</ol>
<p>How does this prevent phishing?</p>
<ul>
<li> <b>URL checked by BeamAuth</b>: If Alice clicks her BeamAuth bookmark at a location that is <em>not</em> her proper login page, the bookmark sends Alice to her actual login page. Some confusion may ensue since Alice was expecting to log in to a specific web site (which is now lost), but at least Alice won&#8217;t enter her password on a phishing site. In other words, as long as Alice remembers to click her BeamAuth bookmark before typing in her password, her password is safe.</li>
<p></p>
<li> <b>Two-Factor Authentication</b>: If Alice is somehow duped into typing her password without clicking her BeamAuth bookmark, she only reveals her password, not the second secret token within the bookmark. The attacker only obtained half the login credentials, while the other half remains safely hidden inside BeamAuth.</li>
</ul>
<p>If you like this already, you might wonder, &#8220;why not just have the password in the bookmark so Alice doesn&#8217;t have to type anything?&#8221; Well, that would work, too, and it would be phishing-proof, but it seems preferable to make sure the bookmark is not entirely sufficient to perform the login, just in case an attacker gains physical control of Alice&#8217;s machine for a few minutes (lunchtime attack).</p>
<h3>How Does This Work?</h3>
<p>The bookmark looks like:</p>
<p><tt>http://beamauth.org/login#ben@adida.net|8b7c8xcv882340235098142308</tt></p>
<p>Thus, if you are at the location <tt>http://beamauth.org/login</tt>, as you are when you are redirected for single sign-on, e.g. OpenID, this does not cause a page reload, it simply appends everything after the &#8220;#&#8221; sign to your URL address bar. This portion of the URL is called the fragment identifier. Crucially, it isn&#8217;t sent over the network. However, your login page&#8217;s Javascript can pick it up and use it for computation, which is exactly what BeamAuth does. Specifically, BeamAuth Javascript HMAC&#8217;s the user&#8217;s password with the bookmark token as a key, all inside the web browser, and the result is the user&#8217;s login credential.</p>
<p>The URL before the pound sign has to match exactly, though, which means that if request parameters are required, they should be sent to the URL via a POST, or stored in the server-side session. In Opera and Safari, only the latter solution (parameters stored in the server-side session) works, because a click on the bookmark will always cause a reload in Safari, and in Opera if the URL is the result of a POST.</p>
<h3>Is This Really Better?</h3>
<p>I think so. The current JanRain implementation of Simon&#8217;s suggestion might still lead a user to be phished: an evil web site sends the user to a spoofed login page, which happily accepts his password. In other words, a momentary lapse of judgment on behalf of the user will still result in the user being phished. I don&#8217;t think this can happen with BeamAuth, mostly because BeamAuth is a two-factor solution.</p>
<p>The only downside is that BeamAuth requires Javascript. If you have Javascript turned off, you&#8217;re still safe, of course: an attacker can&#8217;t log in. But then again, neither can you. One solution is then to send the secondary token to the server directly over SSL, without Javascript on the client. I like this less, but it&#8217;s workable.</p>
<h3>Extensions</h3>
<p>
Of course, passwords shouldn&#8217;t be transmitted in the clear, and neither should our computed credential which results from two user factors. The computed credential should be exchanged over SSL or using a challenge-response protocol. That&#8217;s not too hard to implement. What&#8217;s <b>interesting</b> is that, if you&#8217;re not worried about IP/DNS spoofing, you can safely use BeamAuth without SSL. That&#8217;s a bit dangerous, but it&#8217;s likely more secure than using a login server over SSL <i>without</i> BeamAuth, because users never check the SSL padlock anyways.
</p>
<p>
There may be a way to provide a more consistent experience across all browsers using bookmarklet tricks. I&#8217;m exploring this possibility with Filipe Almeida. The trick is to find a piece of Javascript that the phisher cannot hijack, which is a lot harder than it sounds.
</p>
<h3>Demo!</h3>
<p>
I&#8217;ve implemented this over on <a href="http://labs.adida.net/fragtoken/beamauth/">Demo Server</a>, which is part of a conference submission that includes other work using the URL fragment identifier for added security. Thus, the name on the Demo Server is <b>FragToken Bookmark Authentication</b> (if someone has a better name, I&#8217;m all ears!)
</p>
<h3>Acknowledgments</h3>
<p><a href="http://people.deas.harvard.edu/~rachna/">Rachna Dhamija</a> provided important usability feedback on BeamAuth. <a href="http://mega.ist.utl.pt/~filipe/">Filipe Almeida</a> and <a href="http://links.org">Ben Laurie</a> provided crucial security feedback and broke an early version of BeamAuth.</p>
<p>
You can also read the <a href="http://ben.adida.net/research/fragtoken-20070203.pdf">paper in submission</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2007/02/06/beamauth-two-factor-web-authentication-with-a-bookmark/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>2007: Controlled End-User Web APIs for Private-Data Mashups</title>
		<link>http://benlog.com/articles/2007/01/02/2007-controlled-end-user-web-apis-for-private-data-mashups/</link>
		<comments>http://benlog.com/articles/2007/01/02/2007-controlled-end-user-web-apis-for-private-data-mashups/#comments</comments>
		<pubDate>Tue, 02 Jan 2007 18:17:31 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://benlog.com/articles/2007/01/02/2007-controlled-end-user-web-apis-for-private-data-mashups/</guid>
		<description><![CDATA[As far as technology goes, 2007 will be about web security. With everyone storing more and more personal data on various web sites, and with the continuing innovation of mash-ups, it&#8217;s inevitable. And it won&#8217;t be the web security issues &#8230; <a href="http://benlog.com/articles/2007/01/02/2007-controlled-end-user-web-apis-for-private-data-mashups/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As far as technology goes, 2007 will be about web security. With everyone storing more and more personal data on various web sites, and with the continuing innovation of mash-ups, it&#8217;s inevitable. And it won&#8217;t be the web security issues of the last few years, either, it will all be about <b>how to do private-data mash-ups securely</b>.</p>
<p>Case in Point: Google just patched a serious security problem that allowed an Evil Web Site (EWS) to access your gmail contact list, as long as you were logged into gmail and you simply visited the EWS. The root cause: Google wanted one of its web applications to be able to integrate with your gmail contact list, and their chosen implementation was to use <b>your browser</b> as the transfer point. This makes sense, because your browser is likely already authenticated to gmail, so there&#8217;s a nice <b>abstraction of authentication</b> going on here: the application that wants to integrate with your gmail contacts simply instructs your browser to fetch it, and if your browser is already authenticated, then it succeeds.</p>
<p>Of course, the problem is that, if a web site can instruct your browser to fetch data, e.g. your contact list, from a remote service, e.g. gmail, then you&#8217;ve got a problem: an EWS can do the same thing behind your back. Specifically, here&#8217;s the data flow we need to carefully consider:</p>
<ol>
<li> Alice visits Web Site One, which runs some code, call it Application One, <em>inside</em> Alice&#8217;s browser.</li>
<li> Application One then contacts Web Site Two for some information, possibly using Alice&#8217;s credentials transparently (e.g. a cookie.)</li>
<li> Web Site Two returns some data to Application One running inside Alice&#8217;s browser.</li>
<li> Application One takes this data and makes use of it inside Alice&#8217;s browser for some purpose.</li>
<li> Application One takes this data and submits it back to Web Site One.</li>
</ol>
<p>If we allow this complete loop to take place, then Web Site One can steal all sorts of private data that Alice has stored at Web Site Two. At the same time, there are some very good reasons for allowing <em>some</em> of this data flow to occur. One use case is already well understood: Web Site Two might be a public information source, like Google Maps, with which a mash-up is much desired. Another use case is the contact-list example, where Web Site One would like to integrate with Alice&#8217;s private contact list at Web Site Two.</p>
<p>The interesting question is: how do we allow the contact-list integration without enabling wholesale private data theft? Two possible solutions come to mind:</p>
<p><b>Quarantine the Program: </b> in some cases, it might be possible to quarantine Application One so that, once it starts talking to Web Site Two, it can no longer contact Web Site One (or any other web site) again: this effectively blocks <b>step 5</b> in the data flow. This approach has limited applicability: in the contact-list example, you obviously want to do <em>something</em> with the contact list once it&#8217;s been loaded, and that probably involves some feature at Web Site One. There may be some edge cases where quarantine is actually useful (and doable), but they will remain edge cases.</p>
<p><b>Control the Cross-Application Data Transfer:</b> The data transfer from Web Site Two to Application One should be explicit. In other words, in <b>step 3</b>, Web Site Two should <em>know</em> that the request is coming from Application One, should have the ability to interact with Alice directly (without letting Application One mediate), e.g. to let her select the contact she wants to use, and to explicitly return the data Alice <em>chose to share</em> with Application One.</p>
<p>I think 2007 will see an enormous rise in technologies and tricks to enable this second option: Controlled Cross-Application (aka Cross-Domain) Data Transfer. There are some existing ideas in this realm:</p>
<ul>
<li> the <a href="http://whatwg.org/specs/web-apps/current-work/#crossDocumentMessages">WHAT WG Cross-Document Messaging API</a>, a work in progress not yet implemented in current browsers,</li>
<li> the <a href="http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book75">Cross-Domain iFrame Trick</a>, which works in today&#8217;s browsers with some limitations, and</li>
<li> <a href="http://en.wikipedia.org/wiki/Macromedia_Flash">Flash</a>, which allows cross-domain requests with white-listing on the remote domain.
</ul>
<p>My feeling is that the messaging approach of the WHAT WG is the right way to go, with some cross-domain iframe hacks while the details of the specs get fleshed out. Flash is interesting, but HTML/Javascript is still the easier (and more open) way to develop web applications.</p>
<p>But 2007 will bring one major pitfall along with this: many folks continuing to forget <b>why</b> the cross-domain restriction is there in the first place. You can start to see this with people claiming that <a href="http://www.25hoursaday.com/weblog/PermaLink.aspx?guid=26dcb852-fd7b-49c6-a7e5-417ea07a1ef1"> the dangerous data flow above can be broken by removing pre-existing authentication from cross-domain requests</a>. This argument makes two large mistakes:</p>
<p><b>There are other inherent authentication mechanisms that are undetectable by the browser</b>: many corporate intranets serve data to machines within their network without authentication, since the requests are coming from inside the network. There are also many publishers who offer site licenses to universities by white-listing their IP-address space. There&#8217;s no way for the browser to know when it&#8217;s accessing an intranet or internet service, so allowing cross-domain requests is like poking a hole in all corporate firewalls, in all home network firewalls, etc&#8230; It simply will not happen.</p>
<p><b>The browser as the focal point for authentication is a good idea</b>: having authentication handled by the user&#8217;s browser is a <em>really good thing</em>. It means you can begin to abstract out authentication: Application One makes the call to Web Site Two, lets the user authenticate there and select the data to send back to Application One, and Application One never needs to understand Web Site Two&#8217;s authentication mechanism. It also means the user is in control: if Application One can contact Web Site Two without going through my browser, that&#8217;s a significant loss of control over my private data.</p>
<p>So that&#8217;s my prediction for 2007: a big explosion in controlled cross-domain technologies. Think of them as end-user Web APIs: assembling web application components via the browser with end-user control. It&#8217;s going to be exciting, and there are going to be enormous icebergs along the way.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2007/01/02/2007-controlled-end-user-web-apis-for-private-data-mashups/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>So, I lied&#8230;.</title>
		<link>http://benlog.com/articles/2006/06/10/so-i-lied/</link>
		<comments>http://benlog.com/articles/2006/06/10/so-i-lied/#comments</comments>
		<pubDate>Sat, 10 Jun 2006 21:14:00 +0000</pubDate>
		<dc:creator>ben</dc:creator>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[policy]]></category>

		<guid isPermaLink="false">http://benadida.webfactional.com/?p=7</guid>
		<description><![CDATA[It turns out, I&#8217;m giving another presentation before my defense&#8230; well, sort of, I&#8217;m on a panel at the Harvard Berkman Center&#8217;s Identity Mashup Conference in 10 days. Lots of very interesting folks getting together to discuss online identity. It &#8230; <a href="http://benlog.com/articles/2006/06/10/so-i-lied/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It turns out, I&#8217;m giving another presentation before my defense&#8230; well, sort of, I&#8217;m on a panel at the <a href="http://identitymash-up.org/">Harvard Berkman Center&#8217;s Identity Mashup Conference</a> in 10 days. Lots of very interesting folks getting together to discuss online identity. It should be quite interesting.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlog.com/articles/2006/06/10/so-i-lied/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

