On 3 February 2015 at 00:18, Andrew Sutherland <
asuth...@asutherland.org>
wrote:
> In terms of the "privileged" state and permissions, one of the reasons
> for the privileged tier is because of permissions like "tcp-socket" that
> are hard to explain to the user and where the marketplace is helping the
> user make the determination. This can be improved by being able to make
> the permissions more specific
I agree. Building Firefox OS 1.x helped us find what the missing pieces of
the web platform are, and we ended up with a collection of proprietary
Firefox APIs to fill those holes. We should now be looking at ways to
create equivalent standardised Web APIs which can safely expose the same
type of functionality to the web, whether that's through a new API design
or a new UI design. Restricting APIs to only signed privileged hosted web
apps should be a last resort.
On 3 February 2015 at 02:55, Paul Theriault <
pther...@mozilla.com> wrote:
> - what are the benefits to this approach to something like the previous
> hosted packaged apps proposal (bug *1033360* I mean, confusing names ;).
>
It's not clear to me how this proposal will solve the permissions issue or
provide a security model which allows more privileged APIs to be made
available to the web. I assume it would mean signing packages in a similar
way to Firefox packaged apps, but that's not clear from the bugs. Is there
somewhere I can read about that?
Based on my limited understanding of that proposal, benefits of the
privileged hosted apps approach might be:
- It can be retro-fitted to existing hosted web apps which want to
access a privileged API, it doesn't require changing the whole URL
structure of a web app and packaging up all of its resources.
- It's backwards compatible with user agents which don't support
packaging, they can use progressive enhancement when privileged APIs are
available.
- Deep linking to a particular resource doesn't require downloading the
whole package.
- It's potentially compatible with both Service Workers and a hosted web
package solution, but doesn't require either of them. Deciding whether to
package a collection of resources together is orthogonal to whether they
can access privileged APIs or work offline.
Having said all that, if we can solve all the same problems with hosted
packaged apps then I'm certainly not opposed to them in principle, this was
just another option.
> - I guess one benefit is loading only changed resources, but support for
> differential package updates would seem to be a better solution to that
> issue
>
Yes, if only one file of a web app changes you probably only need to update
the manifest and that one file, you could continue to used cached versions
of the other files if the hashes still match. You probably could achieve
something similar with differential package updates, yes.
> - What update model did you envision? Same as current where user approves
> every update?
>
No, same as the web where updates happen transparently.
“Any resource”? Does this include resources for frames? IE are apps allowed
> to frame other content or are they completely siloed from the web?
Apps should be able to frame other content. Also, some files like images
likely won't need hashes. Will CSS files need hashes?
> What about inline-resources (data-URI etc)? I would suggest we allow
> inline, but maybe consider restricting inline with CSP later for privileged
> apps.
>
Sounds fine.
> Another question: what origin are you proposing these apps have? This is
> the part I’m stuck on and I’m not sure of a good answer. IE either the app
> content is same-origin with the content that its hosted with, and you run
> the risk that compromised web content on that domain access data which only
> privileged content can access (i.e. if the privileged app frames web
> content, or opens content with window.open). So we either need to make apps
> not same-origin with web content on the same domain, or somehow prevent
> access from web content into app content.
>
I'm not sure about the answer to this one. How does it work with hosted
apps in B2G today? An origin only has certain permissions when loaded
inside a mozapp iframe with a particular manifest URL set. i.e. The origin
only has those permissions when used inside a privileged application
context with a manifest applied. Can we use that same approach? Are same
origin resources loaded inside an iframe inside a Firefox hosted app
considered same origin with the app?
How do you handle the case when the app has been updated, but the user
> doesn’t have all the previous version assets cached locally?
> Gecko will load the missing resources from the web and they won’t match
> since the manifest is old.
>
> Force them to update to the new manifest version before running the app I
> guess?
>
Yes, I imagine the new manifest would be detected and would invalidate the
cached copies of any resources which no longer match their hashes.
Im interested to explore other options for vetting apps. Not sure developer
> signing is the answer, but could be. Another option might be Marketplace
> signing the apps for the developer. IE on-demand signing, like a
> “unreviewed” state which can still be installed, but maybe a different UI
> from an app that has gone through review?. Centralised signing might be
> easier for developers and also marketplace could keep a record of version
> updates. We probably want to support unsigned/self-signed for things like
> developer beta testing. BTW,
A centralised solution relies on the app developer a) knowing Mozilla
exists and b) caring enough about the Firefox Marketplace to submit their
app there and have it signed by Mozilla. It might make sense from a
security point of view, but I think having a central point of control would
cripple the growth of the web ecosystem. Ideally someone should be able to
create a privileged hosted app for Chrome OS and it automatically work on
Firefox OS too.
> My understanding is that we are moving towards AMO signed add-ons rather
> than using PKI certs.
>
Does that mean developers won't be able to sign their own extensions any
more? What's the rationale behind that?
An attacker could replace the manifest.webapp entirely (and manifest.rsa).
We could enforce the that the signing cert was issues to host domain, but
> the attacker could downgrade the app to a regular web app that doesn’t need
> to be signed. It would lose permissions, but still be able to access data
> stored in indexeddb etc. This risk applies equally to Hosted Packaged apps
> actually if we went that route. Can probably address in update logic, but
> just a thought.
>
I don't have a lot of knowledge in this area but it sounds like if the
certificate it tied to a domain then we're not adding any new risks that
don't already exist. If someone takes control of the server of an existing
web app they can access IndexedDB databases. Someone who compromises the
server of a privileged hosted app still wouldn't be able to modify the app
and access privileged permissions without the developer's private key?
> > "Can we deprecate packaged apps?"
>
> It is not clear to me how this proposal solves that problem. It
> changes how packaged apps can be distributed, but it's still a walled
> garden.
>
Can you explain that in a bit more detail? The apps don't have to be
packaged and the idea is that anyone can host a self-signed privileged
hosted app without any involvement with Mozilla. What part of the proposal
do you think creates a walled garden?
> The only way out I still see is identifying what we learned from
> "Firefox Apps" (and perhaps gathering what Google learned from their
> stores) and applying those lessens to new features for the web:
>
>
https://wiki.whatwg.org/wiki/OS
>
As I said above, I agree that creating standardised versions of our
proprietary Firefox privileged APIs which can safely be exposed to the web
without needing a signed app should be a big part of the solution. So far
that doesn't seem to be happening. This proposal is a last resort for those
APIs which we can't otherwise think of a safe API or UI to enable it to be
exposed to the web. Privileged hosted apps should hopefully be a small
minority of web apps, but would allow us to get rid of the existing
packaged app solution which forces a centralised solution and fragments the
web. Ultimately I hope it would allow us to host Gaia at http://*.
firefoxos.com.
Given that rewriting packaged apps does not accomplish that it seems
> less engineering intensive to keep them around until we get there.
Which part of the proposal did you read as "rewriting packaged apps"?
> And
> perhaps move more resources into platform to get us there more timely.
Sounds great.
On 3 February 2015 at 15:06, Eric Rescorla <
e...@rtfm.com> wrote:
> Why do you say that? Apple signs every app in the iTunes store and their
> ecosystem is vastly bigger than the Firefox ecosystem. It might or might
> not be a good idea to have centrally reviewed apps but I don't see any
> reason to believe it doesn't scale.
>
The web ecosystem is vastly bigger than the Apple ecosystem, and shouldn't
rely on a single point of control. Imitating Apple's walled garden is
exactly what we shouldn't be doing, in my opinion.
>
> It's also important to distinguish between *review* bandwidth and signing
> bandwidth. Just because we centrally sign doesn't mean we need to
> centrally review. For instance, we could have a central signing server
> that signs anything from a registered developer. There's certainly
> no reason to believe that that won't scale computationally.
>
Do we really want to be in the business of automatically signing the whole
web? Why should someone need Mozilla's approval to create a web app anyway?
What if a user decides they don't trust Mozilla?
As long as private keys used to sign an app are kept separately from the
>> app's server, the user is still protected against the server being
>> compromised, and against man-in-the-middle attacks which would invalidate
>> the signed app.
>>
>
> How will we enforce that?
>
It's true we can't stop developers doing stupid things, but I don't think
Mozilla having a monopoly on trust is the right answer. We could explore
other approaches of vetting developers rather than apps, and maybe
blacklisting certificates of developers known to be doing something stupid,
or malicious.
I honestly don't claim to have all the answers, I'm just putting this
forward as a starting point for talking about a solution for web apps which
have some of the benefits of native apps without losing the unique benefits
of the web.
Ben