Live data from Hacker News

Angular 1.x Banned from Firefox Addons

github.com

181–190 of 222 posts

Re: Angular 1.x Banned from Firefox Addons

#181

Earlier quoted context omitted.

What's the rationale for disclosing vulnerabilities to for example Google before going public (unless the bug is in Google's software)?

Because big players can take remedial action prior to the bug being disclosed to protect users - for example, banning a specific framework from browser extensions.

That sounds like an unfair advantage over smaller competitors to me.

Re: Angular 1.x Banned from Firefox Addons

#182

Why not use Google Caja instead of a separate sandbox?

Overkill for what was never intended to be a sandbox for untrusted code. The “sandboxing”, like Django templates’, Jinja, Nunjucks, etc. is a well-intended measure to keep logic out of templates, but in practice only really gets in the way and causes mistaken assumptions about security.

Re: Angular 1.x Banned from Firefox Addons

#183

> My information is that Google stopped supporting angular 1.x months ago. It is now a community driven project. I totally missed this - was there a notice of this posted somewhere?

This is not correct. Development of 1.x is still very much under Google's control.

Re: Angular 1.x Banned from Firefox Addons

#184
post #143

Earlier quoted context omitted.

I think his point is that running the entire Angular 1.x framework to power a browser extension gives a large attack surface.

Yes. And to answer nchelluri's question: Auto-typing, though I believe that's available only on desktop operating systems.

> though I believe that's available only on desktop operating systems.

And on Android (where you set up the password manager as a custom keyboard), and possibly an iPhone

Re: Angular 1.x Banned from Firefox Addons

#185

So, there's so many problems with this i don't know where to begin. Since folks have already noted the "not notifying google" issue, let me point out another: Prior to banning, i can find literally no discussion or details about this being about to happen (IE no notice), pretty much ever. You can see it was initially noted here: https://github.com/mozilla/addons-linter/commit/86f4dfb44355... I can find no discussion…

Google has repeatedly been equally abrupt in making breaking changes to other people's apps/products/pages/sites to resolve security problems. I'm glad they do, and I'm glad Mozilla isn't fucking around with stuff like this either.

I'll assume this is true (not my area!):

1. Just because one guy is an idiot does not mean the other should be.

2. You know, you may want to tell people and establish a process for telling people that this is happening (ie it should not take until person files github issue asking what's up when they validate their app to know what's going to be okay and not)

(and if the answer is "google doesn't do that", see #1 :P)

Re: Angular 1.x Banned from Firefox Addons

#186
post #159

Many commenters here seem to be completely misunderstanding the situation. Browser extensions are really dangerous; if you need to keep your machine secure, you shouldn't use any IMHO. By definition, browser extensions need to be able to access things such as page content. What would stop someone from writing a extension that captures your bank credentials? Nothing. Obviously no security-conscious user is going to in…

Why is Angular from the extension run on DOM from the page?

You make it sound automatic, but surely this must be manually triggered by the extension in question?

Re: Angular 1.x Banned from Firefox Addons

#187

Earlier quoted context omitted.

> It's probably possible to sanitize all external inputs used in the browser extension such that privilege escalation isn't possible, but the Angular team has tried hard with their sandbox solution with no success. Extension developers will hardly do much better, so it makes sense for Mozilla to ban the whole library. Sandboxing in JS should be possible these days. Spin up an iframe, add the sandboxing attribute, loa…

You can't run code that depends on variables in the page context though. If all the input values are serializable, then you can postMessage them into the iframe too, but you can't serialize objects with arbitrary methods, etc. The code you run in the sandbox can't return back a rich object with arbitrary methods because that has to get serialized back out. You can't use getters and setters to transparently proxy all…

I believe you could solve the garbage collection problem with WeakMap.

Re: Angular 1.x Banned from Firefox Addons

#188

Earlier quoted context omitted.

You can't run code that depends on variables in the page context though. If all the input values are serializable, then you can postMessage them into the iframe too, but you can't serialize objects with arbitrary methods, etc. The code you run in the sandbox can't return back a rich object with arbitrary methods because that has to get serialized back out. You can't use getters and setters to transparently proxy all…

I believe you could solve the garbage collection problem with WeakMap.

Maybe if you use a WeakMap with a transferrable object and assuming that if you postMessage a transferrable object and then get it back later and still have the WeakMap recognize it as a key. I'm not very sure that last part would work. I don't think GC-links reach through iframes in a way that would enable that.

WeakMaps are more limited than most people seem to expect. They're powerful tools that enable many new powerful patterns, but they don't expose the workings of the garbage collector. They're very different from Java's WeakHashMap for example. In Javascript, the only way you can tell whether the browser is using a garbage collector or not is to try to run out of memory. Without crashing, there's no way for some Javascript code to observe the runtime's GC behavior at all by design.

Re: Angular 1.x Banned from Firefox Addons

#189
post #159

Many commenters here seem to be completely misunderstanding the situation. Browser extensions are really dangerous; if you need to keep your machine secure, you shouldn't use any IMHO. By definition, browser extensions need to be able to access things such as page content. What would stop someone from writing a extension that captures your bank credentials? Nothing. Obviously no security-conscious user is going to in…

Why is Angular from the extension run on DOM from the page? You make it sound automatic, but surely this must be manually triggered by the extension in question?

If an extension wants to modify the DOM of a page, then it runs with the DOM of the page.

Re: Angular 1.x Banned from Firefox Addons

#190
post #44

Earlier quoted context omitted.

No, the vulnerability specifically has to do with Angular within extensions. Angular trusts the page DOM and uses eval-like functions on code within it. This is relatively fine if the DOM isn't controlled by someone else, but in cases where the DOM is controlled by someone with less permissions (ie. Angular is running in a higher-privilege extension, and the DOM is controlled by some webpage), then then an attacker c…

Don't extensions have their own DOM (like they have in Chrome)? Why would anyone run Angular on a browser page? It would probably conflict with existing application. It looks like Firefox extension architecture has design problems. And I don't like the presentation. One could think that Angular is vulnerable which is not true. The vulnerability appears when it is used in a wrong way in a browser extension.

The presentation is fantastic. It proves beyond a doubt that Angular is vulnerable in the context that it claims to offer a security feature that is manifestly insecure. And I mean, they're evaling JS code in the template engine, this shouldn't be a surprise. To be clear, Angular from its inception claimed to offer "safe" templating. So this is a big deal.
Post reply on HN