Security/Reviews/Gaia/DownloadManager

From MozillaWiki
< Security‎ | Reviews‎ | Gaia
Revision as of 21:57, 16 January 2014 by Rfletcher (talk | contribs) (→‎Issues)
Jump to navigation Jump to search

Download Manager API

Review Details

Overview

Download Manager API handles downloads on Firefox OS. The settings and system applications are the only applications that have the certified 'downloads' permission and they are responsible for managing downloads. The system application handles the download event and the settings application has a "Download" section that allows a user to view, delete, stop, and restart current downloads. When a download is initiated, a notification is created in the notifications pull down menu.

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.

The main file responsible for Download Manager API is:

Dl-manager.jpg

Gaia

Code

System App

Settings App

Shared Code

Permissions

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

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

Gecko

Code

WebIDL File for mozDownloadManager

Parent Process

Child Process

Downloads.jsm

Downloads.jsm depracates nsIDownloadManager and is used in Download Manager on FxOS. Downloads.jsm provides single point of entry for all things relating to downloading.

Downloads-jsm.jpeg

Features

  • 906255 - ability to view status of downloads
  • 906256 - ability to cancel downloads
  • 906257 - ability to view list of previously downloaded files
  • 906265 - ability to open downloaded files with supported MIME types
  • 848371 - ability to download any content through Browser to the SD Card(including HTTP downloading)

Conclusion

Attack surface is greatly reduced through the combination of using WebIDL, 'downloads' permissions is Certified, and the fact that Download Manager API uses the new Downloads.jsm.

Future Work

Issues