KEMBAR78
Apply `strict-dynamic` to inline scripts. by mikewest · Pull Request #787 · w3c/webappsec-csp · GitHub
Skip to content

Conversation

@mikewest
Copy link
Member

@mikewest mikewest commented Oct 23, 2025

As noted in #426, the current "Does element match source list for type and source?" algorithm does not properly handle strict-dynamic checks for non-parser-inserted inline scripts. This patch adds a relevant step to the algorithm to match both browser behavior and our existing tests:

https://wpt.fyi/results/content-security-policy/script-src/script-src-strict_dynamic_non_parser_inserted.html?label=experimental&label=master&aligned

Fixes #426.


Preview | Diff

As noted in #426, the current "Does element match source list for type
and source?" algorithm does not properly handle `strict-dynamic` checks
for non-parser-inserted inline scripts. This patch adds a relevant step
to the algorithm to match both browser behavior and our existing tests:

https://wpt.fyi/results/content-security-policy/script-src/script-src-strict_dynamic_non_parser_inserted.html?label=experimental&label=master&aligned

Fixes #426.
@mikewest mikewest requested a review from antosart October 23, 2025 08:16
@mikewest
Copy link
Member Author

Would you mind taking a look at this, Antonio? All browsers are currently aligned on the behavior, and it's locked in with tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does strict-dynamic allow dynamically adding inline scripts?

1 participant