• GitHub
  • Documentation
  • Discord
  • Tip
search
  • chevron_right Threads
  • label Support

Content-Security-Policy when using Misago

DmitriyM
July 24, 2017
chat_bubble_outline 5
  • link
    DmitriyM
    Members 15 posts
    July 24, 2017, 3:20 p.m. July 24, 2017, 3:20 p.m.
    link

    What Content-Security-Policy should I use with Misago?

    Now I use default-src 'self'; script-src 'self' 'unsafe-inline' www.google.com/recaptcha/ www.gstatic.com/recaptcha/; style-src 'self' 'unsafe-inline'; frame-src www.google.com/recaptcha/; block-all-mixed-content;

    Is it right? Is all OK without script-src unsafe-eval?
    Did I forget about any other domains?

  • arrow_forward

    Thread has been moved from Development Discussion.

    • By rafalp on July 25, 2017, 12:32 p.m..
  • link
    rafalp
    Project Lead 2028 posts
    July 25, 2017, 12:34 p.m. July 25, 2017, 12:34 p.m.
    link

    Moving to questions as this seems to be setup question and not dev discussion.

    I don't have recommendation here to made. What are you after? Are you afraid of people injecting custom <script> tags on your site?

  • link
    DmitriyM
    Members 15 posts
    July 26, 2017, 12:48 p.m. July 26, 2017, 12:48 p.m.
    link
    @rafalp

    Are you afraid of people injecting custom <script> tags on your site?

    Yes, I'm afraid of. With my statistics from my other sites (not Misago), ~2% users have any kind of injected script, iframe or other mailware.

  • link
    rafalp
    Project Lead 2028 posts
    July 26, 2017, 1:52 p.m. July 26, 2017, 1:52 p.m.
    link
    @DmitriyM

    ~2% users have any kind of injected script, iframe or other mailware.

    What do you mean? 2% of users successfully compromise site by injecting malicious JS?

  • link
    DmitriyM
    Members 15 posts
    July 26, 2017, 1:58 p.m. July 26, 2017, 1:58 p.m.
    link
    @rafalp
    @DmitriyM

    ~2% users have any kind of injected script, iframe or other mailware.

    What do you mean? 2% of users successfully compromise site by injecting malicious JS?

    Not compromised, but that users see unexpected advertisement, which I can not control. This may lead to other site redirecting of password steal.
    I prefer not to risk, if I can avoid it.

  • link
    rafalp
    Project Lead 2028 posts
    July 26, 2017, 9:44 p.m. July 26, 2017, 9:44 p.m.
    link

    Well, the bad news is, if user somehow manages to inject the <script> into the site, it'll run under policies that are mandatory for Misago's regular JS to run as well. You may hope to block the most outside scripts, but if <script src="">'s there and its blocked, obvious next move will be to use same way to inject <script>inline stuff</script> instead.

arrow_upward Go to top
  • This site uses cookies to gather statistical data for use in traffic analysis.
  • GitHub
  • Documentation
  • Discord
  • Tip
  • Terms of service
  • Privacy policy
powered by misago