Apps/SecurityDetails: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 113: Line 113:
B2G will support two formats for distributing apps. The most simple and "web-like" format is a "hosted" app. A hosted app consists solely of an [http://mozilla.github.com/webapps-spec/ application manifest] file on the developer's web server. Often the manifest will also point to an appcache manifest which allows an app to be cashed for faster startup and to enable offline usage, but otherwise doesn't affect the app at all.
B2G will support two formats for distributing apps. The most simple and "web-like" format is a "hosted" app. A hosted app consists solely of an [http://mozilla.github.com/webapps-spec/ application manifest] file on the developer's web server. Often the manifest will also point to an appcache manifest which allows an app to be cashed for faster startup and to enable offline usage, but otherwise doesn't affect the app at all.


From a security point of view, hosted apps work very much like normal websites, except that they have the ability to enumerate extended privileges in the application manifest. And, like all apps, they are subject to the application sandbox described above.
From a security point of view, hosted apps work very much like normal websites. When a hosted app is loaded, the URL of the loaded pages are the normal URLs that those pages have on their web server. So to link to a specific page or resource in the app, the same URL is used as when linking to that page or URL on the website.
 
This doesn't change the fact that hosted apps, like all apps, are subject to the application sandbox described above.


In order to secure that an app really wants to be installed as a web app we have to ensure that it's not possible to trick a website into hosting an application manifest. This is done by requiring that the manifest is served with a specific mime-type, "application/x-web-app-manifest+json". This restriction is relaxed when the manifest app, and thus the app manifest, is same-origin with the page that requested the app to be installed.
In order to secure that an app really wants to be installed as a web app we have to ensure that it's not possible to trick a website into hosting an application manifest. This is done by requiring that the manifest is served with a specific mime-type, "application/x-web-app-manifest+json". This restriction is relaxed when the manifest app, and thus the app manifest, is same-origin with the page that requested the app to be installed.
Line 119: Line 121:
== Packaged apps ==
== Packaged apps ==


The second distribution format that B2G will support is packaged apps. A packaged app consists of a normal zip file which contains both the manifest and the application resources.
The second distribution format that B2G will support is packaged apps. A packaged app consists of a normal zip file which contains both the manifest and the application resources. When a packaged app is installed, the zip file is downloaded and the manifest is read from a well-known location inside the zip file.
 
When a packaged app is installed, the zip file is downloaded and the manifest is read from a well-known location inside the zip file.


Unlike a hosted app, packaged apps doesn't have an obvious URL that their resources can be loaded from. The way to refer to a resource in a packaged app is by using the <code>app:</code> protocol. The format for a


loaded through app protocol
loaded through app protocol
Confirmed users
716

edits

Navigation menu