Skip to content
Access control Write-up Beginner

Abusing new Claps feature in Medium

The claps feature on Medium enforced restrictions only in the browser, so a user could send a crafted request to clap for their own story and to see how many claps each user gave. An attacker could therefore bypass the intended limits and view clap counts that were meant to be private to the author.

Sai Krishna Kothapalli Follow

Published on medium.com

{{media:0}}

Sai Krishna Kothapalli, 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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Medium is a publishing platform where readers react to stories. In 2017 the platform replaced its heart symbol, used to love posts, with a new feature called claps. The researcher noticed the change one night, read Medium's help article explaining the feature, and decided to test the claims it made.

The help article made three statements that framed the whole investigation:

You cannot clap for your own posts.

Only a post's author can see how many claps individual users gave. Readers will see only a list of who clapped.

Claps on a post are limited to 50 per user.

Each of these is an access-control or business-rule claim, and each one is enforced somewhere. The question the researcher asked was whether that somewhere is the browser or the server.

Setup

The only tool named in the report is Burp Suite, used to capture the clap request. The researcher had a normal Medium account and used it to clap for another user's story, then inspected the resulting traffic. No special role, privilege or configuration is described beyond that.

Finding it

The clap button is disabled on your own stories, which is how the first rule is presented to users. A disabled button is a front-end control: it stops a click in the page, not a request on the wire. That gap is what prompted the researcher to capture a legitimate clap and replay it with a different story identifier.

Exploitation

Step 1: capture a legitimate clap

The researcher clapped for another story on Medium and captured the request in Burp Suite. The request is a POST to the following path, where STORY_ID identifies the story being clapped:

HTTP
/_/api/posts/STORY_ID/claps

Step 2: change the story identifier

With the request captured, the researcher replaced STORY_ID with the identifier of their own story and sent it again. The server answered with a 200 status and success:true, meaning the clap was accepted. The researcher calls this a classic case of IDOR.

Image for post
POST request From the original on medium.com

The screenshot shows the POST request and its response.

Step 3: try to exceed the clap limit

The second rule limits claps on a post to 50 per user. The researcher tried to bypass this by clapping more than 50 times, but none of the techniques worked. The limit held. What did work was clapping 50 times for their own post, and Medium did not remove those claps after the report.

Image for post
Clapping for my own stories. From the original on medium.com

The screenshot shows the researcher's own stories carrying claps.

Step 4: read per-user clap counts

The third rule says only a post's author can see how many claps individual users gave, while readers see only a list of who clapped. A GET request to the following path returns the list of users who clapped:

HTTP
/p/POST_ID/upvotes

In the response, each user who clapped has a field called clapCount, which is that user's clap count for the post. Any user can read the clap count of any post through this endpoint, so the restriction to the author exists only in the front end.

Image for post
Image for post From the original on medium.com
Image for post
Image for post

The screenshots show the response containing the per-user clap counts.

Root cause

Both issues come from the same mistake: the rules were enforced in the browser rather than on the server. Disabling the clap button on your own stories does not stop a POST to the claps endpoint for your own story, and hiding per-user clap counts from readers does not stop a GET to the upvotes endpoint from returning them. The server accepted the request and returned the data regardless of who was asking. The 50-clap limit, by contrast, appears to have been checked server-side, since the researcher could not get past it.

Impact

An authenticated user could clap for their own stories, up to the 50-clap limit that the server did enforce. Any user could also read the per-user clap counts on any post, which Medium intended to show only to the post's author. The researcher states that the issue has no security implication, and no bounty was paid; Medium offered some schwag and added the researcher to the Hall Of Fame page.

Image for post
Medium Hall Of Fame From the original on medium.com

The screenshot shows the Medium Hall Of Fame.

Fix

The report says the issue was reported to Medium and has since been fixed, without describing the change. The general lesson the researcher draws is not to rely on front-end restrictions and to do the checks on the back end.

Variants to test

  1. Capture a state-changing request that the UI disables for certain objects, such as a like, follow, vote or rating, then replay it with the identifier of an object you are not supposed to act on. A positive result is a success response such as success:true where the UI would not have allowed the action.
  2. Take a read endpoint that the UI shows only to an owner, such as an upvotes or voters list, and request it as an unrelated user. A positive result is a response containing per-user detail, such as a count field, that the product says only the owner can see.
  3. Test business-rule limits separately from access control: repeat an action past its documented cap and check whether the server rejects it. A positive result is the action succeeding beyond the stated limit, which would show the cap is also front-end only.
  4. Compare the response for your own object with the response for someone else's object at the same endpoint. A positive result is identical structure and data for both, showing no ownership check on the server.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

What happened, in plain words

Medium is a website where people publish articles, called stories, and other people read them and react. In 2017, Medium changed how reactions worked. Before, you could tap a small heart to show you liked a story. Medium removed the heart and replaced it with something called claps. You could clap for a story, and you could clap several times, up to a limit.

The researcher who wrote this report noticed the change one night while opening Medium to write something. The heart was gone. He went on Twitter to see what had happened and found that many other users were confused too. After looking around a bit, he found a help article from Medium that explained the new claps feature.

That help article made three promises about how claps should behave:

You cannot clap for your own posts.

Only a post's author can see how many claps individual users gave. Readers will see only a list of who clapped.

Claps on a post are limited to 50 per user.

Each of these is a rule about who is allowed to do what, or about how much of something is allowed. Security people call the first kind an access-control rule and the second kind a business rule. The important question the researcher asked was simple: where is each rule actually checked? Is it checked in the browser, meaning the page you see, or on the server, meaning the computer that stores the stories and the claps?

That question matters because anything checked only in the browser can usually be bypassed. The browser is under the control of the person using it. If a page simply hides a button or greys it out, the request that the button would have sent can still be sent by other means. If the server does not check the rule again when the request arrives, the rule is not really enforced.

This report is about two of those three rules turning out to be enforced only in the browser, and about the third one holding up.

The tool used to look at the traffic

The only tool named in the report is Burp Suite. To follow this, you need one idea first: when you use a website, your browser and the server are constantly exchanging messages. Your browser sends a request, such as "show me this story" or "record my clap", and the server sends back a response, such as the page or a short confirmation. Burp Suite is a program that sits between your browser and the server and lets you read those messages, pause them, change them and send them again.

The researcher had a normal Medium account. He used it to clap for another person's story, then looked at the message that the clap produced. Nothing special is described beyond that: no administrator account, no special setting, just a regular account and the ability to watch and edit the traffic.

Finding the gap

On your own stories, the clap button is disabled. That is how the first rule, "you cannot clap for your own posts", is presented to you as a user. You see a button, and the button does not work.

A disabled button is a browser-side control. It stops a click inside the page. It does not stop a request from being sent by some other means. The researcher reasoned that if the only thing preventing a clap on your own story was a disabled button, then sending the same kind of request by hand might succeed. That is why he captured a real clap and then replayed it with a different story identifier.

Step 1: capture a real clap

He clapped for another story on Medium and captured the request in Burp Suite. The request is a POST to this path, where STORY_ID stands for the identifier of the story being clapped:

HTTP
/_/api/posts/STORY_ID/claps

What this means, piece by piece:

  • POST is the type of request. A POST is normally used when you are asking the server to change something, such as recording a clap, rather than just asking to view a page.
  • /_/api/ is a path prefix. The letters API stand for Application Programming Interface. In a website, an API is the set of addresses the page uses behind the scenes to talk to the server in a structured way, usually exchanging data rather than full web pages. You can think of it as the service counter at the back of a shop: the shop front is what customers see, the counter is where the actual transactions happen.
  • posts says we are dealing with stories, which Medium calls posts.
  • STORY_ID is a placeholder for the unique identifier of one particular story. Every story has its own identifier, a short string that the server uses to know which story you mean.
  • claps says the action is about claps.

So the whole path reads as: "record a clap on the story whose identifier is STORY_ID".

Step 2: change the story identifier

With the request captured, the researcher replaced STORY_ID with the identifier of his own story and sent the request again. The server answered with a 200 status and success:true.

A status code is a number the server sends back to say how the request went. 200 is the standard code for "it worked". The body of the response contained success:true, which is the server explicitly confirming that the clap was recorded.

Image for post
POST request From the original on medium.com

The screenshot shows the POST request and the response it got back.

This is what security people call an IDOR. The letters stand for Insecure Direct Object Reference. In plain words: the server takes an identifier that you supply, such as a story identifier, and acts on whatever object that identifier points to, without checking whether you are allowed to act on that particular object. The identifier is direct because it names the object itself, and it is insecure because the server trusts it without checking permission.

An everyday comparison: imagine a hotel where the key card opens any room whose number you type into the door. The door checks that the number is valid, not that the room is yours. Here, the server checked that the story existed and recorded the clap, but did not check that the story belonged to someone other than the person clapping.

Why did this matter? Because the first rule from the help article, "you cannot clap for your own posts", was supposed to prevent exactly this. The disabled button was the only thing standing in the way, and a disabled button is not a server-side check.

Step 3: try to go past the clap limit

The second rule says claps on a post are limited to 50 per user. The researcher tried to bypass this by clapping more than 50 times, but none of the techniques worked. The limit held.

This is a useful contrast with the first rule. The limit was apparently checked on the server, because changing things in the browser did not get past it. The researcher did clap 50 times for his own post, which the first issue allowed, and Medium did not remove those claps after he reported the problem.

Image for post
Clapping for my own stories. From the original on medium.com

The screenshot shows the researcher's own stories carrying claps.

Step 4: read the per-user clap counts

The third rule says only a post's author can see how many claps individual users gave, while readers see only a list of who clapped. In other words, everyone can see the names of the people who clapped, but only the author should see how many claps each of those people gave.

A GET request to this path returns the list of users who clapped:

HTTP
/p/POST_ID/upvotes

What this means, piece by piece:

  • GET is the type of request used to ask for something to be read, not changed. It is the ordinary kind of request your browser makes when you open a page.
  • /p/ is a path prefix, followed by POST_ID, the unique identifier of a particular story.
  • upvotes is the name of the list being requested: the people who gave a positive reaction to the story.

So the whole path reads as: "give me the list of people who clapped for the story whose identifier is POST_ID".

In the response, each user who clapped has a field called clapCount, which is that user's clap count for the post. A field here means one named piece of data inside the response, like one labelled box in a form. The response therefore contained not just the names of who clapped, but also how many claps each of them gave.

Any user could read the clap count of any post through this endpoint. An endpoint is simply one address on the server that does one job, like one window at a service counter. The restriction that only the author should see per-user counts existed only in the front end, meaning in the page shown to the reader, not in the server's answer.

Image for post
Image for post From the original on medium.com
Image for post
Image for post

The screenshots show the response containing the per-user clap counts.

Why both problems happened

Both issues come from the same mistake: the rules were enforced in the browser rather than on the server.

Disabling the clap button on your own stories does not stop a POST to the claps endpoint for your own story. Hiding per-user clap counts from readers does not stop a GET to the upvotes endpoint from returning them. In both cases the server accepted the request and returned the data regardless of who was asking.

The 50-clap limit, by contrast, appears to have been checked on the server, since the researcher could not get past it. That is the difference between a rule that is really enforced and a rule that is only displayed.

What someone could actually do with this

An authenticated user, meaning someone logged in with a normal account, could clap for their own stories, up to the 50-clap limit that the server did enforce. Any user could also read the per-user clap counts on any post, which Medium intended to show only to the post's author.

The researcher states that the issue has no security implication, and no bounty was paid. Medium offered some schwag, meaning promotional items such as clothing or stickers, and added the researcher to the Hall Of Fame page.

Image for post
Medium Hall Of Fame From the original on medium.com

The screenshot shows the Medium Hall Of Fame.

How it was fixed

The report says the issue was reported to Medium and has since been fixed, without describing the change. The general lesson the researcher draws is not to rely on front-end restrictions and to do the checks on the back end.

Other places to look for the same mistake

  1. Capture a request that changes something and that the page disables for certain objects, such as a like, a follow, a vote or a rating. Then send it again with the identifier of an object you are not supposed to act on. A positive result is a success response such as success:true where the page would not have allowed the action.
  2. Take a read address that the page shows only to an owner, such as an upvotes or voters list, and request it as an unrelated user. A positive result is a response containing per-user detail, such as a count field, that the product says only the owner can see.
  3. Test business-rule limits separately from access control. Repeat an action past its documented cap and check whether the server rejects it. A positive result is the action succeeding beyond the stated limit, which would show the cap is also only in the browser.
  4. Compare the response for your own object with the response for someone else's object at the same address. A positive result is identical structure and data for both, showing no ownership check on the server.

Glossary

  • API: the set of addresses a website's pages use behind the scenes to exchange data with the server, rather than full web pages.
  • Access control: the rules about who is allowed to do what, such as who may clap for a story or read a particular list.
  • Authenticated user: someone who is logged in with an account.
  • Back end: the server side, the computers that store data and decide what to send back.
  • Bounty: a payment a company makes to someone who reports a security problem to it.
  • Burp Suite: a program that sits between your browser and a server so you can read, pause, change and resend the messages they exchange.
  • Business rule: a rule about how much of something is allowed, such as a limit of 50 claps per user, rather than about who is allowed.
  • Clap: Medium's reaction feature introduced in 2017, replacing the earlier heart, where a reader can clap for a story several times up to a limit.
  • clapCount: the field in the upvotes response holding the number of claps a particular user gave to a post.
  • Endpoint: one address on a server that performs one job.
  • Field: one named piece of data inside a response, like one labelled box in a form.
  • Front end: the part of a website that runs in your browser, the pages and buttons you see and interact with.
  • GET: the type of request used to ask the server to read something, without changing it.
  • Hall Of Fame: a page where Medium lists people who reported security problems to it.
  • IDOR: Insecure Direct Object Reference, a flaw where the server acts on an object named by an identifier you supply without checking that you are allowed to act on that object.
  • POST: the type of request normally used to ask the server to change something, such as recording a clap.
  • Request: the message your browser sends to a server asking it to do something.
  • Response: the message the server sends back, containing the result and usually some data.
  • Schwag: promotional items a company gives away, such as clothing or stickers.
  • Status code: a number in the response saying how the request went, where 200 means it worked.
  • Story: Medium's name for a published article, also called a post.
  • success:true: the explicit confirmation in the response body that the server recorded the action.
  • Upvotes: the list of users who gave a positive reaction to a story.

More by Sai Krishna Kothapalli

View all

4 more disclosed reports, best first.

More from Medium

View all

The newest disclosed reports for this program.

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.