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

Support iframe sandbox attribute ... #4340

Closed
2 tasks done
DeepDiver1975 opened this issue Apr 23, 2024 · 11 comments
Closed
2 tasks done

Support iframe sandbox attribute ... #4340

DeepDiver1975 opened this issue Apr 23, 2024 · 11 comments

Comments

@DeepDiver1975
Copy link

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Is your feature request related to a problem? Please describe.
From a security perspective a iframes should use sandbox attributes to limit attack vectors and jail an application inside an iframe.
It should be enough to load drawio in an iframe with sandbox="allow-scripts" but drawio tries to access the parent document.

Access to document.cookie

image
This can be worked around by specifying the urlParam mode=foo

Access to Navigator.serviceWorker

image
I could not find a workaround to this - no idea if it is even possible to run without the service worker

Describe the solution you'd like
drawio should not try to break out of the iframe - at least workarounds should be documented.

Describe alternatives you've considered
See above

@davidjgraph
Copy link
Collaborator

Are you asking how to set a CSP on your own deployment?

@DeepDiver1975
Copy link
Author

Are you asking how to set a CSP on your own deployment?

no. When embedding drawio in an iframe I want to use a minimal set of sandbox attributes. I mainly don't want to grant allow-same-origin - only granting allow-scripts should be sufficient.
https://www.w3schools.com/tags/att_iframe_sandbox.asp

THX

@davidjgraph
Copy link
Collaborator

We have reasons for how we configure our own deployment. If you need something different simply create your own deployment.

@DeepDiver1975
Copy link
Author

It is not about the deployment. Even if I run my own deployment of drawio I can still not iframe it with the desired iframe sandbox.

Unless I miss anything. THX a lot

@davidjgraph
Copy link
Collaborator

Should work in 24.3.1

@DeepDiver1975
Copy link
Author

Thx a lot. I will test this asap!

@DeepDiver1975
Copy link
Author

I am sorry to say - but this is not fixed ...

let me know if you need any further support - thx

image

@DeepDiver1975
Copy link
Author

@davidjgraph can you please reopen this issue?

@DeepDiver1975
Copy link
Author

@davidjgraph is there any fix? Shall I retest anything?

@alderg
Copy link
Contributor

alderg commented Jun 7, 2024

Should work now.

@DeepDiver1975
Copy link
Author

Looks like it is working now - THX @davidjgraph @alderg

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

3 participants