This design document covers technical information about how Site Isolation is built.  For a general overview of Site Isolation, see https://www.chromium.org/Home/chromium-security/site-isolation.

Motivation

Chrome's multi-process architecture provides many benefits for speed, stability, and security.  It allows web pages in unrelated tabs to run in parallel, and it allows users to continue using the browser and other tabs when a renderer process crashes.  Because the renderer processes don't require direct access to disk, network, or devices, Chrome can also run them inside a restricted sandbox.  This limits the damage that attackers can cause if they exploit a vulnerability in the renderer, including making it difficult for attackers to access the user's filesystem or devices, as well as privileged pages (e.g., settings or extensions) and pages in other profiles (e.g., Incognito mode).
However, there is still a large opportunity to use Chrome's sandbox for greater security benefits: isolating web sites from each other.  Chrome currently makes an effort to place pages from different web sites in different renderer processes when possible, but due to compatibility constraints, there are many cases in which pages from different sites share a process (e.g., cross-site iframes).  In these cases, we rely on the renderer process to enforce the Same Origin Policy and keep web sites isolated from each other.
 
This page describes our "site isolation" efforts to improve Chrome to use sandboxed renderer processes as a security boundary between web sites, even in the presence of vulnerabilities in the renderer process.  Our goal is to ensure a renderer process can be limited to contain pages from at most one web site.  The browser process can then restrict that process's access to cookies and other resources, based on which web sites require dedicated processes.
 
Status: This effort is well underway, and the first iterations of it are available in Chrome 63 on an opt-in basis with several known issues.  When enabled in Chrome 63, site isolation helps mitigate universal cross-site scripting (UXSS) bugs in the renderer process, as well as speculative side channel attacks (e.g., Spectre) by putting pages from different sites in different processes.  It does not yet address the case of a fully compromised renderer process, which requires additional enforcements that we are still implementing.  See the Chrome's Current Status section below for more details.
 

Threat Model

For a "one-site-per-process" security policy, we assume that an attacker can convince the user to visit a page that exploits a vulnerability in the renderer process, allowing the attacker to run arbitrary code within the sandbox.  We also assume that attackers may use speculative side channel attacks (e.g., Spectre) to read data within a renderer process.  We consider attackers that want to steal information or abuse privileges granted to other web sites.
 
Here, we use a precise definition for a site that we use as a principal: a page's site includes the scheme and registered domain name, including the public suffix, but ignoring subdomains, port, or path.  We use sites instead of origins to avoid breaking compatibility with existing web pages that might modify their document.domain to communicate across subdomains.
 
We consider the following threats in scope for the proposed policy (once fully implemented):
  • Stealing cross-site cookies and HTML5 stored data.  We can prevent a renderer process from receiving cookies or stored data from sites other than its own.
  • Stealing cross-site HTML, XML, and JSON data.  Using MIME type and content sniffing, we can prevent a renderer process from loading most sensitive cross-site data.  We cannot block all cross-site resources, however, because images, scripts, and other opaque files are permitted across sites.
  • Stealing saved passwords.  We can prevent a renderer process from receiving saved passwords from sites other than its own.
  • Abusing permissions granted to another site.  We can prevent a renderer process from using permissions such as geolocation that the user has granted to other sites.
  • Compromising X-Frame-Options.  We can prevent a renderer process from loading cross-site pages in iframes.  This allows the browser process to decide if a given site can be loaded in an iframe or not based on X-Frame-Options headers.
  • Accessing cross-site DOM elements via UXSS bugs.  An attacker exploiting a universal cross-site scripting bug in the renderer process will not be able to access DOM elements of cross-site pages, which will not live in the same renderer process.
We do not expect this policy to mitigate traditional cross-site attacks or attacks that occur within the page of a victim site, such as XSS, CSRF, XSSI, or clickjacking.
 

Requirements

To support a site-per-process policy in a multi-process web browser, we need to identify the smallest unit that cannot be split into multiple processes.  This is not actually a single page, but rather a group of documents from the same web site that have references to each other.  Such documents have full script access to each other's content, and they must run on a single thread, not concurrently.  This group may span multiple frames or tabs, and they may come from multiple sub-domains of the same site.
 
The HTML spec refers to this group as a "unit of related similar-origin browsing contexts."  In Chrome, we refer to this as a SiteInstance.  All of the documents within a SiteInstance may be able to script each other, and we must thus render them in the same process.
 
Note that a single tab might be navigated from one web site to another, and thus it may show different SiteInstances at different times.  To support a site-per-process policy, a browser must be able to swap between renderer processes for these navigations.
 
There are also certain JavaScript interactions, such as postMessage() or close(), that are allowed between windows or frames even when they are showing documents from different sites.  It is necessary to support these limited interactions between renderer processes.
 
In addition, top-level documents may contain iframes from different web sites.  These iframes have their own security context and must be rendered in a process based on their own site, not the site of their parent frame.
 
Finally, it is important that sensitive cross-site data is not delivered to the renderer process, even if requested from contexts like image or script tags which normally work cross-site.  This requires identifying which responses to allow and which to block.
 

Chrome's Current Status

As described on our Process Models page, there are currently several cases in which Chrome (by default) will place documents from different sites in the same renderer process.  This keeps Chrome compatible with existing web pages with cross-site iframes, at least until Site Isolation is enabled.  Some examples of cross-site pages that may share a process today:
  • Cross-site iframes are usually hosted in the same process as their parent document.
  • Most renderer-initiated navigations (including link clicks, form submissions, and script navigations) are kept within the current process even if they cross a site boundary.  This is because other windows in the same process may attempt to use postMessage or similar calls to interact with them.
  • If too many renderer processes have been created, Chrome starts to reuse existing processes rather than creating new ones.  This reduces memory overhead.
However, Chrome (by default) already takes many large steps towards site isolation.  For example, it swaps renderer processes for cross-site navigations that are initiated in the browser process (such as omnibox navigations or bookmarks).  Cross-origin JavaScript interactions are supported across processes, such as postMessage() and navigating another window.  Chrome also already has support for out-of-process iframes in some contexts.
 
As a result of this progress, we have adopted a stricter security policy for certain types of pages, such as privileged WebUI pages (like the Settings page).  These pages are never allowed to share a process with regular web pages, even when navigating in a single tab.  This is generally acceptable from a compatibility perspective because no scripting is expected between normal pages and WebUI pages, and because these can never be loaded in subframes of unprivileged pages.
 
As of Chrome 56, Chrome also uses out-of-process iframes to keep web content out of privileged extension processes.
 
As of Chrome 63, Site Isolation can be enabled as an additional mitigation against universal cross-site scripting (UXSS) vulnerabilities and Spectre.  It can also be enabled via enterprise policy.  This initial support is still in progress and has known issues and tradeoffs, but helps to defend against UXSS vulnerabilities and Spectre by putting pages from different sites in different processes to prevent leaks of cross-site data.  The feature does not yet mitigate attacks with arbitrary remote code execution in the renderer process; this will later be possible as additional enforcements in the browser process are completed.
 

Project Tasks

To support a site-per-process policy in Chrome, we need to complete the tasks outlined below.  These will ensure that cross-site navigations and script interactions will not break, despite having all pages from different sites in different processes.  The master tracking bug is https://crbug.com/467770.
  • Cross-Process Navigations
    Any navigation to a different web site requires a process swap in the current tab or frame.
    Status: Complete.  Cross-process navigations are supported in all frames, and they are used to keep privileged WebUI or extension pages isolated from web pages.  They are also used opportunistically for cross-site browser-initiated (e.g., Omnibox) navigations.
  • Cross-Process JavaScript
    As mentioned above, some window and frame level interactions are allowed between pages from different sites.  Common examples are postMessage, close, focus, blur, and assignments to window.location, notably excluding any access to page content.  These interactions can generally be made asynchronous and can be implemented by passing messages to the appropriate renderer process.
    Status: Complete.  Chrome supports all required interactions, including frame placeholders, postMessage, close, closed, focus, blur, and assignments to window.location between top-level windows in different processes.
  • Out-of-Process iframes
    Iframes have separate security contexts from their parent document, so cross-site iframes must be rendered in a different process from their parent.  It is also important that an iframe that is from the same origin as a popup window shares a process with the popup window and not its own parent page.  We render these out-of-process iframes in a separate RenderFrame composited into the correct visual location, much like plugins.  This is by far the largest requirement for supporting site-per-process, as it involves a major architecture change to the Chrome and Blink codebases.
    Status: Mostly complete.  The first uses of Out-of-Process iframes (OOPIFs) have launched in Chrome 56, isolating extensions from web content.  We are now working to fix the remaining known issues in OOPIF support.  Tracked at https://crbug.com/99379.
  • Cross-Origin Read Blocking
    While any given site is allowed to request many types of cross-site resources (such as scripts and images), the browser process should prevent it from receiving cross-site HTML, XML, and JSON data (based on a combination of MIME type and content sniffing).
    Status: Our initial Cross-Site Document Blocking Policy has evolved into Cross-Origin Read Blocking (CORB), with a CORB Explainer.  This is implemented for non-compromised renderer processes when Site Isolation is enabled, as of Chrome 63.  The remaining work is tracked at https://crbug.com/268640.
  • Browser Process Enforcements
    Some of Chrome's security checks are performed in the renderer process.  When a process is locked to a given site, the browser process can enforce many of these checks itself, limiting what a compromised renderer process can achieve in an attack.  This includes attempts to access site specific stored data and permissions, as well as other attempts to lie to the browser process.
    Status: Some enforcements are in place, but more are tracked in https://crbug.com/786673.
  • Improved Renderer Process Limit Policy
    We have investigated ways to limit number of extra processes Chrome creates in Site Isolation modes.  One option is to support modes that only isolate a set of origins or sites (i.e., --isolate-origins) rather than all sites (i.e., --site-per-process).  However, we are currently leaning towards isolating all sites given our current findings.  Note that a page from one site may reuse a process that has already been used for that same site, and we aggressively reuse processes in this way for subframes when possible.  Note that processes will not be reused for cross-site pages.
    Status: We are currently aiming to isolate all sites, allowing process reuse only for pages from the same site.

Performance

Monitoring the performance impact of Site Isolation on Chrome is a critical part of this effort.  Site Isolation may affect performance in several ways, both positive and negative: some frames may render faster by running in parallel with the rest of the page, but creating additional renderer processes also increases memory requirements and may introduce latency on cross-process navigations.  We are taking several steps to minimize the costs incurred, and we are using metrics collected from actual browsing data to measure the impact.
 
As mentioned above under "Renderer Process Limit Policy," we investigated one option for reducing the number of processes by isolating only a subset of web sites.  In such a mode, most web sites would continue to use Chrome's old process model, while web sites that users are likely to log into would be isolated.  However, we are currently aiming to isolate all sites if possible, based on current performance measurements, simplicity, and the extra protection it offers.

How to Enable

See this Site Isolation Overview page for more details on how to enable Site Isolation experimentally.

Development Resources

Updating Chrome Features:
Build Status:

2015 Site Isolation Summit Talks

Talks and discussion from January 2015.

Site Isolation Overview

Slides

Site Isolation Overview

Chromium Changes for OOPIF

Slides

Chromium Changes for OOPIF

Blink Changes for OOPIF

Slides

Blink Changes for OOPIF

Discussions/Questions

The mailing list for technical discussions on Site Isolation is site-isolation-dev@chromium.org.

Site Isolation Design Document的更多相关文章

  1. Agile software architecture design document style..( sketches and no UMLs)

    http://www.infoq.com/articles/agile-software-architecture-sketches-NoUML If you're working in an agi ...

  2. How Blink works

    How Blink works Author: haraken@ Last update: 2018 Aug 14 Status: PUBLIC Working on Blink is not eas ...

  3. Design Doc: Session History for Out-of-Process iframes

    Design Doc: Session History for Out-of-Process iframes Charlie Reis, May 2014 This document outlines ...

  4. Quality in the Test Automation Review Process and Design Review Template

    About this document Prerequisite knowledge/experience: Software Testing, Test Automation Applicable ...

  5. puppeteer(五)chrome启动参数列表API

    List of Chromium Command Line Switches https://peter.sh/experiments/chromium-command-line-switches/ ...

  6. CEF 支持的命令行参数

    参考:https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switch ...

  7. 06 Frequently Asked Questions (FAQ) 常见问题解答 (常见问题)

    Frequently Asked Questions (FAQ) Origins 起源 What is the purpose of the project? What is the history ...

  8. Capabilities & ChromeOptions

    https://sites.google.com/a/chromium.org/chromedriver/capabilities http://stackoverflow.com/questions ...

  9. List of Chromium Command Line Switches(命令行开关集)——官方指定命令行更新网址

    转自:http://peter.sh/experiments/chromium-command-line-switches/ There are lots of command lines which ...

随机推荐

  1. 微信小程序和App的UI设计有什么异同吗?

    大家总是把小程序和App放在一起比,因此我也花时间看了一下小程序的开发指南,尤其是UI部分的设计和原则,今天就拿它和苹果的HIG(Human Interface Guidelines)做个比较,其实两 ...

  2. sql调优《二》

    1.数据库设计(是否复合范式,是否合理归档.分区.分表等) 2.硬件基础架构 (设备规格,硬件性能,负载均衡,容灾等) 3.ql语句的写法.索引和统计信息,事务和锁,应用程序访问代码(连接过多.频繁开 ...

  3. 第五章 Python之装饰器

    函数对象 函数是第一类对象:即函数可以当作数据传递 #可以被引用,可以被当作参数传递,返回值可以是函数,可以当作容器类型的元素 #引用 def func(x,y): print(x,y) f=func ...

  4. jmeter+ant+jenkins持续集成

    邮件.报告插件和jenkins的war包下载地址:链接:https://pan.baidu.com/s/1gZJ53x50bxVyEsQFjdCkog 密码:1jtz 1.下载ant  网盘地址:链接 ...

  5. 数据库常用sql语句积累

    组合一个新表 select p.*,(select value from as_info where key = 'v51_products') as v51_products from AP_POR ...

  6. Python学习笔记(5)practice:shopping_cart

    2019-02-27 原代码: money = int(input("请输入金额:")) list = ["phone", "clothes" ...

  7. StringUtils 的填充方法

    注意:两个参数的用空格填充,三个参数的用后面的参数填充 第一个参数要填充的字符串,第二个是需要的长度,第三个是以什么填充. 左侧填充: leftPad(): StringUtils.leftPad(S ...

  8. 洛谷P1138 第k小整数

    我偏不用sort Treap好题啊 看到只有一个人写Treap,而且写的不清楚,那我就来详细地写一下,方便新人学习 第(-1)部分:前置知识 二叉查找树:满足左子树的数据都比根节点小,右子树的数据都比 ...

  9. hive用mysql作元数据代替默认derby的hive-site.xml配置

    <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://s ...

  10. System.arraycopy用法

    System.arraycopy用法 注意长度的设置: public class ArrCopy { public static void main(String[] args) { int [] s ...