

Npm password_sha hashes and salts leaked - paulyoung

Received via email:<p>Security Alert - Please reset your npm registry account<p>The security of the npm registry has just been upgraded. This corrects a known flaw which led to the leakage of the password_sha and salt fields. The good news is that the leak is plugged. The bad news is that it existed for quite a while.<p>tl;dr<p>Your password wasn't leaked, but the hash was. Still not great.<p>It's fixed now.<p>Reset your npm account at http://admin.npmjs.org/reset<p>I'm very sorry.<p>Email me at i@izs.me if you have questions or would like to chew me out. You have every right to be upset.<p>Details<p>To do login, npm uses the /_users database in couchdb. By default, CouchDB prior to version 1.2.0 makes this database world-readable.<p>Your password wasn't leaked. However, the password_sha hash and the salt was. This means that someone with lots of CPU power at their disposal could eventually crack it. If your password is relatively short, then less CPU power would be needed. If your password is a single dictionary word, then even less.<p>What We Did About It<p>The npm registry has been upgraded to Couchdb 1.2.<p>In order to facilitate the use cases where npm needs to read a user's public info, the non-sensitive pieces of the user record are being copied to a /public_users database, and the rewrites have been changed to point to the right places.<p>This means that the npm client continues to work without changes, and that the problem is fixed at the source, rather than relying on adding additional layers. Any downstream replicants of the registry will continue to work with their (exposed) _users databases without any changes.<p>Why Wasn't This Disclosed Sooner<p>It seemed wise to fix the exposure before telling a few thousand people about it. Jason Smith and I deployed the fixes on Monday 2012-03-05. We waited a few days to make sure that it didn't cause any additional problems, and to test things out. So far, it looks solid.<p>I'm very thankful to the handful of people who reported this to me discretely rather than create more drama than necessary.<p>What You Should Do<p>Here are the options:<p>Do nothing. Least secure, most convenient. Probably not enough.<p>If you used a very strong password (eg, some string at least 20 characters or so) for your npm account, then this might be ok. If it was something short, or something you use in multiple places, then please read on.<p>Reset your npm password at http://admin.npmjs.org/reset<p>It's a 3-step process. The thing emails you a link. You click the link. Then you remove the `_auth` line from your ~/.npmrc file, and run `npm adduser` to re-create your account. If you only used the password for npm, and not for anything else, then you're done.<p>If you have an old account containing capital letters or spaces in the username, then you'll need to create a lowercase url-safe version and add it to your packages. Ping me on IRC and I'll help out. (There are only a few of you.)<p>Reset/change the password of any service that has the same password.<p>Because your username and email address are part of the public npm registry data, someone could take the exposed password and try it on facebook, twitter, foursquare, HSBC, Bank of America, and so on. This would not be good.<p>Once again, I'm very sorry about the exposure, and the inconvenience it causes for you. You have a right to be upset. Feel free to email me with your gripes and complaints, as well as any additional questions you might have, or if you have any problems resetting your password.<p>--
isaacs i@izs.me
======
pyrotechnick
<http://codahale.com/how-to-safely-store-a-password/>

<https://github.com/ncb000gt/node.bcrypt.js/>

