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 Security Policy directive Issue #1485

Open
ibstelix opened this issue Jan 23, 2020 · 2 comments
Open

Content Security Policy directive Issue #1485

ibstelix opened this issue Jan 23, 2020 · 2 comments

Comments

@ibstelix
Copy link

Hello dear support,
Both Chrome and Firefox are throwing this:

[Report Only] Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-0pMlKNC2+1VcvBq5jfj03/wLi+YRDcfXk0EX71iOK5o='), or a nonce ('nonce-...') is required to enable inline execution.

and the conumer_registration link and sign-up link are not found.
Is this related ?
Any hint is appreciated.
Best regards,

@ibstelix
Copy link
Author

Still no solution :( i cannot find where the directive is defined

Jan 25 21:51:20 ibslab jetty9[18906]: [Loaded net.liftweb.http.LiftRules$$Lambda$1159/2059065270 from net.liftweb.http.LiftRules]
Jan 25 21:51:20 ibslab jetty9[18906]: 21:51:20.489 [qtp1151020327-13] WARN net.liftweb.http.LiftRules - Content security policy violation reported on page
Jan 25 21:51:20 ibslab jetty9[18906]:        | 'http://127.0.0.1:8080/' from referrer 'http://127.0.0.1:8080/':
Jan 25 21:51:20 ibslab jetty9[18906]:        | 'inline' was blocked because it violated the
Jan 25 21:51:20 ibslab jetty9[18906]:        | directive 'script-src-elem'. The policy that specified
Jan 25 21:51:20 ibslab jetty9[18906]:        | this directive is: 'default-src 'self'; img-src *; script-src 'unsafe-eval' 'self'; report-uri /lift/content-security-policy-report'.

@ibstelix ibstelix reopened this Jan 25, 2020
@ibstelix
Copy link
Author

Adding in Boot.boot, remove the error but still sgn-up and registration page are unknown:

LiftRules.securityRules = () => {
      SecurityRules(content = Some(ContentSecurityPolicy(
        scriptSources = List(ContentSourceRestriction.Self,
          ContentSourceRestriction.UnsafeInline,
          ContentSourceRestriction.UnsafeEval)
      )))
    }

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

No branches or pull requests

1 participant