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

Security issues of tutorial #159

Open
yuta0801 opened this issue Sep 11, 2020 · 8 comments
Open

Security issues of tutorial #159

yuta0801 opened this issue Sep 11, 2020 · 8 comments

Comments

@yuta0801
Copy link

yuta0801 commented Sep 11, 2020

The tutorial seems to have security issues that anyone can

  • create and update any choices through createQuestion
  • update choices with any data through updateChoice

I think it should be added a security note or a new section about how to fix the issues.

Demo in browser console:
image

@flybayer
Copy link
Member

Good catch! For the first issue, the solution is to add ctx.session!.authorize() at the top of every query and mutation. This is added by default in generated code, but I think there's a few places in the tutorial that needs this.

@liamjosephsilk
Copy link
Contributor

Can I take this one?

@flybayer
Copy link
Member

@liamjosephsilk yes!

@yuta0801
Copy link
Author

For the first issue, the solution is to add "ctx.session!.authorize()" at the top of every query and mutation.

Yes, it's also an issue that anyone can post. however the tutorial didn't cover authentication, I think it doesn't matter. (of course, it would be very nice if it will be)
I just wanted to mention that everyone can insert 5+ choices (we probably want to limit it to 4 or lower) and can update choices related to other questions (this is undesirable behavior)

@liamjosephsilk
Copy link
Contributor

Could we make use of authentication in the tutorial? Seen as it comes built in? Align it better with the current onboarding of setting up a project?

@flybayer
Copy link
Member

Yeah would be good to add auth to this!

@goleary
Copy link
Contributor

goleary commented Oct 18, 2020

I'm a little confused following the tutorial because auth seems to have been included in the app/generated code but there is no mention of it in the tutorial and there are inconsistencies because of it.

Perhaps there should be a way to start a project with no auth so that following the tutorial makes more sense.

@flybayer
Copy link
Member

@goleary yeah sorry about that, we need to update the tutorial.

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

5 participants