Skip to content
Access control Write-up Beginner

Exploiting BAC: Unlimited Likes in Comment Sections

The comment creation endpoint accepted extra parameters for up_votes and is_pinned, allowing a user to set an arbitrary number of likes and pin their own comment. An attacker could give themselves unlimited likes and pin comments without authorisation.

medium.com

Published on medium.com

— — — — — — — — — Free Article Link: Here!!— — — — — — — — —

Raunak Gupta Aka B1scuit, on medium.com

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 did not restrict which fields a user could set when creating a comment, allowing mass assignment of privileged attributes.

Impact

An attacker could give their comments an arbitrary number of likes and pin them, potentially manipulating the community section.

What the attacker needed

A user account on the site

How it was found

  1. Post a comment and observe the HTTP request in a proxy.
  2. Notice the response includes up_votes and is_pinned parameters.
  3. Add those parameters to the request and set up_votes to a large number and is_pinned to true.
  4. Send the modified request and see the comment with many likes and pinned.

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 website sends data to its server. The server should only accept the fields it expects, like the comment text. Here, the server also accepted fields that control how many likes the comment has and whether it is pinned, so a user could set those values themselves.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.