Hijacking OpenID Enabled Accounts
It has been a long time since I last spoke about OpenID. Today I would like to draw your attention to a tiny problem, which I found among several OpenID solutions. The problem is indeed tiny but the overall outcome is concerning.
CSRF - It comes very handy. It seams that no matter how much you talk about it, very few pay attention on the problem. And it is not a problem that you can afford to have. And among the XSS issues, which most OpenID libraries have, CSRF (Cross-site Request Forgery) seams to be the most pervasive form of attack.
When it comes to OpenID, it seams that developers forget about CSRF, or they just don't want to simply deal with it, mainly because OpenID is not straightforward type of technology. As you probably know, the OpenID authentication stage happens over two channels: one hidden from the user, and one top (visible) channel for authorization purposes mainly. Because the process seems to be kind of obscured, CSRF issues are often taken very lightly and widely ignored.
Instead of showing you examples with real, live systems, rather unethical as you may guess, I would like to show you an example of an account hijack technique which is currently present inside one of the few Wordpress OpenID plugins. However, keep in mind that I am trying to outline a widely-spread issue rather then to disclose a bug. Therefore, you can safely assume that this form of attack is also applicable to many other systems. This is how it goes.
Once you login into the Wordpress OpenID plugin user page, you can add an OpenID url for the current user login. This URL can be used later to login into the Wordpress instance, without typing your username and password, bur rather using a 3rd party server, your OpenID provider, to verify who you are. Unfortunately, the user administration form is vulnerable to CSRF attack. Saying that, attackers can easily, add their own OpenID url and as such authenticate without the need for credentials. Let's examine the form structure:
<form method="post">Add identity:
<input id="openid_url" name="openid_url"/>
<input type="submit" value="Add"/>
<input type="hidden" name="action" value="add_identity"/>
</form>
It is obvious that there is nothing there to prevent CSRF attacks. Once the attacker supplies a URL for the openid_url field, the page will redirect to the OpenID provider specified by that URL, authenticate and return back to the original position. Given the fact, that the OpenID provider is controlled by the attacker, btw. everyone can host their own OpenID provider, the attack is very trivial to pull. Once this URL is stored within the plugin database, the attacker will be able to authenticate with the attacked blog without any sort of authorization whatsoever.
I hope that you understand the impact of this issue as it is one of the main things you will see when you deal with OpenID enabled systems. OpenID does make life easier bur if you don't implement the infrastructure properly, you are asking for some serious trouble. BTW, the vulnerability, which I so lightly covered in this post, is not due to a coding mistake within the plugin itself, bur rather then a bug that exists within the main support library, which is one of the most popular OpenID libraries available in the wild.
Archived Comments
1. I need to visit site controlled by attacker and I have to decide to use my OpenID.Incorrect! The idea is that because OpenID enabled sites treat the OpenID technology as a captcha of some sort, ignoring the fact that the OpenID authentication and authorization stages can be completely automated by a simple OpenID identity provider server written in python or any other language, when the identity management page of the OpenID enabled device is vulnerable to CSRF, attackers can add their own identity there and use that to get access to the account. Since they use their own identity and their own identity provider, they don't need credentials.
My question is the MyOpenID approach will prevent the problem you have describedNo, the problem is unrelated to the way MyOpenID handles the authentication or authorization processes.
So whilst you may see problems with OpenID, it would be good if you highlighted the plus points to the security which has already been discussed and put forward for the protocol?Point taken. Although I brag about OpenID security far too often, I am personally a big fan of the concepts and technologies involved. The simple fact is that your OpenID identity provider can be secured pretty well, like for example by using RSA tokens, etc. Using this identity for all your online presence will be far more secure then using individual passwords, from password management prospective only. Though, there are a bunch of other things which come into place that needs to be taken into consideration. One of the main things is that if OpenID makes it so easy to login anywhere you want, most people will be logged in all the time. And from Web security point of view, with all these XSS and CSRF attacks popping everywhere, it is a really bad idea.
BTW, the vulnerability, which I so lightly covered in this post, is not due to a coding mistake within the plugin itself, bur rather then a bug that exists within the main support library, which is one of the most popular OpenID libraries available in the wild.I am making some assumptions. First you are referring to Wordpress plugin and the second is that you are referring to PHP library supporting OpenID. Based on those assumptions I was about to ask you did you run test on other popular software like Drupal and Joomla. At the same time I saw the comment from kravietz about Drupal. So I am little confused again. If Drupal can protect against this issue, why WP-pluging don't deploy the same protection? And can the library be fixed or the OpenID protocol needs to be modified? Thanks, SAL-e
When it comes to OpenID, it seams that developers forget about CSRF, or they just don’t want to simply deal with it, mainly because OpenID is not straightforward type of technology.quote 2
Instead of showing you examples with real, live systems, rather unethical as you may guess, I would like to show you an example of an account hijack technique which is currently present inside one of the few Wordpress OpenID plugins.quote 3
Once the attacker supplies a URL for the openid_url field, the page will redirect to the OpenID provider specified by that URL, authenticate and return back to the original position. Given the fact, that the OpenID provider is controlled by the attacker, btw. everyone can host their own OpenID provider, the attack is very trivial to pull. Once this URL is stored within the plugin database, the attacker will be able to authenticate with the attacked blog without any sort of authorization whatsoever.Is it still unclear what is the article all about? And if not, do you mind updating your post to outline that?