Relying on "best practices" is always a security disaster waiting to happen, if you don’t enforce security and separation in the design of the APIs and languages already, you won’t get security.
Relying on "best practices" is always a security disaster waiting to happen, if you don’t enforce security and separation in the design of the APIs and languages already, you won’t get security.
I don't get this thinking at all. Browser addons are trusted. That's the point - they have special privileges to adjust browser behaviour.
If you go around installing malicious addons, you get no more sympathy from me than if you'd gone around installing malicious kernel modules.
For example, Firefox’ screenshot addon would inject HTML into the page, and then the page could take the screenshot’s data and use it.
Addons currently have no way to reliably display their own UI on top of the page, without the page intercepting it.
I agree, addons' workings shouldn't be exposed to untrusted websites.
The extension permissions API already offers enough restrictions. As a user, I simply do not install extensions that need access to all pages, or I only enable them on pages where I need them.
It’d be much more secure to allow the extension to do that without requiring it to put this into the page.
For example, currently you have the DOM of the page, and the extension’s UI is injected into it.
It would be preferable if you’d treat each tab as if it was like
<tab>
<browser src="actualpage"/>
<overlay src="extension1"/>
</tab>
This way an extension that wants to show secure UI on top could do it, and style it, but without it being accessible to the page itself.I think you could use the Shadow DOM in closed mode to prevent any information from leaking. [1]
[1]: https://blog.revillweb.com/open-vs-closed-shadow-dom-9f3d742...
Ideally you’d want to allow addons to modify pages in a way that pages can not detect or interfere with.
(e.g., some newspapers used to run JS to remove the AdBlock "block this" UI whenever you tried to remove an ad)
If it’s a message in the browser chrome itself, and not as <div> in the page, it is possible to add distinguishing UI.
With the current system, it’s literally impossible to distinguish the UI
An extension can stuff its UI within an iframe that the host page can't manipulate, but that does come with some UI limitations.