Skip to content
Access control Disclosed report Beginner

Checking whether user liked the media or not even when you are blocked

A blocked user could still check whether another user liked a post by using the likes.isLiked API endpoint, which did not enforce the block. The likes.getList endpoint correctly returned an error after blocking, but likes.isLiked leaked the like status.

vraj Follow

Originally disclosed on HackerOne

Bounty$100 View original
  • Triaged in 2 months
  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 4 months

Poc : Take 2 accounts A and B 1.) Now from A id make a random post say http://vk.com/id307083341?w=wall307083341_36 2.)Now from C id try to like the post of A . 3.)Now from B id visit https://vk.com/dev/likes.getList 4.) now put the owner id A and the post id == > 307083341 which 36 in this case 5.)and in the the friends_only field change 1 to 0 6.)then hit run you will find that vk.com will return the array of guys who have liked it now open another tab
7.)Now block B from A account . 8.)Now try to again query https://vk.com/dev/likes.getList the same from 3 you will find that now vk.com will not allow you ! error but now 9.)But these methods are not protected === > Visit now https://vk.com/dev/likes.isLiked and now put the owner_id=[307---], item_id=36 , user_id of the guy to which you have to check whether he has liked or not the media and this time their is no error and vk.com will show liked : 1

Hence no where in the application this information is being disclosed but here is the end point leaking the information raj_v

The original report as published on HackerOne, by vraj. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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. 5 min read.

Context

VK.com exposes a set of API methods through its developer console at https://vk.com/dev/. Two of the methods relevant here are likes.getList, which returns the list of users who liked a given object, and likes.isLiked, which answers a single yes/no question: has a particular user liked a particular object. Both take an owner id and an item id, and likes.getList additionally has a friends_only field that controls whether the result is restricted to the caller's friends.

The report is about a privacy boundary that VK applies between users: when user A blocks user B, B should no longer be able to pull information about A's content through the API. The researcher found that the block was enforced on one likes method but not on the other, so the same information could still be obtained through the unprotected endpoint.

Setup

Three accounts are used in the proof of concept:

  1. Account A, the owner of the content. Its numeric id in the report is 307083341.
  2. Account B, the account that gets blocked by A and that performs the querying.
  3. Account C, a third account used only to place a like on A's post.

The only tool needed is a browser logged in as the relevant account, using the method pages on https://vk.com/dev/. No special role, token or version is described in the report.

Finding it

The researcher started from the ordinary behaviour of likes.getList: with the owner id and item id of a post, and with friends_only set to 0, the method returns the array of users who liked that post. That works while B is not blocked by A.

After A blocks B, the same query is refused with an error. That is the expected defence: the block is honoured by likes.getList. What looked wrong is that the block is not applied consistently across the likes API. The sibling method likes.isLiked, which answers the narrower question of whether one specific user liked the object, still responds normally to the blocked account. The block therefore protects the list but not the per-user answer.

Exploitation

Step 1: create content as A

From account A, make a post. The report gives the resulting wall URL:

Text
http://vk.com/id307083341?w=wall307083341_36

This fixes the two identifiers used throughout: owner id 307083341 and item id 36.

Step 2: like the post as C

From account C, like A's post. This gives the object at least one liker whose status can later be tested, and C is a user other than the blocked account B.

Step 3: open the likes list as B

From account B, visit the method page:

Text
https://vk.com/dev/likes.getList

Step 4: supply the owner and item ids

Put A's owner id and the post id into the form: owner id 307083341, item id 36.

Step 5: set friends_only to 0

In the friends_only field, change 1 to 0, so the method is not restricted to B's friends.

Step 6: run the method

Hit run. VK returns the array of users who liked the post. At this point B is not blocked, so the call succeeds and the list is visible.

Step 7: block B from A

From account A, block account B.

Step 8: repeat the list query as B

Query https://vk.com/dev/likes.getList again exactly as in step 3. VK now refuses the request with an error. The block is enforced on this method.

Step 9: query the other method as B

The researcher then visits the second method page:

Text
https://vk.com/dev/likes.isLiked

and supplies owner_id=[307---], item_id=36, and the user_id of the person whose like status is to be checked. This time there is no error, and VK answers liked: 1 when that user has liked the media.

So although the application does not display this information anywhere to the blocked user, the endpoint itself leaks it. So a blocked account can still check, one user at a time, whether a given user liked A's content.

Root cause

The block appears to be enforced on likes.getList but not on likes.isLiked. The two methods read the same underlying like relationship, but only one of them consults the viewer's block status before answering. Because likes.isLiked takes an arbitrary user_id as a parameter, the blocked account does not even need the list: it can ask the yes/no question once per candidate user and rebuild the list itself.

Impact

An account that has been blocked by another user can still learn, one user at a time, who liked that user's media. The information is not shown anywhere in the application to the blocked account; it is disclosed only through the API endpoint. The report does not describe any rate limiting, any limit on how many user_id values can be tested, or any other constraint, and it does not claim impact beyond this like-status disclosure.

Fix

The report does not state what was changed.

Variants to test

  1. Enumerate sibling methods that read the same object as a protected method: for each method that returns a list, look for a method that returns a single element or a boolean about that element, and test it after the block is in place. A positive result is a normal response where the list method returns an error.
  2. Test the same pattern on other relationship types, such as followers, friends, group members or comment authors, where one method lists and another checks membership. A positive result is a membership answer for a user the listing method refuses to show.
  3. Test whether the per-user method accepts an arbitrary user_id rather than only the caller's own id. A positive result is an answer about a third party, as in this report.
  4. Test whether the block is enforced on the method page only or also on direct API calls, since the report exercises the developer console. A positive result is the same answer through a direct request.

Hunting notes

This kind of bug hides where a privacy rule is implemented per endpoint instead of centrally. During recon, map the API surface for pairs of methods over the same object: a list method and a single-item or boolean method. If one of them starts returning an error after a block, a privacy setting change or a removal of access, test the other one with the same identifiers.

The signal is an inconsistency: the same underlying data is reachable through two endpoints, and only one of them refuses. The researcher showed the list call working, the error after the block, and the successful likes.isLiked call returning liked: 1. That contrast, with the concrete owner id, item id and result, is what makes the disclosure unambiguous.

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. 8 min read.

What happened, in plain words

VK.com is a social network. Like most social networks, it has a developer area at https://vk.com/dev/ where you can try out the site's API methods from your browser. An API (application programming interface) is a way for one piece of software to ask another piece of software for information, a bit like a restaurant menu: you pick a dish by name, hand over the details it needs, and the kitchen sends back a result. The developer console is simply a web page that lets you fill in that order form and press run.

Two of those methods are about likes, the little hearts or thumbs-up people leave on posts and other media:

  • likes.getList returns the whole list of users who liked a given object.
  • likes.isLiked answers a single yes/no question: has this particular user liked this particular object?

Both need to know which object you mean, so both take an owner id (the numeric id of the account that owns the content) and an item id (the numeric id of the post or media itself). likes.getList also has a field called friends_only, which controls whether the answer is limited to your own friends.

VK has a privacy rule between users: if user A blocks user B, then B should no longer be able to pull information about A's content through the API. The researcher found that this rule was enforced on one of the two likes methods but not on the other. So the same information could still be obtained through the unprotected endpoint, one user at a time.

Setting up

The proof of concept uses three accounts:

  1. Account A, the owner of the content. Its numeric id in the report is 307083341.
  2. Account B, the account that gets blocked by A and that does the querying.
  3. Account C, a third account used only to place a like on A's post.

The only tool needed is a browser logged in as the relevant account, using the method pages on https://vk.com/dev/. The report does not describe any special role, token or version.

Finding it

The researcher started from the ordinary behaviour of likes.getList. Give it the owner id and item id of a post, set friends_only to 0, and it returns the array of users who liked that post. That works while B is not blocked by A.

After A blocks B, the same query is refused with an error. That is the expected defence: the block is honoured by likes.getList. What looked wrong is that the block is not applied consistently across the likes API. The sibling method likes.isLiked, which answers the narrower question of whether one specific user liked the object, still responds normally to the blocked account. The block therefore protects the list but not the per-user answer.

Exploitation

Step 1: create content as A

From account A, make a post. The report gives the resulting wall URL:

Text
http://vk.com/id307083341?w=wall307083341_36

Line by line: http://vk.com/ is the site. id307083341 is A's profile page, where the number is A's account id. ?w=wall307083341_36 is the part after the question mark that tells VK which specific item to open, here a wall post. The two numbers in it are the owner id (307083341) and the item id (36). These two identifiers are used throughout the rest of the report.

Step 2: like the post as C

From account C, like A's post. This gives the object at least one liker whose status can later be tested, and C is a user other than the blocked account B. Without a like in place there would be nothing to check.

Step 3: open the likes list as B

From account B, visit the method page:

Text
https://vk.com/dev/likes.getList

This is the developer console page for the list method. Opening it in B's browser means the request is made as B, so any privacy rule that depends on who is asking will treat B as the viewer.

Step 4: supply the owner and item ids

Put A's owner id and the post id into the form: owner id 307083341, item id 36. These are the same two numbers taken from the wall URL in step 1, and they tell the method which post to look at.

Step 5: set friends_only to 0

In the friends_only field, change 1 to 0, so the method is not restricted to B's friends. If it stayed at 1, the answer would only cover people B is friends with, which would hide most of the list and make the test less clear.

Step 6: run the method

Hit run. VK returns the array of users who liked the post. At this point B is not blocked, so the call succeeds and the list is visible. This is the baseline: it shows what the method normally does and proves the identifiers are correct.

Step 7: block B from A

From account A, block account B. Blocking is the privacy action whose effect is being tested.

Step 8: repeat the list query as B

Query https://vk.com/dev/likes.getList again exactly as in step 3. VK now refuses the request with an error. The block is enforced on this method, which is the behaviour you would expect.

Step 9: query the other method as B

The researcher then visits the second method page:

Text
https://vk.com/dev/likes.isLiked

and supplies owner_id=[307---], item_id=36, and the user_id of the person whose like status is to be checked. owner_id and item_id identify the post, as before. user_id is the account whose like you are asking about, and here it can be any account, not just B's own. This time there is no error, and VK answers liked: 1 when that user has liked the media.

So although the application does not display this information anywhere to the blocked user, the endpoint itself leaks it. So a blocked account can still check, one user at a time, whether a given user liked A's content.

Root cause

The block appears to be enforced on likes.getList but not on likes.isLiked. The two methods read the same underlying like relationship, but only one of them consults the viewer's block status before answering. Because likes.isLiked takes an arbitrary user_id as a parameter, the blocked account does not even need the list: it can ask the yes/no question once per candidate user and rebuild the list itself.

Impact

An account that has been blocked by another user can still learn, one user at a time, who liked that user's media. The information is not shown anywhere in the application to the blocked account; it is disclosed only through the API endpoint. The report does not describe any rate limiting, any limit on how many user_id values can be tested, or any other constraint, and it does not claim impact beyond this like-status disclosure.

Fix

Variants to test

  1. Enumerate sibling methods that read the same object as a protected method: for each method that returns a list, look for a method that returns a single element or a boolean about that element, and test it after the block is in place. A positive result is a normal response where the list method returns an error.
  2. Test the same pattern on other relationship types, such as followers, friends, group members or comment authors, where one method lists and another checks membership. A positive result is a membership answer for a user the listing method refuses to show.
  3. Test whether the per-user method accepts an arbitrary user_id rather than only the caller's own id. A positive result is an answer about a third party, as in this report.
  4. Test whether the block is enforced on the method page only or also on direct API calls, since the report exercises the developer console. A positive result is the same answer through a direct request.

Hunting notes

This kind of bug hides where a privacy rule is implemented per endpoint instead of centrally. During recon, map the API surface for pairs of methods over the same object: a list method and a single-item or boolean method. If one of them starts returning an error after a block, a privacy setting change or a removal of access, test the other one with the same identifiers.

The signal is an inconsistency: the same underlying data is reachable through two endpoints, and only one of them refuses. The researcher showed the list call working, the error after the block, and the successful likes.isLiked call returning liked: 1. That contrast, with the concrete owner id, item id and result, is what makes the disclosure unambiguous.

Glossary

  • API: a defined way for software to ask another service for information or actions, usually by sending named parameters and receiving a structured answer.
  • Endpoint: one specific address or method in an API that you can send a request to.
  • Developer console: a web page on a site that lets you fill in an API method's parameters and run it from the browser.
  • Parameter: a named value you supply to a method, such as owner_id or item_id.
  • Owner id: the numeric identifier of the account that owns a piece of content.
  • Item id: the numeric identifier of a specific post or media object.
  • user_id: the numeric identifier of the account whose like status is being asked about.
  • friends_only: a field on likes.getList that, when set to 1, limits the answer to the caller's friends.
  • Boolean: a value that is either true or false, here expressed as liked: 1.
  • Array: an ordered list of values returned by a method, here the list of users who liked a post.
  • Block: a privacy action where one user stops another from interacting with or seeing information about their content.
  • Authorisation: the check that decides whether the person making a request is allowed to receive the answer.
  • Information disclosure: a vulnerability class where information that should be kept from someone is revealed to them.
  • Root cause: the underlying reason a bug exists, as opposed to its visible symptom.
  • Rate limiting: a limit on how many requests a client may make in a period of time.
  • Recon: the exploratory phase of security testing where you map out what a system offers before probing it.
  • Sibling method: another API method that reads or acts on the same underlying data as the one you are comparing it with.
  • Proof of concept (PoC): a concrete sequence of steps that demonstrates a bug really works.

More from VK.com

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.