Authentication Bypass Vulnerability — Impersonation on Article Comments
The comment submission endpoint trusted a client-supplied user identifier, nickname and email from hidden form fields instead of the authenticated session. An attacker could post comments while appearing to be any other user whose identifier was known or guessable.
Published on take0verx0.medium.com
While interacting with https://www.example.com/article/1234# comment , I found that I can moderate some params. The comment field looks like,
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 trusted identity values supplied by the client in the POST body rather than deriving the commenter from the authenticated session.
Impact
An attacker could impersonate any user whose identifier is known or guessable, potentially damaging reputations or spreading misinformation, and if those identifiers map to other permissions this could lead to broader unauthorised access.
What the attacker needed
A comment form on an article; ability to intercept and edit requests; target user identifier known or guessable
The fix
The server should verify that the user identifier in the request matches the authenticated session's user instead of accepting client-supplied data.
How it was found
- Open an article page and start writing a comment.
- Capture the POST request sent to the comment processing endpoint.
- Change the hidden user identifier, nickname and email fields in the request body.
- Send the request and follow the redirect to see the comment posted under the other identity.
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 post a comment, the site normally knows who you are from your login session. Here the page also sent your identity in hidden fields that the browser could edit, and the server believed them. So someone could change those fields and leave comments that looked like they came from another person.
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.