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

Provide a mechanism for allow-listing origins which can iframe a Mesop app #271

Closed
wwwillchen opened this issue May 17, 2024 · 0 comments · Fixed by #308
Closed

Provide a mechanism for allow-listing origins which can iframe a Mesop app #271

wwwillchen opened this issue May 17, 2024 · 0 comments · Fixed by #308
Assignees

Comments

@wwwillchen
Copy link
Collaborator

wwwillchen commented May 17, 2024

https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html

API

Option 1 - configure at page-level

@me.page(path="/foo", security_policy=me.SecurityPolicy(allowed_frame_ancestors=["github.com"]))
def app():
   ...

This is nice because it's flexible.

Option 2 - configure at app-level

This could be controlled by a command-line flag or by calling a mesop API at the top-level of a program (e.g. me.register_allowed_frame_ancestors).

Thoughts

I think Option 1 is more flexible and seems more intuitive

Considerations

Default

We should eventually have the default be that there's no allowed frame ancestor (except for self, which is always permitted). However, we should have good documentation on setting this up before making this the default behavior.

Editor mode

For editor mode, we would probably always allow any frame ancestor, regardless of what's specified, because this is required for Mesop to load in Colab which will iframe Mesop in a randomly-generated origin so it's not possible to specify this ahead of time. Given that apps should never be deployed in editor mode, this seems like a reasonable choice.

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

Successfully merging a pull request may close this issue.

1 participant