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

Delete route does not authenticate requests #34

Open
oliverjam opened this issue Jun 1, 2022 · 0 comments
Open

Delete route does not authenticate requests #34

oliverjam opened this issue Jun 1, 2022 · 0 comments

Comments

@oliverjam
Copy link

Your delete route trusts that any request it receives is valid. Its only protection is that you try not to show users the delete button for posts they do not own.

However this is not the only way to send requests. Someone could easily make their own form that submits a random ID to try to delete posts, or even just use curl in the command line:

curl your-site.herokuapp.com -X POST -d "post-id=3"

You need to make sure you check the session ID from the cookie here, then get the user ID using that and then check that user is the owner of this button.

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

1 participant