diff --git a/index.bs b/index.bs index cc418b6a0d..7c2f6cbea7 100644 --- a/index.bs +++ b/index.bs @@ -22,7 +22,11 @@ Markup Shorthands: css off, markdown on At Risk: The [[#is-element-nonceable]] algorithm.
-spec:dom; type:interface; text:Document +spec:dom; + type: interface + text: Document + type: dfn + text: URL; url: https://dom.spec.whatwg.org/#dom-document-url spec:html type: dfn text: fallback base url @@ -164,6 +168,11 @@ spec: WebRTC; urlPrefix: https://www.w3.org/TR/webrtc/ type:dfn text: administratively-prohibited; url: #dfn-administratively-prohibited +spec:SRI; urlPrefix: https://w3c.github.io/webappsec-subresource-integrity + type:dfn; + text:applying algorithm to bytes; url: #apply-algorithm-to-response + text: cryptographic hash function; url: #hash-functions +
{ @@ -182,7 +191,7 @@ spec: WebRTC; urlPrefix: https://www.w3.org/TR/webrtc/ "REPORTING": { "href": "https://wicg.github.io/reporting/", "title": "Reporting API", - "authors": [ "Ilya Gregorik", "Mike West" ] + "authors": [ "Ilya Grigorik", "Mike West" ] }, "TIMING": { "href": "https://owasp.org/www-pdf-archive/HackPra_Allstars-Browser_Timing_Attacks_-_Paul_Stone.pdf", @@ -682,9 +691,10 @@ spec: WebRTC; urlPrefix: https://www.w3.org/TR/webrtc/ ; Keywords: keyword-source = "'self'" / "'unsafe-inline'" / "'unsafe-eval'" - / "'strict-dynamic'" / "'unsafe-hashes'" / + / "'strict-dynamic'" / "'unsafe-hashes'" / "'report-sample'" / "'unsafe-allow-redirects'" - / "'wasm-unsafe-eval'" + / "'wasm-unsafe-eval'" / "'report-sha256'" + / "'report-sha384'" / "'report-sha512'" ISSUE: Bikeshed `unsafe-allow-redirects`. @@ -1089,6 +1099,46 @@ spec: WebRTC; urlPrefix: https://www.w3.org/TR/webrtc/ 4. Return |result|. ++ When a directive that impacts [=script-like=] [=request/destinations=] has a `report-sha256`, + `report-sha384` or `report-sha512` value, and a [=/request=] with a [=script-like=] + [=request/destination=] is fetched, a csp hash report will be generated and + sent out to a reporting endpoint associated with the policy. + +Potentially report hash
+ + Given a [=response=] |response|, a [=/request=] |request|, a [=directive=] |directive| and a + [=content security policy object=] |policy|, run the following steps: + + 1. Let |algorithm| be the empty [=string=]. + 1. If |directive|'s value contains the + expression "`'report-sha256'`", set |algorithm| to "sha256". + 1. If |directive|'s value contains the + expression "`'report-sha384'`", set |algorithm| to "sha384". + 1. If |directive|'s value contains the + expression "`'report-sha512'`", set |algorithm| to "sha512". + 1. If |algorithm| is the empty [=string=], return. + 1. Let |hash| be the empty [=string=]. + 1. If |response| is [=CORS-same-origin=], then: + 1. Let |hash list| be a [=list=] of [=strings=], initially empty. + 1. [=list/Append=] |algorithm| to |hash list|. + 1. [=list/Append=] the result of [=applying algorithm to bytes=] on |response|'s + [=response/body=] and |algorithm| to |hash list|. + 1. Let |hash| be the result of [=concatenating=] |hash list| with U+002D (-). + 1. Let |global| be the |request|'s [=request/client=]'s [=/global object=]. + 1. If |global| is not a {{Window}}, return. + 1. Let |stripped document URL| to be the result of executing [[#strip-url-for-use-in-reports]] + on |global|'s [=document=]'s [=Document/URL=]. + 1. If |policy|'s [=directive set=] does not contain a [=directive=] named "report-to", return. + 1. Let |report-to directive| be a [=directive=] named "report-to" from |policy|'s [=directive + set=]. + 1. Let |body| be a [=csp hash report body=] with |stripped document URL| as its [=documentURL=], + |request|'s URL as its [=subresourceURL=], |hash| as its [=hash=], |request|'s + [=request/destination=] as its [=csp hash report body/destination=], and "subresource" as its + [=csp hash report body/type=]. + 1. [=Generate and queue a report=] with the following arguments: + : context + :: settings object + : type + :: "csp-hash" + : destination + :: |report-to directive|'s [=directive/value=]. + : data + :: |body|Integration with HTML @@ -1593,6 +1643,50 @@ this algorithm returns normally if compilation is allowed, and throws a };
csp hash reports have the report type "csp-hash".
+ +csp hash reports are not visible to ReportingObserver
s.
+
+
A csp hash report body is a [=struct=] with the following fields: + documentURL, + subresourceURL, + hash, + destination, + type. + +