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

Iframe CSRF Token Missing #7079

Open
985958118 opened this issue Jul 26, 2024 · 6 comments
Open

Iframe CSRF Token Missing #7079

985958118 opened this issue Jul 26, 2024 · 6 comments

Comments

@985958118
Copy link

HTML:

<iframe width={1500} height={800} src="http://xxx:8080/dashboards" />

Nginx:

server {
listen 8080;
server_name _;
location / {
proxy_pass http://xxx:5000;
more_set_headers "Access-Control-Allow-Origin: * ";
more_set_headers "X-Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval'; font-src 'self' data:; img-src 'self' http: https: data: blob:; object-src 'none'; frame-src redash.io;";
more_set_headers "Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval'; font-src 'self' data:; img-src 'self' http: https: data: blob:; object-src 'none'; frame-src redash.io;";
more_set_headers "X-Frame-Options: xxx";
more_set_headers "Set-Cookie: $sent_http_set_cookie; HttpOnly; Secure; SameSite=None";
}
}

image
image

@985958118
Copy link
Author

image

@eradman
Copy link
Collaborator

eradman commented Jul 29, 2024

There is a setting to enable CSRF

ENFORCE_CSRF = parse_boolean(os.environ.get("REDASH_ENFORCE_CSRF", "false"))

Try adding this to your .env file.

This is not documented! This should be added to https://redash.io/help/open-source/admin-guide/env-vars-settings/

@justinclift
Copy link
Member

@lucydodo Any interest in adding that? ^^^ 😄

@lucydodo
Copy link
Member

@justinclift Sure. I'll go home and add it to the documentation. :)

@justinclift
Copy link
Member

@985958118 @eradman It's now on the website's environment variables list:

https://redash.io/help/open-source/admin-guide/env-vars-settings/

@eradman
Copy link
Collaborator

eradman commented Aug 1, 2024

@985958118 did enabling CSRF solve your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants