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.

@mikewest
Copy link
Member Author

Friendly ping, Antonio. :)

Copy link
Member

@antosart antosart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks and sorry for the delay, I missed this.

@mikewest mikewest merged commit 13c7d8e into main Oct 29, 2025
2 checks passed
@mikewest mikewest deleted the fix-426 branch October 29, 2025 12:23
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?

3 participants