The bookmarklet solution to the password problem
Anyone who makes heavy use of the internet has run in to the password problem: dozens of user accounts on sites with varying degrees of trustability, leading to an unmanageable proliferation of username and password combinations. The temptation is to use the same combination on multiple sites, but doing so opens you up to the horrifying prospect of a security flaw in one site compromising al of your other accounts.
I was burnt by this a few years ago: a small community forum on which I was a member was cracked, and my account was then used to log in to another larger forum to which I had administrator acccess. Thankfully no permanent damage was done, but it taught me a valuable lesson in password security. Since then I’ve maintained a number of different combinations each with a different level of associated trust: if my account on Joe’s random forum is cracked it won’t lead to the compromise of my Amazon account!
Even different tiers of passwords aren’t ideal though, and that’s why Nic Wolff’s Password generator bookmarklet (via 43 Folders) has me so excited. Nic’s bookmarklet pops up a JavaScript prompt box asking for your “master” password, then MD5s it against the domain of the current login page and inserts the resulting hash in to any password fields on the page. A single password can be used for dozens of sites without any risk of a compromise of one account affecting the others. It’s brilliant.
There are a couple of minor flaws in the bookmarklet: the master password prompt is in plain text rather than masking your input with asterisks, and the bookmarklet could leave you high and dry if a site changes the domain on which their login form resides without you noticing. The first could be solved by extending the bookmarklet to append a “master password” field to the page using the DOM, while a solution to the second would require some kind of server-side store of the domains at which the initial accounts were created.
Quibbles aside, it’s an ingenious solution to a pervasive problem.
Anne - 6th September 2004 20:03 - #
Simon Willison - 6th September 2004 20:49 - #
Tomas Jogin - 6th September 2004 21:21 - #
Aquarion - 6th September 2004 21:51 - #
Simon Willison - 6th September 2004 22:12 - #
Kan Chim - 6th September 2004 23:06 - #
Simon Willison - 6th September 2004 23:17 - #
Additionally, it is my understanding of bookmarklets that they run their Javascript code in the same scope as the web page. So, it might be possible for a malicious web site to use Javascript to grab the password when you enter it, or at least to spoof the bookmarklet by using the same Javascript as the bookmarklet.
mmj - 7th September 2004 01:40 - #
mmj, when Simon says that there his password for the minor forum was compromised, I don't think he meant that somebody convinced him to spill the beans but that the password list for that site was stolen/cracked. If he had been using the MD5 bookmarklet, the crackers would have found his password to be something like , not very useful for cracking his Amazon account. The point of the MD5 bookmarklet is that the master password is never transmitted from the browser to a site; the only way to obtain this master password is through social engineering (assuming the online tool uses https, or another sufficiently secure encryption mechanism).
Micah - 7th September 2004 04:48 - #
Actually the online tool does not need encryption, It is just a page with the JavaScript built it rather than using a bookmarklet. For that very odd case where one has no access to JavaScript, one could write a CGI script that returns the generated password, but it would still not be linked to a user account for the site.
I like the idea of using the DOM to add a master password field. My first thought was a 'horrid' pop-up form (like the online tool without the domain field) but beloved pop-up blockers could get in the way. I guess the ideal solution would be to replace the password field with the master password field and register an onSubmit event handler that would conver the password before sending the form. Actually if one could register the onSubmit safely, there would be no need for manipulating the password field until the form is submitted. I've never written a bookmarklet, so I don't know how feasible these solutions to the plain text masterpassword field are. I'd probably implement this with levels of security passwords personally, then the right master password would be needed.
David Robarts - 7th September 2004 08:15 - #
Dave Child - 7th September 2004 11:37 - #
Casey - 7th September 2004 15:07 - #
There is a little problem: all of these tools would have to use a same algorithm (basic) that could be implemented in the greater possible amount of languages. Thus there wouldn't be problems to create a Firefox's extension, or a desktop application (that we could take in an USB device), all of them universal ones, and that gave the same result.
For it, it's necessary an "open algorithm" in which to be able to support those that we want to do some of these applications.
xoan - 7th September 2004 23:27 - #
Jeremy Dunck - 8th September 2004 00:05 - #
David Robarts - 8th September 2004 06:48 - #
I do not talk about to algorithm MD5 in himself, but to the used method to obtain a specific password for each site.
Something like (in PHP, e.g.):
This is a possible method :P. For that reason, if I wanted it to implement, it would have something to which to take hold to me.
xoan - 8th September 2004 18:31 - #
Brian Harnish - 9th September 2004 00:34 - #
QUERY_STRINGto make a CGI script.Lenny Domnitser - 9th September 2004 03:31 - #
Lenny Domnitser - 9th September 2004 03:33 - #
urlparse.urlparse(site)[':' in site and 1 or 2]- idiomatic Python at its best :)Simon Willison - 9th September 2004 03:49 - #
This bookmarklet has a security hole: a web page can see the password you type by redefining the prompt() function.
_prompt = prompt; prompt = function (a) { x=_prompt(a); alert("Your answer to '" + a + "' was " + x); return x; }Possible fixes:
Jesse Ruderman - 11th September 2004 04:40 - #
I still think that this idea is brillaint, but after looking at the code for the bookmarklet, I thought of some improvements:
Jason Edgecombe - 12th September 2004 17:33 - #
Hi all! Jason mailed me the suggestions in his last comment, and a link back to here. Thanks for your interest in the passwdlet, and your excellent and well-informed comments, none of which I'm likely to take action on soon because I'm in crunch mode on a site rollout. But, I claim no rights to the code so please do anything you want to it.
Jesse, that overloading hack is mighty clever - I didn't know you could do that! I do generally use a hard-coded master password - are you suggesting that a page could overload the doIt() function and somehow interrogate it for the value of a var declared within? Yikes. And what do you mean by "extension" in that context?
Dave, can you clarify about the Opera problem? Is it one that could be rectified by my URL-encoding the passwdlet more carefully?
Nic Wolff - 17th September 2004 01:09 - #
I can see a little problem with using the domain of the current page in the hash. It is possible that one company shares a user DB for two domains (say A9.com and amazon.com). The A9/Amazon example actually works, because the authentication page for A9 is on amazon.com.
But if you navigate to Nic Wolff's page using angel.net or www.angel.net you get different hashs... which is broken imo.
Julien Couvreur - 24th September 2004 23:01 - #
David Robarts - 16th February 2005 08:01 - #
@Jesse's overload hack can be prevented in Mozilla by disabling the ability for websites to overload window.prompt by setting the following Mozilla preference in the "user.js" file:
user_pref("capability.policy.default.Window.prompt .set", "noAccess");Nathar Leichoz - 22nd March 2005 09:23 - #
Tony Julian - 27th April 2006 07:40 - #