-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
CSP directive needs 'unsafe-eval' to evaluate Deck.gl "Javascript Data Interceptor" #24947
Comments
I am experiencing the same type for Handlebars on the 3.0.0rc3. |
Also experiencing on handlebar charts in 3.0.0 and worked in 2.1 Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'strict-dynamic' 'nonce-4LtoOfLG9FyQxTFtAg3XpkVBtPqO6CwI'". Tried TALISMAN_CONFIG options as in the config.py file but did not work in superset_config.py TALISMAN_ENABLED = False does work in superset_config.py but would prefer not to do that. |
Is there any solution for it> I am using 3.1.1? |
Hi, the following config works around this issue for me: TALISMAN_CONFIG = {
"content_security_policy": {
"default-src": ["'self'"],
"img-src": ["'self'", "blob:", "data:"],
"worker-src": ["'self'", "blob:"],
"connect-src": [
"'self'",
"https://api.mapbox.com",
"https://events.mapbox.com",
],
"object-src": "'none'",
"style-src": [
"'self'",
"'unsafe-inline'",
],
"script-src": ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
},
"content_security_policy_nonce_in": ["script-src"],
"force_https": False,
} This is based on upstream config for 3.0.2, so you might want to check this config value for the version you're using, and adjust accordingly. The default is set in this file: https://github.com/apache/superset/blob/master/superset/config.py#L1402 |
This seems like a config issue more than a docs issue, but how would you propose resolving it? I don't think we should turn on |
|
How to reproduce the bug
deck.gl Scatterplot
chart -> Rendering on Map works fineExpected results
The render on the map still works fine without any modifications to CSP directives
Actual results
Error thrown in the console:
Screenshots
Environment
(please complete the following information):
764f0f79ca636d50e7660cdfe5975c881df6c024
with unchangeddocker-compose-non-dev.yml
andSUPERSET_ENV = production
andFLASK_ENV = production
environment value. Deployed withdocker-compose
.Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
Talisman / CSP has been enabled by default here: #24262 , documentation says:
Documentation does not say anything about a needed
unsafe-eval
directive. However, it seems at least for thedeck.gl Scatterplot
chart to work properly with a "Javascript Data Interceptor" set, the Talisman config needs theunsafe-eval
directive on "script-src":I am not sure if this is a bug in deck.gl Scatterplot or if it is okay to set the
unsafe-eval
directive in the TALISMAN_CONFIG.Thanks for your help!
The text was updated successfully, but these errors were encountered: