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

content: Required Content-Security-Policy headers needed to not break the application #2962

Open
ijsje71 opened this issue May 15, 2023 · 0 comments
Labels
triage New issues

Comments

@ijsje71
Copy link

ijsje71 commented May 15, 2023

URL

https://capacitorjs.com/docs/guides/security#web-view-security

Issue Description

For additional protection against XSS attacks, I want to add Content-Security-Policy headers in my Ionic React application. I am, however, unable to figure out what Content-Security-Policies are required for the application to not break. The URL that I posted in this issue tells us to add a default-src 'self' tag, but when this tag is applied in a PWA, it breaks the larger part of the application. Components such as the search bar are no longer correctly displayed and the browser console shows some sources that cannot be loaded because of this 'self' tag. Even if I follow these instructions, I am not able to correctly include the different types of sources required in the Content-Security-Policies header for the application to completely work. Especially the style-src & the script-src tags need a configuration which is hard to figure out.

I believe it would be best to document some of the required Content-Security-Policy headers somewhere in the Ionic docs, so that people who want to secure their application further, can do this. I would assume that the answer to include all the inline script executions in the Content-Security-Policy headers is something that can be used on all Ionic React applications. This is why I think it would be best that it is documented somewhere.

@ijsje71 ijsje71 added the triage New issues label May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New issues
Projects
None yet
Development

No branches or pull requests

1 participant