Security/Reviews/B2G/DownloadManager

From MozillaWiki
< Security‎ | Reviews‎ | B2G
Revision as of 02:14, 31 January 2014 by Ptheriault (talk | contribs)
Jump to navigation Jump to search

Overview

  DRAFT REVIEW: this review is still in progress

FirefoxOS Review Details

Context

Download Manager API allows certified web apps (with a permission) to control downloads on Firefox OS. The API allows web apps (as opposed to chrome privileged content on desktop) control downloads by interacting with Downloads.jsm

Any HTTP response with content type of "application/octet-stream" will cause the file to be downloaded. The files are saved to /sdcard/downloads/ on the filesystem.

Scope

  • What parts of Gaia, Gecko and or Gonk are we looking.

The following system components were reviewed:

  • Gaia (modified apps)
    • System app
    • Settings app
  • Gecko
    • navigator.mozDownloadManager
    • interaction with existing Downloads.jsm code

Components

The main file responsible for Download Manager API is:

Dl-manager.jpg



Relevant Source Code

Gaia

System App
Settings App
Shared Code

Gecko

WebIDL File for mozDownloadManager
Parent Process
Child Process


Permissions

Settings and System are only apps with certified ‘downloads’ permission.

 "downloads": {
   app: DENY_ACTION,
   privileged: DENY_ACTION,
   certified: ALLOW_ACTION
 },

Permission Model

Settings and System are only apps with certified ‘downloads’ permission.

  "downloads": {
    app: DENY_ACTION,
    privileged: DENY_ACTION,
    certified: ALLOW_ACTION
  },

Review Notes

1. Content/Chrome Segregation

DownloadsAPI is implemented using WebIDL. There was a lot of discussion around what to expose in the case when a page does not have the permission present - see bug 957592 for details.

2. Process Segregation

3. Data validation & Sanitization

4. Denial of Service

Security Risks & Mitigating Controls

Actions & Recommendations

  • List of recommendations, and corresponding bug numbers
  • For sensitive bugs, just put bug number (or omit entirely maybe it is really dangerous & obvious)