From 16677c361d58ca75d794814eb9fb70e45f7d9dd5 Mon Sep 17 00:00:00 2001 From: Mike West Date: Fri, 13 Sep 2019 12:06:58 +0200 Subject: [PATCH] Tighten 'same site' checks to include 'scheme'. This patch introduces 'schemelessly same site' on both 'host' and 'URL', moves 'same site' to URL, and tightens it by requiring a scheme match in addition to a registrable domain match. This, hopefully, will create stronger security boundaries in places where we perform "same site" checks, while giving us the flexibility to grandparent in existing behavior we decide to keep. Partially addresses whatwg/url#448. --- url.bs | 115 +++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 44 deletions(-) diff --git a/url.bs b/url.bs index fdf9c54d..7f94ec5d 100644 --- a/url.bs +++ b/url.bs @@ -346,50 +346,6 @@ obtain host's registrable domain, run these steps: -

Two hosts, A and B are said to be -same site with each other if either of the following statements are true: - -

- -
-

Assuming that suffix.example is a public suffix and that - example.com is not: - -

-
- -

Specifications should prefer the origin concept for security -decisions. The notion of "public suffix", "registrable domain", -and "same site" cannot be relied-upon to provide a hard security boundary, as the public -suffix list will diverge from client to client. Specifications which ignore this advice are -encouraged to carefully consider whether URLs' schemes ought to be incorporated into any decision -made based upon whether or not two hosts are same site. HTML's same -origin-domain concept is a reasonable example of this consideration in practice. -

IDNA

@@ -2473,6 +2429,77 @@ background information. [[!HTML]] +

Site

+ +

Two hosts, A and B are said to be +schemelessly same site with each other if either of the following statements are true: + +

+ +

Two URLs, A and B are said to be +schemelessly same site with each other if A's +host is schemelessly same site with B's +host. + +

Two URLs, A and B are said to be same site +with each other if the following statements are both true: + +

+ +

Specifications should prefer the origin concept for security +decisions. The notions of "public suffix", "registrable domain", +"schemelessly same site", and "same site" cannot be relied-upon to +provide a hard security boundary, as the public suffix list will diverge from client to client. +Specifications which ignore this advice are encouraged to prefer "same site" checks +to "schemelessly same site" checks, as the latter would bucket both secure and +non-secure URLs together in ways that can undermine the security boundary a given check aims to +create. + +

+

Assuming that suffix.example is a public suffix and that + example.com is not: + +

+
+ +

URL rendering