Hacker News new | ask | show | jobs
by fmarier 4659 days ago
I think you might be confused with how Persona works, it's not quite like OAuth. There is no "token" in Persona, we have keys and assertions.

The first step is for your browser to generate a public and secret keypair. Then you send the public key over to the identity provider to get it signed.

Once it's signed, you use your secret key (which never leaves your browser) to sign an assertion. The assertion contains your signed public key and an expiration, but it's also tied to an audience (i.e. the URL of the site you're logging into). That's what you send to the site you're trying to log into.

So if that site tries to impersonate you on a different website using the assertion you just gave it, it won't work because it can't change the audience that's inside the assertion (that would break the signature on the assertion). If the audience doesn't match, no other site will accept it.

Of course if a site steals your secret key from localStorage, then it's game over. However if you find a way to do this, then you've got yourself a browser 0-day :)

1 comments

Or you just have a virus that searches the RAM where the browser sits. Or a deliberately compromised browser.

You're right, Persona is safe from e.g. MITM attacks. Really, it's a good structure, I like it. But as usual, a virus means game over, and in Persona's case its structure means game over in a uniquely crippling way that you really can't protect against. That's the tradeoff for your provider not being able to watch where you log in.

If I never reuse my passwords, or use e.g. an external tool (something like a yubikey, though I can't speak to that one in particular), the worst a virus can do is steal one site at a time. If a virus steals my OAuth token, it can be revoked. If someone gets my OpenID login details, hopefully my provider would notice something is up when requests start coming fast and furious, and start rejecting them.

And all of that is just as secure against MITM as Persona if I run it through SSL.

This is of course assuming no 0-day on the device / my webcam to snap a photo of where I wrote down all my passwords on post-its and stuck them on my laptop. But browser 0-days aren't all that rare, and viruses certainly aren't.

I assume you are using the term virus interchangeably with malware. Because the purpose of a virus isn't to steal or wiretap your device, it's sole purpose is to destroy. That being said, if you happen to get a virus then your device will most likely malfunction, certainly it's possible that a virus steals information but that's a long shot.

Viruses kill, they were created for that.

But since you mentioned it, I think the risk of malware exists and will continue to exist even if you are using passwords

Think key loggers.

Yeah, virus/malware/choose your term. I'll happily settle for 'malware', it's descriptive.

Key loggers only get what I type in. And the value of the material they logged is lost as soon as I change the valuable bits without it being logged. Easily enough done with a phone call to my bank or a friend's computer or a clean install. I use unique passwords everywhere - I can prevent extensive damage with that alone.

(edit: also two-factor auth / one-time-passwords almost totally nullify keyloggers)

Lose your Persona signing key, and you can't stop it. It lives as long as the key claims to live. Imagine someone stole your credit card and is making massive purchases, but there was no way to cancel it, it would just continue pulling from your account until the expiration date on the card. Now tell me why that doesn't concern you when compared to e.g. someone stealing the cash in your wallet.

One thing to note as well is that if a virus steals your email password, then you're a bit screwed too because that can, in most cases, be used to reset your password on other sites.

As we've seen with a bunch of high-profile compromises, the email account is already an extremely valuable target for attackers. Another good reason to enable 2-factor auth there!

Yes, but, if you change your password / answer your security questions to get back in you get control back.

Now say they get your Persona email account, and get the signing material from it once. They can now log in everywhere until that material expires. There's nothing you can do about it. THAT is very different.

There's a small thing you could do to mitigate this, but really only self-hosted email has it as an option: change the email server's keys. You would be able to block logins to any site which has not cached those keys.

But no big provider would do it for you, since it would break everyone's currently-live keys, and from what I can remember they recommend that sites using Persona login cache the keys[1]. So any site you had logged into may very well have cached them, and not even perform a web request, and still allow the malicious login.

--

The only real way to dial back this damage is to limit the lifetime of the original signature. Make it too short and slow internet connections can't log in anywhere, and browsers have to continually request new assertion-signing data. Make it too long and you let attackers try many, many, many more sites.

[1]: I can't find this on the Persona/BrowserID site :/ maybe it was in a presentation somewhere. Anyway, it's inherently cache-able material, and it is a great selling point - server-side web requests are painfully slow.

Yes, your best protection is a short-lived signature on the user's public key. That's up to the identity provider to decide.

On our internal Persona IdP (for mozilla.com and mozillafoundation.org email addresses), the signature is short-lived (a few minutes I think). The browser will therefore need to request a new signature very often. This can happen transparently as long as you still have a session with the IdP and that session can be invalidated server-side in case of a compromise (or a password change).