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

Edit or delete comment even if the user is not the creator #52

Open
marcus-gerhardy opened this issue Apr 3, 2024 · 1 comment
Open
Labels

Comments

@marcus-gerhardy
Copy link

Q A
Bug? yes
New Feature? no
Sulu Version 2.5.13
Sulu Comment Bundle Version 2.0.0
Browser Version Google Chrome Version 123.0.6312.86 (Official Build) (64-bit)

Actual Behavior

It is possible to manipulate or delete existing comments / threads by simply sending post requests to the WebsiteController:
e.g. https://localhost:8000/threads/b69cc46e-9527-48b5-a98d-3a3634c41f05/comments/2

Neither the WebsiteController nor the CommentManager validates the current user with the creator of the comment.

Expected Behavior

Only the creator of the comment should be able to delete or edit the comment.

Steps to Reproduce

  1. Create a comment on the website frontend
  2. Send post or delete request with threadId and commentId (you can find them in the html code on the frontend)
@marcus-gerhardy marcus-gerhardy changed the title Edit or delete comment even if not the user is not the creator Edit or delete comment even if the user is not the creator Apr 3, 2024
@alexander-schranz
Copy link
Member

alexander-schranz commented Apr 3, 2024

Seems to be introduced in #31 /cc @wachterjohannes @martinlagler @chirimoya

Critical point I think is that comment bundle does not always mean there is a user / login. So this API maybe should not be available when not have a login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants