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

Proposal: content_security_policy.content_scripts #95

Open
carlosjeurissen opened this issue Oct 3, 2021 · 1 comment
Open

Proposal: content_security_policy.content_scripts #95

carlosjeurissen opened this issue Oct 3, 2021 · 1 comment
Labels
implemented: firefox Implemented in Firefox neutral: safari Not opposed or supportive from Safari proposal Proposal for a change or new feature topic: csp Related to content security policy enforcement

Comments

@carlosjeurissen
Copy link
Contributor

Since content_scripts run into a different context than the websites. They are not subject to the CSP of the website. To improve security, allow configuring / setting the CSP of content_scripts using content_security_policy.content_scripts. This has been worked on By Mozilla already.

The implementation by Mozilla is not limited to MV3 and is also supposed to work under MV2.

See:
Mozilla Bugzilla issue 1581608
Mozilla discourse discussion
Mozilla announcement

@dotproto
Copy link
Member

Chrome originally planned to provide a "content_scripts" field in the "content_security_pollicy", but decided not to for technical reasons. I'm out of the office for a bit, so unfortunately I won't be able to follow up on the details here for a couple weeks.

Since content_scripts run into a different context than the websites. They are not subject to the CSP of the website.

This isn't quite accurate. Content scripts run in an isolated world, but they still (mostly) abide by the host page's CSP. To my knowledge the only notable exception here is that extensions are able to inject resources from their own origins. It's also worth noting that content scripts have been subject to CORB since Chrome 73 and CORS since Chrome 83 (source).

@carlosjeurissen carlosjeurissen added the topic: csp Related to content security policy enforcement label Apr 29, 2022
@xeenon xeenon added proposal Proposal for a change or new feature implemented: firefox Implemented in Firefox neutral: safari Not opposed or supportive from Safari labels Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented: firefox Implemented in Firefox neutral: safari Not opposed or supportive from Safari proposal Proposal for a change or new feature topic: csp Related to content security policy enforcement
Projects
None yet
Development

No branches or pull requests

3 participants