Changes

Jump to: navigation, search

Security/Sandbox/Hardening

192 bytes added, 05:11, 2 December 2016
no edit summary
In the section below “content process” refers the “Web Content Process” unless otherwise specified.
===File access===
'''Threats'''<br>
Compromised child process read or modifies user data or systems files. Arbitrary file write is equivalent to arbitrary code execution.
'''Objectives'''<br>
Protect user data and sensitive configuration file in the event of a compromised content process. By default the sandbox should block access to files in the content process, and any necessary exceptions (e.g. reading program files, writing temp file etc) must be mediated by the Chrome process.
'''Controls'''<br>
On all platforms, access to the filesystem is mediated by a file broker running the Chrome process.
The GMP process has no access to file system at all.
'''Open Issues'''<br>
# The file content process is currently allowed to access remote content, and this is likely to remain as conceptually locally hosted webpages may legally request remote resources. A remote attacker able to coerce the browser to initiate the File Content process to load a nested resource such as iframe, would be able to bypass the file read restrictions of the Web Content Sandbox. We need to ensure that this is not possible.
# What is the file access policy for the WebExtension process? Can we increase restrictions of the content process sandbox post-depreciation of old-style addons?
Network architecture is already such that low-level connectivity and security decisions are implemented in the parent process. For detail, see [Necko:_Electrolysis_design_and_subprojects]. This gives us a strong basis to enforce security rules on network traffic.
'''Threats'''<br>
Attack local system services or connect to resources behind firewalls.
De-anonymise VPN users?
'''Objectives'''<br>
* Direct network access is prohibited in the content process
* All network access is provided through the chrome process
* Global network restrictions (e.g. no connections to low numbered TCP ports) should be enforced in the Chrome process
'''Control'''<br>
* Necko is remoted such that all access is performed through the content process
'''Open Questions'''<br>
* Access to low ports could & should be restricted? Do we do this already?
* Does all network access go through the parent (via necko)? If not, what connection are directly initiated from the child?
The main consequence of this architecture is that the content process talks to the GPU directly, and subsequently needs access to low-level APIs to facilitate this communication. While there are plans to move compositing from the parent process to a separate GPU process (roughly FF53), the focus of this project is to improve stability and is not expected to meaningfully reduce the privileges required in the child process.
'''Out-of-process Compositor (aka GPU Process)'''<br>
* Plan to move compositor from parent to separate process (roughly FF53)
* Largely would not affect sandboxing efforts, as child still requires access to the GPU. One benefit may be that on Windows, window handles (HWND) would not be required in the child process
* GPU process will benefit linux greatly because it will move the X11 connection to the GPU process (instead of the child)
'''Threats'''<br>
* Historically graphics system calls have been common privilege escalation path (e.g. GDI on windows)
* Access to X on linux is significant attack service and direct security threat
'''Objectives'''<br>
* Reduce attack surface from content process
* Allow stronger windows sandbox levels by reducing necessary syscalls in content process
'''Controls'''<br>
* tbd
'''Open Questions'''<br>
* Communication with GPU limits the restrictions that can be placed on child process
* Windows: access to GPU prevents the use of the Untrusted integrity level sandbox
===DOM===
'''Threats'''<br>
* Privilege escalation through implementation bugs
* Broken security model allows sandbox bypass
'''Objectives'''<br>
Dom API have chrome and content components. Need to ensure that security model for DOM APIs respects sandbox (ie all security decisions, permission checks etc must be performed in the parent).
'''Controls'''<br>
* tbd
'''Open Questions'''<br>
* Audit of DOM API IPC underway
===Script Execution===
'''Threats'''<br>
* JS engine presents the largest attack surface in the browser
Objectives
* All untrusted javascript to be executed in the child
'''Open Question'''<br>
* What JS code is executued in the Chrome process?
* What JS contexts exist?
** Web content
'''Controls'''<br>
tbd
'''Open Questions'''<br>
* Parts of service workers are currently executed in the parent.
=== Web Content (HTML, CSS, XML, SVG) ===
'''Objective'''<br>
All parsing and execution of untrusted content to be performed in the child
'''Controls'''<br>
'''Open Questions'''<br>
=== Printing & Fonts ===
Played back in the parent
'''Objective'''<br>
* Strategy is to trigger printing from the parent, not the child.
* How is data passed from child to parent? (shared memory, files? )
=== TLS Stack ===
'''Threats'''<br>
* Attacking NSS code
* Putting fake certs/creds etc in the trust store
* Direct file access to steal keys e.g. client certs?
'''Objectives'''<br>
* Content process should not be able to modify certificate database (add certs, exceptions etc)
*
'''Controls'''<br>
* nsISiteSecurityService (security/manager/ssl/nsISiteSecurityService.idl) deals with HPKP/HSTS
** Underlying DataStorage checks to see if we are in the parent process before reading/writing, if in the child, asks parent to read/write, so for this we should be able to exclude the HPKP/HSTS database from read/write in child. Child needs to do this in order to alter entries based on headers.
Note: sandbox can not restrict access to web crypto (child can load any origin, so can load any origin’s data)
'''Open Questions'''<br>
* Is PSM remoted securely? How are certificate exceptions handled?
* Check where the following:
=== DevTools ===
'''Open Questions'''<br>
* What is the process model?
* What is in parent vs child?
=== WebRTC===
'''Threats'''<br>
* Unauthorized camera and microphone access
* Eavesdropping on existing connections
* Raw socket connections
'''Objectives'''<br>
Camera/Microphone
* Requests for camera and microphone mediated by the Chrome process
Network Connectivity
'''Controls'''<br>
Camera/Microphone
https://bugzilla.mozilla.org/show_bug.cgi?id=1177242
'''Open Questions'''<br>
* What other threats exist with WebRTC and the sandbox
** Socket Connectivity
===Media Playback===
'''Threats'''<br>
* Mainly just attack surface for priv esc?
'''Objectives'''<br>
* Support media playback while minimizing attack surface
* Remote audio to the parent to minimise syscalls necessary in the child (allowing tighter sandbox restrictions)
'''Controls'''<br>
'''Open Questions'''<br>
* Linux?
* Libcubeb - Audio interfacehttps://dxr.mozilla.org/mozilla-central/source/media/libcubeb/src/cubeb-internal.h#14
=== Firefox Preferences ===
'''Threats'''<br>
* Ability to change arbitrary preferences is equivalent to code execution
'''Objectives'''<br>
* Restrict access to preferences in the content process to an absolute minimum
'''Controls'''<br>
* Whitelist of prefs which child can write to
* Can only simple prefs
* Actual prefs live in parent
'''Open Questions'''<br>
=== Printing ===
'''Threats'''<br>
* System calls involved in printing is historically dangerous attack surface for kernel privilege escalation
Objectives
* Remote access to the parent to minimize access to the parent
'''Controls'''<br>
Printing pages are remoted to the parent: the content process serializes the document to the parent which interprets it.
=== Other things: Places, History & Bookmarks etc? ===
'''Threats'''<br>
* Implementation of the remoting of this functionality presents privilege escalation attack surfce
* Read bookmarks in content process
'''Objectives'''<br>
* Content process should not be able to read bookmarks?
* We can’t restrict access to history since this is needed to display web content?
* Ensure security model for these components are safe
'''Controls'''<br>
tbd
'''Open Questions'''<br>
* What other things fall into the same category (is there a better name for this?)
Canmove, confirm
1,220
edits

Navigation menu