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

Set up some form of authentication for the Discovery editor #559

Closed
nerik opened this issue Jun 19, 2023 · 5 comments
Closed

Set up some form of authentication for the Discovery editor #559

nerik opened this issue Jun 19, 2023 · 5 comments
Assignees

Comments

@nerik
Copy link
Contributor

nerik commented Jun 19, 2023

The discovery editor, in its current form, is unsafe to be deployed. While it won't make it to production as part of the sandbox, our staging environment is not password protected. And this editor could in theory be used for a code injection based attack.

My hunch is that trying to sanitize the user's input is a fools errand, so we could decide to either

Of course this relies on this assumption that a limited number of reliable people have access or knowledge of the credentials, and we deem that sufficient as a protection measure.

Thoughts @hanbyul-here @danielfdsilva ?

@nerik
Copy link
Contributor Author

nerik commented Jun 19, 2023

TBH I'm a little surprised the MDX playground itself is using eval... And allows cross-scripting in theory
Screenshot 2023-06-19 at 15 31 46

@nerik nerik self-assigned this Jun 19, 2023
@danielfdsilva
Copy link
Collaborator

Password protecting staging is easy and we could do it without a problem.

I wonder if the single route protection works given that this is a SPA (no server route request), and not directory based routing.

Nevertheless, I would not be too worried about security at this point. The code will always remain on the client side, so any "malicious" code that the user writes will only affect them. Only once the code gets stored and sent to other users, there's the possibility of arbitrarily executing code.

@nerik
Copy link
Contributor Author

nerik commented Jun 21, 2023

Got it, thanks.

@hanbyul-here
Copy link
Collaborator

Yeah. It still gives me cold feet that that user can run whatever script, but I can't think of a case where this can be a big security problem as long as the executable code lives only on the client side.

@danielfdsilva
Copy link
Collaborator

As of current implementation, no security issues with the editor itself and the envs are password protected by netlify. Closing.

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