News for hackers. Stuff that matters.
Re:Scramble.io: secure email for everyone by orthecreedence on Tuesday November 05, 2013 @02:13PM (#6677363)
Perhaps I'm ignorant, but I've read your "JS crypto considered harmful post" and I disagree with the key points.

1. Browsers, at least the ones that matter, provide window.crypto (with a CSPRNG). This makes generating IV's for CBC "safe," makes generating RSA keys "safe," makes generating random keys "safe." Or am I missing something? Assuming the JS crypto code itself is actually sound, the PRNG seems to be the missing link...or at least, it was.

2. Packaging the entire app as an addon (assets, javascript, views, everything) means the app can be signed and verified. No in-app code updates. If you want an update, download the latest extension. The article assumes that people will do what OP is doing: downloading code and running it dynamically. I agree this is a no-no, even if verifying.

Is there some sort of attack vector I'm missing? I think it's fair to assume the browser is an attack vector, just like hardware is, just like the OS is, or whatever language VM you're running on, etc...but that seems tangential to the process of packaging/signing an entire javascript app and distributing it as an add-on. I also know about the unsafe memory stuff, but this just brings browser encryption down to the level of Python/Ruby/etc. I'm not dismissing this concern, I'm saying that if you're attacking javascript for having this vulnerability, you must also attack any GC language (which you do in the article).

How is in-browser encryption so different from any other java/python/etc app when packaged/signed? I'm not talking about replacing SSL, I'm talking about encrypting data via AES/blowfish in a browser extension with a key generated from a password, and if the data leaves the browser, using SSL on top of that.

What makes it impossible to do this and gain the same level of security as any other language/platform?

Re:Scramble.io: secure email for everyone by tptacek on Tuesday November 05, 2013 @02:27PM (#6677483)
We are not talking about crypto done in browser extensions. We're talking about a project that knows about extensions, knows how to package their project as an extension, but refuses to do so, because that would cost them users, who generally don't want to install extensions.
Re:Scramble.io: secure email for everyone by jaekwon on Tuesday November 05, 2013 @09:37PM (#6680194)
Let's try to keep things friendly, or at least correct. We haven't refused anything. Everything is on the table.
Re:Scramble.io: secure email for everyone by tptacek on Wednesday November 06, 2013 @12:17AM (#6680851)
Your partner, just upthread, explained why you tabled the idea of using a browser extension to house all the logic for your app. I think your argument is with them, not me.
Re:Scramble.io: secure email for everyone by jaekwon on Wednesday November 06, 2013 @02:24AM (#6681321)
You falsely accused us of refusing to offer a browser extension for fear of losing users. Again, that is false.
Re:Scramble.io: secure email for everyone by marcinw on Tuesday November 05, 2013 @03:22PM (#6677950)
Java, Python, etc don't have a DOM to consider.

When you're just an XSS away from an attacker doing:

  function encrypt(plaintext) {
    $.post(plaintext, ...);
    return plaintext;
  }
then you lose. The post talks about this, and XSS isn't the only way either.
Re:Scramble.io: secure email for everyone by rubbingalcohol on Tuesday November 05, 2013 @03:36PM (#6678068)
If all of the Javascript code and application functionality is bundled into the add-on, it's trivial to avoid XSS. There's no "site" to script into via the URL, and rendering of dynamic elements can be done via a sandboxed iFrame, preventing any scripts from running within dynamic data. This is fairly basic security that any add-on developer should be aware of: http://developer.chrome.com/apps/sandboxingEval.html

"XSS isn't the only way either." That's about as illuminating as saying "something bad could happen."

No one is saying JavaScript or browser security is perfect, but if you actually know what you're doing, it can be done properly.

The original "JavaScript security is doomed" Matasano article is extremely out of date at this point, and yet people keep referring to it like it's gospel.

Re:Scramble.io: secure email for everyone by tptacek on Wednesday November 06, 2013 @11:32AM (#6683527)
I don't like the article either, but you're wrong about it being "extremely out of date", and you'd have a very hard time defending your argument with evidence. Do try.
Re:Scramble.io: secure email for everyone by orthecreedence on Tuesday November 05, 2013 @03:28PM (#6677989)
Right, but an attacker needs access to the DOM first. If everything is packaged, this is just as difficult as being able to inject random python code.

Sure, you can set up your app to stupidly do evals everywhere, but you can program a bad app in any language.

> XSS isn't the only way either

That's very, very vague. I asked what the attack vectors are. Saying "others" doesn't really work for me.

Re:Scramble.io: secure email for everyone by marcinw on Tuesday November 05, 2013 @03:51PM (#6678190)
Right, like getting access to the DOM was ever a hard thing to do. I was specifically referring to web apps in that point, but because you insist, I'll just reference [1].

Another vector to get rogue JS into a user's browser is cache-poisoning, something the article also brings up.

[1] http://media.blackhat.com/bh-us-12/Briefings/Osborn/BH_US_12...

Re:Scramble.io: secure email for everyone by rubbingalcohol on Tuesday November 05, 2013 @05:00PM (#6678721)
Cache poisoning won't work if an extension loads all of its code from its own bundle. So I fail to see how this applies to an app that is fully self-contained within an extension (extensions themselves are signed, so it's not like you could MitM the extension bundle itself...)