WICG / document-policy

https://wicg.github.io/document-policy/
Other
19 stars 8 forks source link

Document Policy and CSP? #21

Open mikewest opened 4 years ago

mikewest commented 4 years ago

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:

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 commented 4 years ago

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.