@@ -330,39 +330,47 @@ <h3 class="heading settled" data-level="1.1" id="examples"><span class="secno">1
330
330
331
331
< h4 class ="heading settled " data-level ="1.1.1 " id ="example-signout "> < span class ="secno "> 1.1.1. </ span > < span class ="content "> Signing Out</ span > < a class ="self-link " href ="#example-signout "> </ a > </ h4 >
332
332
333
-
334
- < p > A user signs out of Super Secret Social Network via a CSRF-protected POST to
335
- < code > https://supersecretsocialnetwork.example.com/logout</ code > , and the site
336
- author wishes to ensure that locally stored data is removed as a result.</ p >
333
+
334
+ < div class ="example " id ="example-fe709765 "> < a class ="self-link " href ="#example-fe709765 "> </ a >
335
+ A user signs out of Super Secret Social Network via a CSRF-protected POST to
336
+ < code > https://supersecretsocialnetwork.example.com/logout</ code > , and the
337
+ site author wishes to ensure that locally stored data is removed as a
338
+ result.
337
339
338
340
339
- < p > They can do so by sending the following HTTP header in the response:</ p >
341
+ < p > They can do so by sending the following HTTP header in the response:</ p >
342
+
340
343
341
-
342
- < pre > < a data-link-type ="dfn " href ="#clear_site_data "> Clear-Site-Data</ a > : *
344
+
345
+ < pre > < a data-link-type ="dfn " href ="#clear_site_data "> Clear-Site-Data</ a > : < a data-link-type =" dfn " href =" # " > * </ a >
343
346
</ pre >
347
+
348
+
349
+ </ div >
344
350
345
351
346
352
< h4 class ="heading settled " data-level ="1.1.2 " id ="example-targeted "> < span class ="secno "> 1.1.2. </ span > < span class ="content "> Targeted Clearing</ span > < a class ="self-link " href ="#example-targeted "> </ a > </ h4 >
347
353
348
-
349
- < p > A user signs out of Megacorp Inc.'s site via a CSRF-protected POST to
350
- < code > https://megacorp.example.com/logout</ code > . Megacorp has a large number
351
- of services available as subdomains, so many that it’s not entirely clear
352
- which of them would be safe to clear as a response to a logout action. One
353
- option would be to simply clear everything, and deal with the fallout.
354
- Megacorp’s CEO, however, once lost hours and hours of progress in "Irate
355
- Ibexes" due to inadvertant site-data clearing, and so refuses to allow such
356
- a sweeping impact to the site’s users.</ p >
354
+
355
+ < div class ="example " id ="example-0b8e3ea5 "> < a class ="self-link " href ="#example-0b8e3ea5 "> </ a >
356
+ A user signs out of Megacorp Inc.'s site via a CSRF-protected POST to
357
+ < code > https://megacorp.example.com/logout</ code > . Megacorp has a large
358
+ number of services available as subdomains, so many that it’s not entirely
359
+ clear which of them would be safe to clear as a response to a logout action.
360
+ One option would be to simply clear everything, and deal with the fallout.
361
+ Megacorp’s CEO, however, once lost hours and hours of progress in "Irate
362
+ Ibexes" due to inadvertant site-data clearing, and so refuses to allow such
363
+ a sweeping impact to the site’s users.
357
364
358
365
359
- < p > The developers know, however, that the "Minus" application is certainly safe
360
- to clear out. They can target this specific subdomain by including a request
361
- to that subdomain as part of the logout landing page (ideally as a
362
- CORS-enabled, CSRF-protected POST):</ p >
366
+ < p > The developers know, however, that the "Minus" application is certainly safe
367
+ to clear out. They can target this specific subdomain by including a request
368
+ to that subdomain as part of the logout landing page (ideally as a
369
+ CORS-enabled, CSRF-protected POST):</ p >
370
+
363
371
364
-
365
- < pre > fetch("https://minus.megacorp.example.com/clear-site-data",
372
+
373
+ < pre > fetch("https://minus.megacorp.example.com/clear-site-data",
366
374
{
367
375
method: "POST",
368
376
mode: "cors",
@@ -371,56 +379,72 @@ <h4 class="heading settled" data-level="1.1.2" id="example-targeted"><span class
371
379
})
372
380
});
373
381
</ pre >
382
+
374
383
375
384
376
- < p > That endpoint would return proper CORS headers in response to that request’s
377
- preflight, and would return the following header for the actual request:</ p >
385
+ < p > That endpoint would return proper CORS headers in response to that request’s
386
+ preflight, and would return the following header for the actual request:</ p >
387
+
378
388
379
-
380
- < pre > < a data-link-type ="dfn " href ="#clear_site_data "> Clear-Site-Data</ a > : * ; < a data-link-type ="dfn " href ="#includesubdomains "> includeSubdomains</ a >
389
+
390
+ < pre > < a data-link-type ="dfn " href ="#clear_site_data "> Clear-Site-Data</ a > : < a data-link-type =" dfn " href =" # " > * </ a > ; < a data-link-type ="dfn " href ="#includesubdomains "> includeSubdomains</ a >
381
391
</ pre >
392
+
393
+
394
+ </ div >
382
395
383
396
384
397
< h4 class ="heading settled " data-level ="1.1.3 " id ="example-keepcookies "> < span class ="secno "> 1.1.3. </ span > < span class ="content "> Keep Critical Cookies</ span > < a class ="self-link " href ="#example-keepcookies "> </ a > </ h4 >
385
398
386
-
387
- < p > A user opts-out of interest-based advertising via a CSRF-protected POST to
388
- < code > https://ads-are-awesome.example.com/optout</ code > . The site author
389
- wishes to remove DOM-accessible data which might contain tracking information,
390
- but needs to ensure that the opt-out cookie which the user has just received
391
- isn’t wiped along with it.</ p >
399
+
400
+ < div class ="example " id ="example-94c4a845 "> < a class ="self-link " href ="#example-94c4a845 "> </ a >
401
+ A user opts-out of interest-based advertising via a CSRF-protected POST to
402
+ < code > https://ads-are-awesome.example.com/optout</ code > . The site author
403
+ wishes to remove DOM-accessible data which might contain tracking
404
+ information, but needs to ensure that the opt-out cookie which the user has
405
+ just received isn’t wiped along with it.
392
406
393
407
394
- < p > They can do so by sending the following HTTP header in the response, which
395
- includes all the types except for "< a data-link-type ="dfn " href ="#cookies "> cookies</ a > ":</ p >
408
+ < p > They can do so by sending the following HTTP header in the response, which
409
+ includes all the types except for "< a data-link-type ="dfn " href ="#cookies "> cookies</ a > ":</ p >
410
+
396
411
397
-
398
- < pre > < a data-link-type ="dfn " href ="#clear_site_data "> Clear-Site-Data</ a > : < a data-link-type ="dfn " href ="#domstorage "> domStorage</ a > < a data-link-type ="dfn " href ="#executioncontexts "> executionContexts</ a > < a data-link-type ="dfn " href ="#cache "> cache</ a > ; < a data-link-type ="dfn " href ="#includesubdomains "> includeSubdomains</ a >
412
+
413
+ < pre > < a data-link-type ="dfn " href ="#clear_site_data "> Clear-Site-Data</ a > : < a data-link-type ="dfn " href ="#domstorage "> domStorage</ a > ; < a data-link-type ="dfn " href ="#executioncontexts "> executionContexts</ a > ; < a data-link-type ="dfn " href ="#cache "> cache</ a > ; < a data-link-type ="dfn " href ="#includesubdomains "> includeSubdomains</ a >
399
414
</ pre >
415
+
416
+
417
+ </ div >
400
418
401
419
402
420
< h4 class ="heading settled " data-level ="1.1.4 " id ="example-killswitch "> < span class ="secno "> 1.1.4. </ span > < span class ="content "> Kill Switch</ span > < a class ="self-link " href ="#example-killswitch "> </ a > </ h4 >
403
421
404
-
405
- < p > Super Secret Social Network’s developers learn that the site was vulnerable
406
- to cross-site scripting attacks which allowed malicious parties to inject
407
- arbitrary code into its origin. They fixed the site, and added a strong
408
- Content Security Policy < a data-link-type ="biblio " href ="#biblio-csp2 "> [CSP2]</ a > to mitigate the risk going forward, but
409
- they can’t be entirely sure that clients are really back to a trustworthy
410
- state. Perhaps the attackers found a clever persistence mechanism?</ p >
422
+
423
+ < div class ="example " id ="example-346b1576 "> < a class ="self-link " href ="#example-346b1576 "> </ a >
424
+ Super Secret Social Network’s developers learn that the site was vulnerable
425
+ to cross-site scripting attacks which allowed malicious parties to inject
426
+ arbitrary code into its origin. They fixed the site, and added a strong
427
+ Content Security Policy < a data-link-type ="biblio " href ="#biblio-csp2 "> [CSP2]</ a > to mitigate the risk going forward, but
428
+ they can’t be entirely sure that clients are really back to a trustworthy
429
+ state. Perhaps the attackers found a clever persistence mechanism?
411
430
412
431
413
- < p > They can reduce the risk of a persistent client-side XSS by sending the
414
- following HTTP header in a response to wipe out local sources of data:</ p >
432
+ < p > They can reduce the risk of a persistent client-side XSS by sending the
433
+ following HTTP header in a response to wipe out local sources of data:</ p >
434
+
415
435
416
-
417
- < pre > < a data-link-type ="dfn " href ="#clear_site_data "> Clear-Site-Data</ a > : * ; < a data-link-type ="dfn " href ="#includesubdomains "> includeSubdomains</ a >
436
+
437
+ < pre > < a data-link-type ="dfn " href ="#clear_site_data "> Clear-Site-Data</ a > : < a data-link-type =" dfn " href =" # " > * </ a > ; < a data-link-type ="dfn " href ="#includesubdomains "> includeSubdomains</ a >
418
438
</ pre >
439
+
419
440
420
441
421
- < p class ="note " role ="note "> Note: Installing a Service Worker guarantees that a request will go out to
422
- a server every ~24 hours. That update ping would be a wonderful time to send
423
- a header like this one in case of catastophe. < a data-link-type ="biblio " href ="#biblio-service-workers "> [SERVICE-WORKERS]</ a > </ p >
442
+ < p class ="note " role ="note "> Note: Installing a Service Worker guarantees that a request will go out to
443
+ a server every ~24 hours. That update ping would be a wonderful time to send
444
+ a header like this one in case of catastophe. < a data-link-type ="biblio " href ="#biblio-service-workers "> [SERVICE-WORKERS]</ a > </ p >
445
+
446
+
447
+ </ div >
424
448
425
449
426
450
< h3 class ="heading settled " data-level ="1.2 " id ="goals "> < span class ="secno "> 1.2. </ span > < span class ="content "> Goals</ span > < a class ="self-link " href ="#goals "> </ a > </ h3 >
@@ -681,7 +705,7 @@ <h4 class="heading settled" data-level="2.1.6" id="wildcard-parameter"><span cla
681
705
storage type parameters. That is:</ p >
682
706
683
707
684
- < pre > Clear-Site-Data: *
708
+ < pre > < a data-link-type =" dfn " href =" #clear_site_data " > Clear-Site-Data</ a > : < a data-link-type =" dfn " href =" # " > * </ a >
685
709
</ pre >
686
710
687
711
0 commit comments