views:

84

answers:

2

I'm developing a Firefox plugin using XPCOM, I've not yet read all the docs, but as far as I can see, A plugin is simply a DLL that provides services via a XPCOM interface and interacts with the browser via XPCOM interfaces. Since the plugin itself is a native DLL, how would the security model work? Would it rely on the fact that the user trusts the plugin not to do nasty stuff, like with OCX controls?

I can't see any other way it could be secured... Is there?

A: 

XPCOM does not seem to be intended for plugins, but rather applications, so security is not modelled.

bmargulies
+2  A: 

Just to clarify a few definitions, as far as I know, in Mozilla-land:

  • a plugin is something that is used to render content via the NSAPI (think Flash, PDF, ...) and is normally not using XPCOM
  • an extension is a package that extends Mozilla/Firefox via XUL and/or XPCOM, which can contain components and/or XUL GUI stuff.
  • a component is a provider of XPCOM services and can be written in Javascript or as a native shared library/DLL

So I guess, what you want to do is an extension consisting of a component.

As an answer to your question: You are right, as soon as the user installs an extension, he is agreeing to trust that one. Even if it consists of Javascript code, it has automatically more access than web site Javascript.

Steffen