Skip to content

Conversation

@ggazzo
Copy link
Member

@ggazzo ggazzo commented Feb 12, 2021

Closes #19815

Proposed changes (including videos or screenshots)

Security policies were applied for inline scripts cases. Due to the libraries and components we use it is not possible to disable inline styles and images as they would break Oembeds and other libraries.

basically the inline scripts were moved to a js file

and besides that some suggars syntax like addScript and addStyle were added, this way the application already takes care of inserting the elements and providing the content automatically.

Issue(s)

Steps to test or reproduce

Further comments

@ggazzo ggazzo force-pushed the csp branch 2 times, most recently from 7d5cc94 to 79c59f4 Compare June 4, 2021 16:21
@ggazzo ggazzo changed the title CSP wip [NEW] Content-Security-Policy for inline scripts Jun 4, 2021
@RocketChat RocketChat deleted a comment from lgtm-com bot Jun 4, 2021
@ggazzo ggazzo requested review from a team and removed request for a team June 4, 2021 16:38
@ggazzo ggazzo marked this pull request as ready for review June 4, 2021 16:41
@ggazzo ggazzo requested review from a team June 4, 2021 16:42
@ggazzo ggazzo added this to the 3.16.0 milestone Jun 9, 2021
@ggazzo ggazzo requested a review from sampaiodiego June 20, 2021 05:44
@DocDocTeam
Copy link

Updated to 3.16. There was an error Content-Security-Policy
"Refused to load the script 'https://lib.usedesk.ru/secure.usedesk.ru/widget_111111.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback."

While disabled in the general settings Content-Security-Policy.
The documentation is empty https://github.com/RocketChat/docs/blob/master/guides/administration/administration/settings/setup-wizard.md

  1. You write "basically the inline scripts were moved to a js file" - in which one?
  2. How do I whitelist my script?

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

Successfully merging this pull request may close these issues.

Not possible to set an effective Content-Security-Policy (CSP) because of in-line content

4 participants