@@ -40,6 +40,7 @@ spec:html
40
40
text: style
41
41
type: element-attr
42
42
text: ping
43
+ text: type
43
44
type:interface
44
45
text:SharedWorker
45
46
spec:fetch
@@ -696,7 +697,7 @@ spec:SRI; urlPrefix: https://w3c.github.io/webappsec-subresource-integrity
696
697
/ "<dfn>'report-sample'</dfn> " / "<dfn>'unsafe-allow-redirects'</dfn> "
697
698
/ "<dfn>'wasm-unsafe-eval'</dfn> " / "<dfn>'trusted-types-eval'</dfn> "
698
699
/ "<dfn>'report-sha256'</dfn> " / "<dfn>'report-sha384'</dfn> "
699
- / "<dfn>'report-sha512'</dfn> "
700
+ / "<dfn>'report-sha512'</dfn> " / " <dfn>'inline-speculation-rules'</dfn> "
700
701
701
702
ISSUE: Bikeshed `unsafe-allow-redirects`.
702
703
@@ -1235,7 +1236,7 @@ spec:SRI; urlPrefix: https://w3c.github.io/webappsec-subresource-integrity
1235
1236
application, event handlers, etc.), and "`Blocked`" otherwise:
1236
1237
1237
1238
Note: The valid values for |type| are "`script`", "`script attribute`",
1238
- "`style`", and "`style attribute`".
1239
+ "`script speculationrules`", "` style`", and "`style attribute`".
1239
1240
1240
1241
<ol class="algorithm">
1241
1242
1. Assert: |element| is not null.
@@ -2863,7 +2864,8 @@ Content-Type: application/reports+json
2863
2864
implicitly by not specifying a `script-src` (or `default-src`) directive,
2864
2865
or explicitly, by specifying "`unsafe-inline`", a
2865
2866
<a grammar>nonce-source</a> or a <a grammar>hash-source</a> that matches
2866
- the inline block.
2867
+ the inline block, or specifying "`inline-speculation-rules`" when the
2868
+ <{script/type}> attribute matches "`speculationrules`".
2867
2869
2868
2870
4. The following JavaScript execution sinks are gated on the "`unsafe-eval`" and "`trusted-types-eval`"
2869
2871
source expressions:
@@ -4006,7 +4008,7 @@ Content-Type: application/reports+json
4006
4008
Note: An empty source list (that is, a directive without a value: `script-src`,
4007
4009
as opposed to `script-src host1`) is equivalent to a source list containing `'none' `,
4008
4010
and will not match any URL.
4009
-
4011
+
4010
4012
Note: The `'none' ` keyword has no effect when other source expressions are
4011
4013
present. That is, the list « `'none' ` » does not match any URL. A list consisting
4012
4014
of « `'none' `, `https://example.com` », on the other hand, would match
@@ -4157,7 +4159,7 @@ Content-Type: application/reports+json
4157
4159
Note: The matching relation is asymmetric. That is, |pattern| matching |host| does not
4158
4160
mean that |host| will match |pattern|. For example, `*.example.com` <a>`host-part` matches</a>
4159
4161
`www.example.com`, but `www.example.com` does not <a>`host-part` match</a> `*.example.com`.
4160
-
4162
+
4161
4163
Note: A future version of this specification may allow literal IPv6 and IPv4 addresses,
4162
4164
depending on usage and demand. Given the weak security properties of IP addresses in
4163
4165
relation to named hosts, however, authors are encouraged to prefer the latter whenever possible.
@@ -4198,7 +4200,7 @@ Content-Type: application/reports+json
4198
4200
4199
4201
3. Let |normalizedInput| be null if |input| null; otherwise |input|
4200
4202
interpreted as decimal number.
4201
-
4203
+
4202
4204
4. If |normalizedInput| equals |url|'s [=url/port=] , return "`Matches`".
4203
4205
4204
4206
5. If |url|'s [=url/port=] is null:
@@ -4330,7 +4332,12 @@ Content-Type: application/reports+json
4330
4332
Note: `'strict-dynamic' ` only applies to scripts, not other resource
4331
4333
types. Usage is explained in more detail in [[#strict-dynamic-usage]] .
4332
4334
4333
- 3. If |expression| is an <a>ASCII case-insensitive</a> match for the
4335
+ 3. If |type| is "`script speculationrules`" and |expression| matches the
4336
+ <a grammar>keyword-source</a>
4337
+ "<a grammar>`'inline-speculation-rules'`</a> ", set |allow all inline|
4338
+ to `true`.
4339
+
4340
+ 4. If |expression| is an <a>ASCII case-insensitive</a> match for the
4334
4341
<a grammar>`keyword-source`</a> "<a grammar>`'unsafe-inline'`</a> ",
4335
4342
set |allow all inline| to `true`.
4336
4343
@@ -4381,8 +4388,9 @@ Content-Type: application/reports+json
4381
4388
1. If [[#allow-all-inline]] returns "`Allows`" given |list| and |type|,
4382
4389
return "`Matches`".
4383
4390
4384
- 2. If |type| is "`script`" or "`style`", and [[#is-element-nonceable]]
4385
- returns "`Nonceable`" when executed upon |element|:
4391
+ 2. If |type| is "`script`", "`script speculationrules`", or "`style`", and
4392
+ [[#is-element-nonceable]] returns "`Nonceable`" when executed upon
4393
+ |element|:
4386
4394
4387
4395
1. <a for=set>For each</a> |expression| of |list|:
4388
4396
@@ -4403,8 +4411,8 @@ Content-Type: application/reports+json
4403
4411
"<a grammar>`'unsafe-hashes'`</a> ",
4404
4412
set |unsafe-hashes flag| to `true`. Break out of the loop.
4405
4413
4406
- 5. If |type| is "`script`" or "`style `", or |unsafe-hashes flag| is
4407
- `true`:
4414
+ 5. If |type| is "`script`", "`script speculationrules `", or "`style`", or
4415
+ |unsafe-hashes flag| is `true`:
4408
4416
4409
4417
1. Set |source| to the result of executing <a>UTF-8 encode</a>
4410
4418
on the result of executing <a for="JavaScript string" data-lt="convert">JavaScript string converting</a>
@@ -4522,9 +4530,19 @@ Content-Type: application/reports+json
4522
4530
1. Return `connect-src`.
4523
4531
4524
4532
: "`report`"
4533
+ : "`speculationrules`"
4525
4534
::
4526
4535
1. Return null.
4527
4536
4537
+ <p class="note"> At present, requests with the
4538
+ "`speculationrules`" destination can only be issued by the
4539
+ [:Speculation-Rules:] HTTP header, for which CSP does not apply.
4540
+ If support is added for loading external speculation rules via
4541
+ the <{script}> element's <{script/src}> attribute, for which CSP
4542
+ would apply, then we would need to make this case more
4543
+ complicated, for example by introducing a new
4544
+ [=request/initiator=] and switching on that.
4545
+
4528
4546
3. Return `connect-src`.
4529
4547
4530
4548
Note: The algorithm returns `connect-src` as a default fallback. This is
@@ -5179,7 +5197,7 @@ Content-Type: application/reports+json
5179
5197
<pre>
5180
5198
<a http-header>Content-Security-Policy</a> : img-src 'none' ; script-src 'none' ; font-src 'none'
5181
5199
</pre>
5182
-
5200
+
5183
5201
Supplementing this policy with `default-src 'none' ` would improve the page's robustness
5184
5202
against this kind of attack.
5185
5203
</div>
0 commit comments