Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 1 | # Threat Model And Defenses Against Compromised Renderers |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 2 | |
| 3 | Given the complexity of the browser, our threat model must use a "defense |
| 4 | in depth" approach to limit the damage that occurs if an attacker |
| 5 | finds a way around the Same Origin Policy or other security logic in the |
| 6 | renderer process. |
| 7 | For example, the combination of Chrome's sandbox, IPC security checks, and Site |
| 8 | Isolation limit what an untrustworthy renderer process can do. They |
| 9 | protect Chrome users against attackers, even when such attackers are able to |
| 10 | bypass security logic in the renderer process. |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 11 | For other arguments for the "defense in depth" approach and why our |
| 12 | threat model covers compromised renderers, please see |
| 13 | [the Site Isolation motivation](https://www.chromium.org/Home/chromium-security/site-isolation#TOC-Motivation). |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 14 | |
| 15 | In a compromised renderer, an attacker is able to execute |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 16 | arbitrary native (i.e. non-JavaScript) code within the renderer |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 17 | process's sandbox. A compromised renderer can forge |
| 18 | malicious IPC messages, impersonate a Chrome Extension content script, |
| 19 | or use other techniques to trick more privileged parts of the browser. |
| 20 | |
| 21 | The document below gives an overview of features that Chrome attempts to |
| 22 | protect against attacks from a compromised renderer. Newly discovered |
| 23 | holes in this protection would be considered security bugs and possibly |
| 24 | eligible for the |
| 25 | [Chrome Vulnerability Rewards Program](https://www.google.com/about/appsecurity/chrome-rewards/). |
| 26 | |
| 27 | [TOC] |
| 28 | |
| 29 | |
| 30 | ## Site Isolation foundations |
| 31 | |
| 32 | Most of the other protections listed in this document implicitly assume that |
| 33 | attacker-controlled execution contexts (e.g. HTML documents or service workers) |
| 34 | are hosted in a separate renderer process from other, victim contexts. |
| 35 | This separation is called |
| 36 | [Site Isolation](https://www.chromium.org/Home/chromium-security/site-isolation) |
| 37 | and allows the privileged browser |
| 38 | process to restrict what origins a renderer process is authorized to read or |
| 39 | control. |
| 40 | |
| 41 | The privilege restriction can be implemented in various ways - see the |
| 42 | "protection techniques" listed in other sections in this document. |
| 43 | One example is validating in the browser process whether an incoming IPC can |
| 44 | legitimately claim authority over a given origin (e.g. by checking via |
| 45 | `CanAccessDataForOrigin` if the process lock matches). |
| 46 | Another example is making sure that capabilities handed over to renderer |
Lukasz Anforowicz | dcd286f | 2020-08-18 22:16:31 | [diff] [blame^] | 47 | processes are origin-bound (e.g. by setting `request_initiator_origin_lock` |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 48 | on a `URLLoaderFactory` given to renderer processes). |
| 49 | Yet another example is making security decisions based on trustworthy knowledge, |
| 50 | calculated within the privileged browser process (e.g. using |
| 51 | `RenderFrameHost::GetLastCommittedOrigin()`). |
| 52 | |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 53 | Compromised renderers shouldn’t be able to commit an execution context |
| 54 | (e.g. commit a navigation to a HTML document, or create a service worker) |
| 55 | in a renderer process hosting other, cross-site execution contexts. |
| 56 | On desktop platforms all sites (site = scheme plus eTLD+1) should be isolated |
| 57 | from each other. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 58 | On Android, sites where the user entered a password should be isolated |
| 59 | from each other and from other sites. |
| 60 | |
| 61 | **Known gaps in protection**: |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 62 | - No form of Site Isolation is active in Android WebView. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 63 | See also https://crbug.com/769449. |
| 64 | - No form of Site Isolation is active in content hosted within |
| 65 | `<webview>` HTML tags. See also https://crbug.com/614463. |
| 66 | - Frames with `<iframe sandbox>` attribute are not isolated |
| 67 | from their non-opaque precursor origin. |
| 68 | See also https://crbug.com/510122. |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 69 | - `file:` frames may share a process with other `file:` frames. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 70 | See also https://crbug.com/780770. |
| 71 | |
| 72 | |
| 73 | ## Cross-Origin HTTP resources |
| 74 | |
| 75 | Compromised renderers shouldn't be able to read the contents (header + body) of |
| 76 | a cross-site HTTP response, unless it is a valid subresource needed for |
| 77 | compatibility (e.g., JavaScript, images, etc), or is successfully allowed via |
| 78 | CORS. |
| 79 | |
| 80 | Protection techniques: |
| 81 | - Enforcing |
| 82 | [Cross-Origin Read Blocking |
| 83 | (CORB)](https://www.chromium.org/Home/chromium-security/corb-for-developers) |
| 84 | in the NetworkService process |
| 85 | (i.e. before the HTTP response is handed out to the renderer process). |
| 86 | - Only allowing the privileged browser process to create |
| 87 | `network::mojom::URLLoaderFactory` objects that handle HTTP requests. |
| 88 | This lets the browser process carefully control security-sensitive |
| 89 | `network::mojom::URLLoaderFactoryParams` of such factories (such as |
Lukasz Anforowicz | dcd286f | 2020-08-18 22:16:31 | [diff] [blame^] | 90 | `request_initiator_origin_lock`, `is_corb_enabled`, `disable_web_security` or |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 91 | `isolation_info`). |
| 92 | This also lets the CORB implementation in the NetworkService process |
| 93 | prevent spoofing of `network::ResourceRequest::request_initiator` |
| 94 | by using `network::GetTrustworthyInitiator` for comparison with |
Lukasz Anforowicz | dcd286f | 2020-08-18 22:16:31 | [diff] [blame^] | 95 | the trustworthy `request_initiator_origin_lock`. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 96 | |
| 97 | **Known gaps in protection**: |
| 98 | - Content types for which CORB does not apply |
| 99 | (e.g. `image/png`, `application/octet-stream`) are not protected by |
| 100 | default. We recommend that HTTP servers protect such resources by |
| 101 | either serving a `Cross-Origin-Resource-Policy: same-origin` response header |
| 102 | or validating the `Sec-Fetch-Site` request header. |
| 103 | - CORB protection is relaxed in presence of |
| 104 | - Adobe Flash plugin (see https://crbug.com/874515) |
| 105 | - A relatively small number of allowlisted Chrome Extensions |
| 106 | (see https://crbug.com/846346) |
| 107 | |
| 108 | |
| 109 | ## Contents of cross-site frames |
| 110 | |
| 111 | Compromised renderers shouldn't be able to read the contents of cross-site |
| 112 | frames. Examples: |
| 113 | - Text or pixels of cross-site frames. |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 114 | - Full URL (e.g. URL path or query) of cross-site frames. |
| 115 | Note that the origin of other frames |
| 116 | needs to be exposed via `window.origin` for legacy reasons. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 117 | |
| 118 | Protection techniques: |
| 119 | - Compositing tab contents (both for display and for printing) |
| 120 | outside the renderer processes. |
| 121 | - Isolating PDF plugins. |
| 122 | - Being careful what URLs are exposed in console messages. |
| 123 | |
| 124 | **Known gaps in protection**: |
| 125 | - Mixed content console messages may disclose cross-site URLs |
| 126 | (see also https://crbug.com/726178). |
| 127 | |
| 128 | |
| 129 | ## Cookies |
| 130 | |
| 131 | Compromised renderers shouldn’t be able to read or write |
| 132 | any cookies of another site, |
| 133 | or `httpOnly` cookies even from the same site. |
| 134 | |
| 135 | Protection techniques: |
| 136 | - Renderer processes are only given `network::mojom::RestrictedCookieManager` |
| 137 | for origins within their site |
| 138 | (see `StoragePartitionImpl::CreateRestrictedCookieManager`). |
| 139 | - Mojo serialization does not send any cookies from HTTP headers to the renderer |
| 140 | process (see |
| 141 | `ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Write`). |
| 142 | |
| 143 | |
| 144 | ## Passwords |
| 145 | |
| 146 | Compromised renderers shouldn’t be able to read or write passwords of |
| 147 | other sites. |
| 148 | |
| 149 | Protection techniques: |
| 150 | - Using `CanAccessDataForOrigin` to verify IPCs sent by a renderer process |
| 151 | (e.g. `//components/password_manager/content/browser/bad_message.cc`) |
| 152 | - Using trustworthy, browser-side knowledge |
| 153 | to determine which credentials to read or write |
| 154 | (e.g. `content::RenderFrameHost::GetLastCommittedURL` in |
| 155 | `password_manager::CredentialManagerImpl::GetOrigin`). |
| 156 | |
| 157 | |
| 158 | ## Security-sensitive UI/chrome elements (e.g. Omnibox) |
| 159 | |
| 160 | Compromised renderers shouldn’t be able to influence/spoof |
| 161 | security-sensitive UI elements. |
| 162 | |
| 163 | Examples: |
| 164 | - Omnibox |
| 165 | - URL (e.g. renderer process locked to foo.com shouldn’t |
| 166 | be able to trick the Omnibox into displaying bar.com) |
| 167 | - Secure / not secure chip (e.g. a renderer process locked to a HTTP |
| 168 | site shouldn’t be able to trick the Omnibox into displaying a |
| 169 | HTTPS-associated lock) |
| 170 | - Content settings (e.g. a renderer process that has been granted |
| 171 | microphone access shouldn’t be able to suppress the mic/camera |
| 172 | icon in the Omnibox) |
| 173 | - Dialogs and prompts (for example a permissions dialog asking to allow |
| 174 | a site to show notifications) |
| 175 | - Origin in dialogs (e.g. a renderer process locked to foo.com |
| 176 | shouldn’t be able to trick the Omnibox into displaying a bar.com |
| 177 | URL in permission dialogs) |
| 178 | |
| 179 | Protection techniques: |
| 180 | - `RenderFrameHostImpl::CanCommitOriginAndUrl` verifies that the renderer |
| 181 | process is able to commit what it claims, and kills the process otherwise. |
| 182 | - Work-in-progress: calculating the origin in the browser process, |
| 183 | before a navigation commits (https://crbug.com/888079). |
| 184 | |
| 185 | |
| 186 | ## Permissions |
| 187 | |
| 188 | Compromised renderers shouldn’t be able to gain permissions without user |
| 189 | consent. |
| 190 | |
| 191 | Examples: microphone access permission, geolocation permission, etc. |
| 192 | |
| 193 | Protection techniques: |
| 194 | - Requesting permissions based on browser-side knowledge of frame's origin |
| 195 | (e.g. see `GeolocationServiceImplContext::RequestPermission`). |
| 196 | |
| 197 | |
| 198 | ## Web storage |
| 199 | |
| 200 | Compromised renderers shouldn’t be able to read from or write into |
| 201 | storage of another site. |
| 202 | |
| 203 | Examples of protected storage technologies: |
| 204 | - localStorage |
| 205 | - sessionStorage |
| 206 | - indexedDB |
| 207 | - blob storage |
| 208 | - webSQL |
| 209 | |
| 210 | Protection techniques: |
Lukasz Anforowicz | 48236673 | 2020-05-12 01:34:54 | [diff] [blame] | 211 | - Using `CanAccessDataForOrigin` to verify IPCs sent by a renderer process |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 212 | (e.g. see `StoragePartitionImpl::OpenLocalStorage`). |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 213 | - Binding Mojo interfaces to a single origin obtained from browser-side |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 214 | information in `RenderFrameHost::GetLastCommittedOrigin()` |
Lukasz Anforowicz | 48236673 | 2020-05-12 01:34:54 | [diff] [blame] | 215 | (e.g. see `RenderFrameHostImpl::CreateIDBFactory`). |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 216 | |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 217 | |
| 218 | ## Messaging |
| 219 | |
| 220 | Compromised renderers shouldn’t be able to: |
| 221 | - Spoof the `MessageEvent.origin` seen by a recipient of a `postMessage`. |
| 222 | - Bypass enforcement of the `targetOrigin` argument of `postMessage`. |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 223 | - Send or receive `BroadcastChannel` messages for another origin. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 224 | - Spoof the `MessageSender.origin` seen by a recipient of a |
| 225 | `chrome.runtime.sendMessage` |
| 226 | (see also [MessageSender documentation](https://developers.chrome.com/extensions/runtime#type-MessageSender) and [content script security guidance](https://groups.google.com/a/chromium.org/forum/#!topic/chromium-extensions/0ei-UCHNm34)). |
| 227 | |
| 228 | Protection techniques: |
Lukasz Anforowicz | 48236673 | 2020-05-12 01:34:54 | [diff] [blame] | 229 | - Using `CanAccessDataForOrigin` to verify IPCs sent by a renderer process |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 230 | (e.g. in `RenderFrameProxyHost::OnRouteMessageEvent` or |
| 231 | `BroadcastChannelProvider::ConnectToChannel`). |
| 232 | |
| 233 | **Known gaps in protection**: |
| 234 | - Spoofing of `MessageSender.id` object |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 235 | (see [the MessageSender documentation](https://developers.chrome.com/extensions/runtime#type-MessageSender) |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 236 | and https://crbug.com/982361). |
| 237 | |
| 238 | |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 239 | ## JavaScript code cache |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 240 | |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 241 | Compromised renderers shouldn't be able to poison the JavaScript code cache |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 242 | used by scripts executed in cross-site execution contexts. |
| 243 | |
| 244 | Protection techniques: |
Lukasz Anforowicz | a288a13 | 2020-05-19 17:18:22 | [diff] [blame] | 245 | - Validating origins sent in IPCs from a renderer process by using |
| 246 | `CanAccessDataForOrigin` in |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 247 | `CodeCacheHostImpl::DidGenerateCacheableMetadataInCacheStorage`. |
Lukasz Anforowicz | a288a13 | 2020-05-19 17:18:22 | [diff] [blame] | 248 | - Using trustworthy, browser-side origin lock while writing to and fetching from |
| 249 | the code cache by using `ChildProcessSecurityPolicyImpl::GetOriginLock` in |
| 250 | `GetSecondaryKeyForCodeCache` in |
| 251 | `//content/browser/renderer_host/code_cache_host_impl.cc` |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 252 | |
| 253 | |
| 254 | ## Cross-Origin-Resource-Policy response header |
| 255 | |
| 256 | A compromised renderer shouldn’t be able to bypass |
Lukasz Anforowicz | 48236673 | 2020-05-12 01:34:54 | [diff] [blame] | 257 | [Cross-Origin-Resource-Policy (CORP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cross-Origin_Resource_Policy_%28CORP%29), |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 258 | which prevents or allows responses from being requested cross-origin, more |
| 259 | explicitly than CORB. |
| 260 | |
| 261 | Protection techniques: |
| 262 | - Enforcing Cross-Origin-Resource-Policy in the NetworkService process |
| 263 | (i.e. before the HTTP response is handed out to the renderer process). |
| 264 | - Preventing spoofing of `network::ResourceRequest::request_initiator` |
| 265 | by using `network::GetTrustworthyInitiator` which enforces |
Lukasz Anforowicz | dcd286f | 2020-08-18 22:16:31 | [diff] [blame^] | 266 | browser-controlled `request_initiator_origin_lock`. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 267 | |
| 268 | |
| 269 | ## Frame-ancestors CSP and X-Frame-Options response headers |
| 270 | |
| 271 | A compromised renderer shouldn’t be able to bypass `X-Frame-Options` |
| 272 | or `frame-ancestors` CSP. |
| 273 | |
| 274 | For example, if example.com/page.html sends a `X-Frame-Options: deny` header, |
| 275 | then it should never commit in a subframe, even if some renderers have |
| 276 | been compromised. |
| 277 | |
| 278 | Protection techniques: |
| 279 | - `X-Frame-Options: deny` is enforced in the browser process |
| 280 | via `content::AncestorThrottle`, an implementation of |
| 281 | `content::NavigationThrottle`. |
| 282 | - `frame-ancestors` is enforced in a renderer process, but |
| 283 | this process is considered trustworthy in this scenario |
| 284 | (because it hosts the frame that is requesting protection). |
| 285 | See also https://crbug.com/759184 which tracks |
| 286 | moving this enforcement into the browser process. |
| 287 | |
| 288 | |
| 289 | ## HTTP request headers |
| 290 | |
| 291 | Compromised renderers shouldn’t be able to control security sensitive HTTP |
| 292 | request headers like `Host` or `Sec-Fetch-Site`. |
| 293 | |
| 294 | Protection techniques: |
| 295 | - Using `AreRequestHeadersSafe` to reject `Host` and other headers that |
| 296 | should only be generated internally within the NetworkService. |
| 297 | - `Sec-Fetch-Site` is robust against spoofing of |
| 298 | `network::ResourceRequest::request_initiator` by using |
| 299 | `network::GetTrustworthyInitiator` which enforces browser-controlled |
Lukasz Anforowicz | dcd286f | 2020-08-18 22:16:31 | [diff] [blame^] | 300 | `request_initiator_origin_lock`. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 301 | |
| 302 | **Known gaps in protection**: |
| 303 | - `Origin` header. Tracked by |
| 304 | https://crbug.com/920634 (making |
| 305 | `network::ResourceRequest::request_initiator` unspoofable without |
| 306 | having to go through `GetTrustworthyInitiator`) and |
| 307 | https://crbug.com/920638 (making |
| 308 | `network::ResourceRequest::isolated_world_origin` irrelevant for |
| 309 | security decisions). |
| 310 | |
| 311 | |
| 312 | ## (WIP) SameSite cookies |
| 313 | |
| 314 | Compromised renderers shouldn’t be able to send a cross-site HTTP request with |
| 315 | SameSite cookies. |
| 316 | |
| 317 | **Work-in-progress / not protected today**. |
| 318 | |
| 319 | TODO(morlovich): Add details. I assume that this requires trustworthy |
| 320 | |request_initiator| (similar to the `Origin` header), but probably more |
| 321 | than that. |
| 322 | |
| 323 | See also https://crbug.com/927967. |
| 324 | |
| 325 | |
| 326 | ## (WIP) User gestures / activations. |
| 327 | |
| 328 | Compromised renderers shouldn't be able to spoof user gestures to perform |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 329 | actions requiring them: |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 330 | |
Lukasz Anforowicz | 11dbb06d | 2020-05-12 00:14:34 | [diff] [blame] | 331 | - A compromised renderer should not be able to forge a gesture that affects |
| 332 | the trusted browser UI. For example, a compromised renderer should not be |
| 333 | able to interact with the Omnibox or the WebBluetooth chooser. |
| 334 | |
| 335 | - A compromised renderer should not be able to forge a gesture that grants |
| 336 | extra capabilities to a web origin. For example, a compromised renderer |
| 337 | should not be able to open an unlimited number of popup |
| 338 | windows by forging user gestures. |
| 339 | **Work-in-progress / not protected today** - see https://crbug.com/848778. |
Lukasz Anforowicz | f4e58ce | 2020-05-11 18:18:58 | [diff] [blame] | 340 | |
| 341 | |
| 342 | ## Web Accessible Resources of Chrome Extensions |
| 343 | |
| 344 | Compromised non-extension renderers shouldn’t be able to access |
| 345 | non-web-accessible-resources of a Chrome Extension. |
| 346 | |
| 347 | Protection techniques: |
| 348 | - Navigations: Enforcement in the browser process |
| 349 | via `extensions::ExtensionNavigationThrottle`, an implementation of |
| 350 | `content::NavigationThrottle`. This relies on non-spoofability |
| 351 | of `content::NavigationHandle::GetInitiatorOrigin`. |
| 352 | - Subresources: Enforcement in the browser process via |
| 353 | `ExtensionURLLoaderFactory::CreateLoaderAndStart`. This relies |
| 354 | on process boundaries and therefore doesn't rely on non-spoofability |
| 355 | of `network::ResourceRequest::request_initiator`. |
| 356 | |
| 357 | |
| 358 | ## Non-Web resources |
| 359 | |
| 360 | Compromised *web* renderer processes shouldn’t be able to access |
| 361 | *local* resources (e.g. `file://...` or `chrome://settings`). |
| 362 | |
| 363 | Protection techniques: |
| 364 | - TODO(lukasza, nasko): need to research |
| 365 | |
| 366 | |
| 367 | ## Android-specific protection gaps |
| 368 | |
| 369 | Due to resource constraints, on Android platforms only some sites get a |
| 370 | dedicated renderer process, isolated from other sites. |
| 371 | (Current heuristic is to isolate the sites where the user has entered a password |
| 372 | in the past.) |
| 373 | This means that some sites are hosted in a renderer process that is |
| 374 | *not* locked to any particular site. If an attacker compromises |
| 375 | an unlocked renderer process, they may try to abuse protection gaps listed |
| 376 | below. |
| 377 | |
| 378 | **Known gaps in protection**: |
| 379 | - When `CanAccessDataForOrigin` runs on the IO thread, it cannot protect |
| 380 | isolated sites against being accessed from an unlocked renderer process. |
| 381 | Some web storage protections depend on `CanAccessDataForOrigin` calls |
| 382 | on the IO thread. |
| 383 | See also https://crbug.com/764958. |
Lukasz Anforowicz | 0481d82f | 2020-05-27 22:08:24 | [diff] [blame] | 384 | |
| 385 | |
| 386 | ## Renderer processes hosting DevTools frontend |
| 387 | |
| 388 | If an attacker could take control over the DevTools frontend then the attacker |
| 389 | would gain access to all the cookies, storage, etc. of any origin within the |
| 390 | page and would be able to execute arbitrary scripts in any frame of the page. |
| 391 | This means that treating the DevTools renderer as untrustworthy wouldn't in |
| 392 | practice offer additional protection for the same-origin-policy. |
| 393 | |
| 394 | Because of the above: |
| 395 | |
| 396 | - Chrome ensures that the DevTools frontend is always hosted in a renderer |
| 397 | process separate from renderers hosting web origins. |
| 398 | - Chrome assumes that the DevTools frontend is always trustworthy |
| 399 | (i.e. never compromised, or under direct control of an attacker). |
| 400 | For example, when the DevTools process asks to initiate a HTTP request on |
| 401 | behalf of https://example.com, the browser process trusts the DevTools |
| 402 | renderer to claim authority to initiate requests of behalf of this origin |
| 403 | (e.g. attach SameSite cookies, send appropriate Sec-Fetch-Site request header, |
| 404 | etc.). |