Broken Access Control leads to delete any user’s comment
The delete-comment function did not check that the comment belonged to the requesting user, so an attacker could delete another user's comment by swapping the comment identifier in the request. The attacker could delete any user's comment in the same organisation.
medium.com
Published on medium.com
Let’s head into the bug. There was a program where you can create an organization.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server relied on the client-supplied comment identifier without verifying that the comment belonged to the authenticated user.
Impact
An authenticated attacker could delete other users' comments within the same organisation, causing loss of data and disruption.
What the attacker needed
A free account; membership in the same organisation; ability to intercept requests
How it was found
- Create an organisation and add an attacker user and a victim user.
- As the victim, post a comment and delete it while intercepting the request, then drop it.
- As the attacker, post a comment and delete it while intercepting the request, then drop it.
- Replace the attacker's comment ID in the request body with the victim's comment ID.
- Send the modified request and observe that the victim's comment is deleted.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you delete your own comment, the website sends a request containing the comment's ID. The server should check that the comment belongs to you before deleting it. Here it did not, so changing the ID to someone else's comment let the attacker delete that comment.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.