News for hackers. Stuff that matters.
Re:LastPass autofill exploit by dkopi on Wednesday July 27, 2016 @08:44AM (#12172258)
While that might be an "easy way" - it isn't a secure way in this case.

Since malicious attackers have complete control over the page you're seeing - they can simply replace document.createElement with their own function. And instead of returning a DOM object, they can return an object that returns whatever they want in .hostname

Re:LastPass autofill exploit by asjfkdlf on Wednesday July 27, 2016 @09:01AM (#12172351)
No, that is not possible. Extensions in Chrome run in a different execution context than the website. The website's document.creatElement is different from the extension's.

If the website could override extension functions, attacks would already be possible by overriding Regex functions.

Re:LastPass autofill exploit by dkopi on Wednesday July 27, 2016 @11:18AM (#12173503)
Good point, but that's assuming you're running in the context of the popup and not in the context of a content script. In the popup's script, you are using a new DOM. But in a content script - you're using the same DOM as the client, which can override createElement (and any other function as well).
Re:LastPass autofill exploit by mook on Wednesday July 27, 2016 @12:19PM (#12174107)
While content scripts (in the extension world, meaning scripts running in the context of a content page) shares the DOM with the untrusted page, it does not share the JavaScript wrapper layer around that DOM. This is extra confusing because the global object is a (JavaScript wrapper around a) DOM object.

The untrusted script can override its own view of createElement, but not the extension's view.

Re:LastPass autofill exploit by dkopi on Wednesday July 27, 2016 @12:44PM (#12174341)
Very interesting if true. I'm tempted to build an extension just to check that.

I wonder if a DOM mutation event would be triggered if a content script adds a new link element and changes it's href.

Would I be able to catch that and quickly change the href, before the content script continues to fecth the processed properties?

Re:LastPass autofill exploit by gorhill on Wednesday July 27, 2016 @04:17PM (#12176174)
> Very interesting if true.

It is true. See documentation => https://developer.chrome.com/extensions/content_scripts#exec... :

> Content scripts execute in a special environment called an isolated world. They have access to the DOM of the page they are injected into, but not to any JavaScript variables or functions created by the page. ... The same is true in reverse

Re:LastPass autofill exploit by ufmace on Wednesday July 27, 2016 @05:42PM (#12176725)
I don't know about this specific point, but you might want to take a look at the greasemonkey security pitfalls page [0]. There's been a lot of effort put into how all of these parts work together to make sure that malicious Javascript on the page can't interfere with what the plugin or userscript is trying to do.

[0] http://archive.oreilly.com/pub/a/network/2005/11/01/avoid-co...

Re:LastPass autofill exploit by AgentME on Friday July 29, 2016 @10:36PM (#12191381)
Chrome extensions' content scripts are under stronger isolation from the page than greasemonkey scripts are (or were? -- I'm not sure if greasemonkey has changed since). Chrome extensions run in a separate "isolated world" from the page. They never share javascript objects directly. (They do share the DOM, but the isolated world gets its own separate Javascript wrappers around the DOM.) It's not possible to leak a function from the extension to the page, etc.
Re:LastPass autofill exploit by AgentME on Wednesday July 27, 2016 @01:46PM (#12174957)
The page could only see a mutation event and get a reference to the element if the element was attached to the document. If the extension never attaches the anchor element to the document, then the page's code can't get to it.
Re:LastPass autofill exploit by dkopi on Wednesday July 27, 2016 @03:32PM (#12175840)
Great point! Didn't realize that. Thanks for an informative answer. Definitely learned something new. This is why I'm here.
Re:LastPass autofill exploit by volker48 on Wednesday July 27, 2016 @01:26PM (#12174750)
Even if it is a content script its still not possible. https://developer.chrome.com/extensions/content_scripts#exec...
Re:LastPass autofill exploit by ghurtado on Wednesday July 27, 2016 @12:06PM (#12173971)
My understanding is that the content script can access the webpage DOM, but not the other way around (it's a "one way street", if you will)
Re:LastPass autofill exploit by jxpx777 on Wednesday July 27, 2016 @09:00AM (#12172349)
Disclosure: I work for AgileBits, makers of 1Password.

For desktop browser extensions that are properly using the frameworks, the extension's Javascript runs in its own execution context so the page cannot redefine variables. This protected 1Password when we discovered that a certain page had redefined the global JSON object, which provides parse and stringify functions among other things, to be the number 3, i.e. a numeric constant called JSON. :'D

Re:LastPass autofill exploit by throwanem on Wednesday July 27, 2016 @11:29AM (#12173590)
Out of curiosity, does this apply only to Chrome's extension framework, or to Firefox's and Safari's as well?

Context: I'm a new 1Password user who is contemplating use of the extensions for those latter two browsers, and while it seems probable their extension frameworks offer the level of security you describe, I'd like to be certain before pulling the trigger. Thanks!

Re:LastPass autofill exploit by AGKyle on Wednesday July 27, 2016 @12:00PM (#12173915)
Disclaimer: I work for AgileBits as well :)

Hi there!

Yes, all 3 of the major browsers (and derivatives of them) offer the same support for a sandboxed execution environment. You can safely use any of them if that's a requirement you have :)

Kyle

AgileBits

Re:LastPass autofill exploit by throwanem on Wednesday July 27, 2016 @12:02PM (#12173940)
Neat, thanks!
Re:LastPass autofill exploit by dkopi on Wednesday July 27, 2016 @10:38AM (#12173124)
Great point. Exactly the type of comments I come to hacker-news for!
Re:LastPass autofill exploit by favadi on Wednesday July 27, 2016 @10:32AM (#12173072)
When you are here, is 1password for team is the future and the classic 1password will become obsolete soon?
Re:LastPass autofill exploit by AGKyle on Wednesday July 27, 2016 @11:58AM (#12173892)
Disclaimer: I also work for AgileBits

We really try not to call it "Classic" or anything like that. It's standalone, you're in charge of upgrades, syncing and backups and stuff like that. It's also not designed for sharing (at least to the degree of the Family and Team solutions).

That said, we don't have any immediate plans to remove the standalone products. However, if a vast majority of our users switch to 1Password Family or 1Password Teams (and as of today, an Individual plan!) then it doesn't make a ton of sense to keep the standalone product around. So, it's probably one of those speak with your wallet kind of scenarios.

I'll certainly pass your feedback along, it sounds like you'd like to keep it around.

I hope that helps answer your question :)

Kyle

AgileBits

Re:LastPass autofill exploit by _pghu on Wednesday July 27, 2016 @12:54PM (#12174426)
I also very very very strongly do not want any hosted service requirement for using 1password. I am very proud user of 1P but a hosted requirement would kill it for me. No matter how much you (the generic 'you') tell me you're super secure, nothing will be as secure as owning my own data and using local Wi-Fi sync to put it on my phone.
Re:LastPass autofill exploit by bad_user on Wednesday July 27, 2016 @01:52PM (#12175029)
Would you feel the same about encrypted data stored in Dropbox? IMHO it is better because you have more control and storage is decoupled from UI.

Anyway, I gave up on both 1Password and LastPass. I've been a 1Password user for about 2 years before I switched to KeePass.

To be more specific, for the desktop (OS X, Linux, Windows) I use: https://keeweb.info/

For Android: https://play.google.com/store/apps/details?id=keepass2androi...

And for iOS, though be warned this one is subpar: http://minikeepass.github.io/

All 3 apps are open-source. This is important because open-source will not die for as long as there is demand and more importantly, you own it.

No, I'm NOT against proprietary software, as I said, I gladly paid a premium for 1Password. However their Windows client is basically unmaintained, their new "modern Windows" app is still alpha and doesn't work with Wine and of course, they have no Linux support. Most aggravating is that they are clearly switching to a subscription model, with all of their development effort going towards it lately. No more Everywhere interface for OpVault, no new sync options other than Dropbox and iCloud, etc. In other words I'm tired of bait and switch models and one is in progress here.

Re:LastPass autofill exploit by wlesieutre on Wednesday July 27, 2016 @01:39PM (#12174882)
Seconding this. I generally dislike hosted subscription offerings, especially for a password manager, and even more especially for one that I've already purchased four different licenses to (Mac, Windows, iOS, Android).
Re:LastPass autofill exploit by AGKyle on Wednesday July 27, 2016 @01:35PM (#12174837)
While I understand your concern, and to some extent, sure, you're right that owning your own data does reduce certain attack vectors it's also a trade off that a vast majority of people don't have to worry about either.

But the real important thing to consider is whether the protection you would get from a hosted solution so above and beyond overkill that it matters?

If you're curious why I feel that way, we have written up a white paper on how 1Password Teams (and therefore Families and now Individuals) stores and secures your data.

https://1password.com/files/1Password%20for%20Teams%20White%...

We designed 1Password so that we cannot know anything about your data. We also designed it knowing full well that our servers would be a target. So, we designed it in such a way that if a malicious person were to acquire your data there's more or less nothing they can do to acquire the decrypted data.

What we settled on is having two secrets. Both of which are not known by us. The first is your Master Password, something that you're likely well aware of having used 1Password already. The second part is an Account Key, which is a random 128-bit key generated locally. These two things are never given to us and should never be shared. They are both used for the cryptographic functions in 1Password. Without them both, you can't see the decrypted data.

This is unique in that it actually protects weak master passwords. That's the big deal to worry about if our database of user data is compromised. The first attack is to start running password cracking tools against it to try to find the weak passwords. Except in this case, there are no weak passwords because even if your master password is "a" the attacker still needs your Account Key, which looks something like this:

A3-Z4JZ6V-P9BALK-S6J69-FAXCN-LTDY8-T3QHJ

So, now a password cracker is going to have to guess all those combinations of weak passwords against something much much stronger as well. I wish them luck because the math more or less makes this impossible if a user uses a strong master password as well.

There's some math in the white paper if you're curious about more.

Knowing how it works and how extremely unlikely it is that I am such a target that someone is going to literally spend millions upon millions of dollars trying to crack my account (and still likely get nowhere)... I'm small fish, it just isn't worth it to even try.

Either way, for the sake of learning (I love learning, so I always assume others do as well), I would recommend reading the white paper, if not only to gain some new knowledge that you may not have been exposed to previously. If you have, awesome!

As always, if you have questions let me know!

Kyle

AgileBits

Re:LastPass autofill exploit by jamie_ca on Wednesday July 27, 2016 @02:25PM (#12175325)
Please do consider keeping the standalone apps. Not having my passwords stored on someone else's server (encrypted or not) is why I'm a 1Password user (and likely buying an upgrade license this month to load it on my other windows box). Similarly why I've bought and upgraded Arq to store backups on storage I control.
Re:LastPass autofill exploit by sondr3 on Thursday July 28, 2016 @09:33AM (#12180049)
I'm probably being daft but I can't find the Individual Plan on 1Passwords homepage, any idea where I can find out more about it?
Re:LastPass autofill exploit by AGKyle on Thursday July 28, 2016 @11:20AM (#12180757)
Sorry about that, we haven't officially announced it but it is available when you start the sign up process.

https://start.1password.com

It is $2.99/mo when billed annual ($3.99/mo month to month), includes all of the applications as part of the subscription price.

It is otherwise based on the same technology as Family and Teams options. It's basically Families with only 1 user.

Re:LastPass autofill exploit by JackC on Wednesday July 27, 2016 @09:04AM (#12172374)
I think the point is that this would run in a document belonging to the LastPass extension -- not that it would run in javascript injected into the target site.

The same attack you describe could be applied to basically any javascript you cared to write (say, String.prototype.length). The safest approach is to treat the output of injected javascript as untrusted third-party input to your extension code and work from there.

Re:LastPass autofill exploit by Navarr on Wednesday July 27, 2016 @09:00AM (#12172345)
At least in Chrome, I'm imagining the raw url would be sent to a background process that is sandboxed from the webpage and would then do the createElement stuff.