@@ -41,9 +41,12 @@ <h1>Clear Site Data</h1>
41
41
type: dfn
42
42
urlPrefix: browsers.html
43
43
text: ancestor browsing context
44
+ text: active document
44
45
text: browsing context
45
46
text: creating a new document object; url: create-a-document-object
46
47
text: nested browsing context
48
+ text: active sandboxing flag set
49
+ text: parse a sandboxing directive; url: sandboxing:parse-a-sandboxing-directive
47
50
urlPrefix: webappapis.html
48
51
text: environment settings object; url: settings-object
49
52
text: incumbent settings object
@@ -197,7 +200,7 @@ <h3 id="goals">Goals</h3>
197
200
7. All of the above can be propagated to the HTTP version of an HTTPS origin.
198
201
199
202
ISSUE: What do we do about today's multi-tab, multi-window user agents? Should
200
- we also neuter open execution contexts in the affected origins? Close open
203
+ we also neuter open browsing contexts in the affected origins? Close open
201
204
windows?
202
205
</ section >
203
206
@@ -219,7 +222,7 @@ <h3 id="header">
219
222
"Clear-Site-Data:" *< a > WSP</ a > < a > data-type-list</ a > *[ ";" *< a > WSP</ a > < a > extension</ a > *< a > WSP</ a > ] *< a > WSP</ a >
220
223
221
224
< dfn > data-type-list</ dfn > = "*" / ( < a > exclusion</ a > *( " " < a > exclusion</ a > ) )
222
- < dfn > exclusion</ dfn > = "< dfn > retainCookies</ dfn > "
225
+ < dfn > exclusion</ dfn > = "< dfn > retainCookies</ dfn > " / " < dfn > retainContexts </ dfn > "
223
226
< dfn > extension</ dfn > = < a > subdomain-extension</ a > / < a > unknown-extension</ a >
224
227
< dfn > subdomain-extension</ dfn > = "< dfn > includeSubdomains</ dfn > "
225
228
< dfn > unknown-extension</ dfn > = *( < a > WSP</ a > / << a > VCHAR</ a > except ";" and ","> )
@@ -237,7 +240,11 @@ <h3 id="header">
237
240
exclusions are as follows:
238
241
239
242
1. < code > retainCookies</ code > , which implies that cookies for the site's
240
- host will < code > not</ code > be removed.
243
+ host will < strong > not</ strong > be removed.
244
+
245
+ 2. < code > retainContexts</ code > , which implies that user agents which support
246
+ opening multiple windows or tabs will < strong > not</ strong > neuter existing
247
+ < a > browsing contexts</ a > open onto the site.
241
248
242
249
Invalid exclusion keywords present in a header's value are simply ignored.
243
250
Parsing details can be found in [[#parsing]].
@@ -279,6 +286,17 @@ <h3 id="header">
279
286
cached data for any host which is a subdomain of < var > response</ var > 's
280
287
{{Response/url}}'s {{URL/host}} MUST be removed.
281
288
289
+ 5. If the value of the header's < a > data-type-list</ a > does not contain
290
+ < a > < code > retainContexts</ code > </ a > , then all < a > browsing contexts</ a >
291
+ whose < a > active Document</ a > 's < a > origin</ a > is identical to
292
+ {{Response/url}}'s < a > origin</ a > MUST be neutered by tightly sandboxing
293
+ them.
294
+
295
+ If the < code > includeSubdomains</ code > option is present, then all
296
+ < a > browsing contexts</ a > whose < a > active Document</ a > 's < a > origin</ a > 's
297
+ {{URL/host}} is a subdomain of < var > response</ var > 's {{Response/url}}'s
298
+ {{URL/host}} MUST be neutered.
299
+
282
300
< h3 id ="fetch-integration "> Fetch Integration</ h3 >
283
301
284
302
ISSUE: Monkey patching! Talk with Anne.
@@ -321,7 +339,7 @@ <h4 id="should-include-subdomains">
321
339
322
340
< h4 id ="matches-origin ">
323
341
Does < var > origin</ var > match < var > origin to clear</ var > and
324
- < var > subdomains </ var >
342
+ < var > subdomain state </ var >
325
343
</ h4 >
326
344
327
345
TODO: Given an origin, the origin to clear, and the "include subdomains"
@@ -339,18 +357,51 @@ <h3 id="clear">
339
357
1. Let < var > exclusions</ var > be the result of [[#get-exclusions]] executed on
340
358
< var > response</ var > .
341
359
342
- 2. Let < var > subdomains</ var > be the result of [[#should-include-subdomains]]
343
- executed on < var > response</ var > .
360
+ 2. Let < var > subdomain state</ var > be the result of
361
+ [[#should-include-subdomains]] executed on < var > response</ var > .
362
+
363
+ 4. If < var > exclusions</ var > does not contain "< code > contexts</ code > ", execute
364
+ [[#neuter-contexts]] on < var > response</ var > 's {{Response/url}}'s
365
+ < a > origin</ a > , with < var > subdomain state</ var > .
344
366
345
- 3 . If < var > exclusions</ var > does not contain "< code > cookies</ code > ", execute
367
+ 5 . If < var > exclusions</ var > does not contain "< code > cookies</ code > ", execute
346
368
[[#clear-cookies]] on < var > response</ var > 's {{Response/url}}'s
347
- < a > origin</ a > , with < var > subdomains </ var > .
369
+ < a > origin</ a > , with < var > subdomain state </ var > .
348
370
349
- 4 . Execute [[#clear-dom]] on < var > response</ var > 's {{Response/url}}'s
350
- < a > origin</ a > , with < var > subdomains </ var > .
371
+ 6 . Execute [[#clear-dom]] on < var > response</ var > 's {{Response/url}}'s
372
+ < a > origin</ a > , with < var > subdomain state </ var > .
351
373
352
- 5. Execute [[#clear-cache]] on < var > response</ var > 's {{Response/url}}'s
353
- < a > origin</ a > , with < var > subdomains</ var > .
374
+ 7. Execute [[#clear-cache]] on < var > response</ var > 's {{Response/url}}'s
375
+ < a > origin</ a > , with < var > subdomain state</ var > .
376
+
377
+ < h4 id ="neuter-contexts ">
378
+ Neuter browsing contexts matching < var > origin</ var > with
379
+ < var > subdomain state</ var >
380
+ </ h4 >
381
+
382
+ Given an < a > origin</ a > (< var > origin</ var > ) and a < var > subdomain state</ var >
383
+ of either < a > < code > Include Subdomains</ code > </ a > or < a > < code > Exclude
384
+ Subdomains</ code > </ a > , this algorithm walks through the set of < a > browsing
385
+ contexts</ a > which the user agent knows about, and sandboxes each in order
386
+ to prevent them from recreating wiped data (from in-memory JavaScript
387
+ variables, for instance):
388
+
389
+ 1. For each < var > context</ var > in the user agent's set of < a > browsing
390
+ contexts</ a > :
391
+
392
+ 1. Let < var > document</ var > be < var > context</ var > 's < a > active
393
+ document</ a > .
394
+
395
+ 2. If [[#matches-origin]] returns < a > < code > Matches</ code > </ a > when
396
+ executed on < var > context</ var > 's < a > origin</ a > , < var > origin</ var > , and
397
+ < code > subdomain state</ code > :
398
+
399
+ 1. < a > Parse a sandboxing directive</ a > using the empty string as
400
+ the < var > input</ var > , and < var > document</ var > 's < a > active
401
+ sandboxing flag set</ a > as the < var > output</ var > .
402
+
403
+ ISSUE: This won't be an atomic set of operations. How can we prevent collusion
404
+ between browsing contexts to potentially bypass neutering?
354
405
355
406
< h4 id ="clear-cache ">
356
407
Clear cache for < var > origin</ var > with < var > subdomain state</ var >
@@ -388,7 +439,8 @@ <h4 id="clear-cache">
388
439
hand-wavey with the vendor-specific section can we be? For instance,
389
440
Chrome clears out prerendered pages, script caches, WebGL shader caches,
390
441
WebRTC bits and pieces, address bar suggestion caches, various networking
391
- bits that aren't representations (HSTS/HPKP, SCDH, etc.).
442
+ bits that aren't representations (HSTS/HPKP, SCDH, etc.). Perhaps
443
+ [[STORAGE]] will make this clearer?
392
444
393
445
< h4 id ="clear-cookies ">
394
446
Clear cookies for < var > origin</ var > with < var > subdomain state</ var >
@@ -429,15 +481,15 @@ <h4 id="clear-cookies">
429
481
430
482
< h4 id ="clear-dom ">
431
483
Clear DOM-accessible storage for < var > origin</ var > with
432
- < var > subdomains </ var >
484
+ < var > subdomain state </ var >
433
485
</ h4 >
434
486
435
487
1. For each < var > area</ var > in the user agent's set of < a > local storage
436
488
areas</ a > [[!HTML]]:
437
489
438
490
1. If [[#matches-origin]] returns < a > < code > Matches</ code > </ a > when
439
491
executed on < var > area</ var > 's < a > origin</ a > , < var > origin</ var > , and
440
- < code > subdomains </ code > :
492
+ < code > subdomain state </ code > :
441
493
442
494
1. Execute {{Storage/clear()}} on the {{Storage}} object associated
443
495
with < var > area</ var > .
@@ -447,7 +499,7 @@ <h4 id="clear-dom">
447
499
448
500
1. If [[#matches-origin]] returns < a > < code > Matches</ code > </ a > when
449
501
executed on < var > area</ var > 's < a > origin</ a > , < var > origin</ var > , and
450
- < code > subdomains </ code > :
502
+ < code > subdomain state </ code > :
451
503
452
504
1. Execute {{Storage/clear()}} on the {{Storage}} object associated
453
505
with < var > area</ var > .
@@ -457,7 +509,7 @@ <h4 id="clear-dom">
457
509
458
510
1. If [[#matches-origin]] returns < a > < code > Matches</ code > </ a > when
459
511
executed on < var > database</ var > 's < a > origin</ a > , < var > origin</ var > ,
460
- and < code > subdomains </ code > :
512
+ and < code > subdomain state </ code > :
461
513
462
514
1. Set < var > database</ var > 's < a > delete pending</ a > flag to
463
515
< code > true</ code > .
@@ -477,7 +529,7 @@ <h4 id="clear-dom">
477
529
478
530
1. If [[#matches-origin]] returns < a > < code > Matches</ code > </ a > when
479
531
executed on < var > database</ var > 's < a > origin</ a > , < var > origin</ var > ,
480
- and < code > subdomains </ code > :
532
+ and < code > subdomain state </ code > :
481
533
482
534
1. Delete < var > database</ var > .
483
535
@@ -486,6 +538,49 @@ <h4 id="clear-dom">
486
538
487
539
488
540
ISSUE: Define how we clear Filesystems, Dedicated Workers, Shared Workers, Service Workers, etc.
541
+
542
+ ISSUE: How do we say something about plugins here? Point out to
543
+ < a href ="https://wiki.mozilla.org/NPAPI:ClearSiteData "> NPP_ClearSiteData</ a > ?
544
+ </ section >
545
+
546
+ < section >
547
+ < h2 id ="privacy "> Privacy Considerations</ h2 >
548
+
549
+ < h3 id ="user-vs-author "> Web developers control the timing.</ h3 >
550
+
551
+ If triggered at appropriate times, < a > < code > Clear-Site-Data</ code > </ a > can
552
+ increase a user's privacy and security by clearing sensitive data from their
553
+ user agent. However, note that the web developer (and < em > not</ em > the user)
554
+ is in control of when the clearing event is triggered. Even assuming a
555
+ non-malicious site author, users can't rely on data being cleared at any
556
+ particular point, nor are users in control of what data types are cleared.
557
+
558
+ If a user wishes to ensure that site data is indeed cleared at some specific
559
+ point, they ought to rely on the data-clearing functionality offered by their
560
+ user agent.
561
+
562
+ At a bare minimum, user agents OUGHT TO (in the [[RFC6919]] sense of the
563
+ words) offer the same functionality to users that they offer to web
564
+ developers. Ideally, they will offer significantly more than we can offer at
565
+ a platform level (clearing browsing history, for example).
566
+
567
+ < h3 id ="remnants "> Remnants of data on disk.</ h3 >
568
+
569
+ While < a > < code > Clear-Site-Data</ code > </ a > triggers a clearing event in a
570
+ user's agent, it is difficult to make promises about the state of a user's
571
+ disk after a clearing event takes place. In particular, note that it is up
572
+ to the user agent to ensure that all traces of a site's date is actually
573
+ removed from disk, which can be a herculean task (consider virtual memory,
574
+ as a good example of a larger issue).
575
+
576
+ In short, most user agents implement data clearing as "best effort", but
577
+ can't promise an exhaustive wipe.
578
+
579
+ If a user wishes to ensure that site data does not remain on disk, the best
580
+ way to do so is to use a browsing mode that promises not to intentionally
581
+ write data to disk (Chrome's "Incognito", Internet Explorer's "InPrivate",
582
+ etc). These modes will do a better job of keeping data off disk, but are
583
+ still subject to a number of limitations at the edges.
489
584
</ section >
490
585
491
586
< section >
0 commit comments