Skip to content
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

Document Policy and CSP? #21

Open
mikewest opened this issue Dec 6, 2019 · 1 comment
Open

Document Policy and CSP? #21

mikewest opened this issue Dec 6, 2019 · 1 comment

Comments

@mikewest
Copy link
Member

mikewest commented Dec 6, 2019

The Document Policy document notes that there's some potential overlap with CSP, at least insofar as the sandbox directive exists. It's not entirely clear to me what DP aims to address, and what its scope actually boils down to, but there might be more overlap. Consider the following:

  • script-src offers control over specific APIs like eval() via the unsafe-eval keyword. Similar proposals exist to gate WASM via some other keyword.
  • trusted-types controls TT enforcement.
  • block-all-mixed-content can be seen as a restriction on Fetch, but it could also be a feature toggle insofar as it sets a flag on the document context.
  • upgrade-insecure-requests is similarly situated.
  • plugin-types gates <embed> and <object>
  • navigate-to aims to address navigation-related issues.

https://github.com/mikewest/csp-next suggests that we should really break these kinds of mechanisms out of CSP, and into something else. That document focuses on script execution, defining a scripting-policy concept that would probably encompass the unsafe-eval bits and maybe the plugin bits? Perhaps Document Policy would be a reasonable home for the rest?

@clelland
Copy link
Collaborator

clelland commented Dec 6, 2019

That sounds like a good fit -- with the possible exception of 'navigate-to', which might benefit from CSP's rich source-list syntax. The other directives all focus on what a document can do, once loaded, without necessarily forcing the same restrictions on nested content, which is the model document policy is trying to cover.

@clelland clelland transferred this issue from w3c/webappsec-permissions-policy Dec 1, 2020
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

No branches or pull requests

2 participants