servo: Missing CSP checks for most JS evaluation entrypoints

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 21 (21 by maintainers)

Commits related to this issue

Most upvoted comments

All right, since both Trusted Types and CSP have very similar testing requirements, things are a bit mixed.

  • #36596 implements the first step for Trusted Types, but also fixes several other missing pieces of CSP to make the Trusted Types tests happy.
  • #36603 then hooks up the correct machinery with new Worker to handle the correct headers and introduces a new method GlobalScope::parse_csp_list_from_metadata
  • #36623 uses that new method and adds support for the csp-report-only header to fix reporting CSP and Trusted Types tests

I think I can tackle these while working on the Trusted Types integration for these attributes.

We currently pass 133 out of 147 tests in script-src. Unfortunately the remaining tests either rely on SharedWorker, or I don’t really know how to tackle them. As an example, https://wpt.fyi/results/content-security-policy/script-src/javascript-window-open-blocked.html?product=servo I don’t understand why that would be failing, given the rest already handles javascript: in a straightforward manner.

Assuming that, can you unassign me from this issue or close it as resolved? If you do have any more pointers, do let me know.

I have come to realise after yesterday’s debugging session that to me the iframe machinery are a big mystery. I don’t understand yet why they are different and why they don’t use the other network code I have come to touch. Do you mind doing another debugging session like you did with FetchTaskTarget to figure out the missing spots? If we can hook up the policy container, then I think I can continue from there to implement the rest of the feature.