Skip to content

Further clarify post-request check #730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3800,6 +3800,11 @@ Content-Type: application/reports+json
Given a <a for="/">request</a> |request|, a <a>response</a> |response|,
a <a>directive</a> |directive|, and a <a for="/">policy</a> |policy|:

Note: This check needs both |request| and |response| as input
parameters since if |request|'s <a for="request">cryptographic nonce metadata</a>
or <a for="request">integrity metadata</a> matches, then the script is allowed to load
and the check of whether |response|'s url matches the source list is skipped.

1. If |request|'s <a for="request">destination</a> is <a for="request/destination">script-like</a>:

1. Call [=potentially report hash=] with |response|, |request|, |directive| and |policy|.
Expand All @@ -3814,13 +3819,17 @@ Content-Type: application/reports+json
for="request">integrity metadata</a> and this directive's <a
for="directive">value</a> is "`Matches`", return "`Allowed`".

1. If |directive|'s <a for="directive">value</a> contains
"<a grammar>`'strict-dynamic'`</a>":
1. If |directive|'s <a for="directive">value</a> contains a <a>source
expression</a> that is an <a>ASCII case-insensitive</a> match for
the "<a grammar>`'strict-dynamic'`</a>" <a grammar>keyword-source</a>:

1. If |request|'s <a for="request">parser metadata</a> is not
<a>"parser-inserted"</a>, return "`Allowed`".
1. If the |request|'s <a for="request">parser metadata</a> is
<a>"parser-inserted"</a>, return "`Blocked`".

Otherwise, return "`Blocked`".
Otherwise, return "`Allowed`".

Note: "<a grammar>`'strict-dynamic'`</a>" is explained in more detail
in [[#strict-dynamic-usage]].

1. If the result of executing [[#match-response-to-source-list]] on
|response|, |request|, |directive|'s <a for="directive">value</a>,
Expand Down