Skip to content
IDOR Write-up Beginner

Blind IDOR in LinkedIn iOS application

The LinkedIn iOS app's Twitter account linking and unlinking endpoints accepted a numeric twitterId parameter without verifying that it belonged to the authenticated user. An attacker could change the value to another user's Twitter ID and unlink that user's Twitter account from LinkedIn, though the response gave no indication of success.

Hailstorm Follow

Published on hailstorm1422.com

So most of the time IDOR's are pretty straight forward, they occur when there is no proper access control mechanism in place or using weak obvious object references. One of the easiest issues to find and exploit.

Hailstorm (@hailstorm1422), on hailstorm1422.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

LinkedIn lets a user link a Twitter account to their LinkedIn profile. Once the link is in place, posts made on LinkedIn can be shared to Twitter alongside the original LinkedIn post. The linking flow sends a POST request containing a parameter named twitterId, whose value is a nine digit numeric identifier for the Twitter account. The same identifier is used by the unlink feature, which removes the Twitter account from the LinkedIn profile.

That identifier is the object reference the whole write-up turns on. It is a plain integer, it is supplied by the client, and the server appears to act on whatever value it receives.

Setup

Two LinkedIn accounts were used:

  1. Account A, the attacker profile, with a Twitter account linked to it.
  2. Account B, a second LinkedIn account, with a different Twitter account linked to it.

Finding it

IDORs are usually straightforward: a missing access control check, or an object reference that is weak and obvious. This one looked different because the response gave nothing away. When the twitterId of profile A was replaced with the twitterId of account B while posting to LinkedIn and Twitter, the server answered:

JSON
{"result":{"message":"","responseCode":200}}

A 200 OK. The researcher then checked Twitter account B to see whether a tweet had actually been created there. It had not: despite the 200 OK, there was no tweet on the victim Twitter account. Changing the value to another user's twitterId when posting failed in the same silent way.

Exploitation

Step 1: substitute the identifier on the post sharing request

With account A linked to Twitter account A, the twitterId in the post sharing request was replaced with the twitterId of account B. The response was the same 200 OK shown above. Checking Twitter account B showed no tweet, so the post sharing path did not produce an observable effect on the victim.

Step 2: substitute the identifier on the unlink request

The unlink feature was tested the same way. The endpoint involved is:

Text
https://www.linkedin.com/psettings/twitter-accounts/delete

Replacing the twitterId with another user's twitterId returned the identical response:

JSON
{"result":{"message":"","responseCode":200}}

There is no difference at all between the legitimate response and the IDOR response. Everything is a 200 OK.

Step 3: notice the state that should have changed

After the unlink attempt, the interface still showed the Twitter account as linked. That is what should not appear once Twitter has been successfully unlinked from LinkedIn:

Step 4: use the feature and observe the real behaviour

Back on LinkedIn, the researcher turned the post sharing feature on and posted something. The post did not appear on Twitter even though the feature was enabled. Looking more carefully, the account still appeared to be linked via Twitter, but the underlying unlink function had in fact executed successfully and removed the Twitter account. The visible link state and the actual state had diverged: the request had worked, but the UI gave no sign of it. That is why the researcher called it a blind IDOR.

Root cause

The unlink endpoint appears to act on a client supplied twitterId without checking that it belongs to the authenticated user. The response is a generic success object regardless of whose identifier was sent, and the UI still showed the account as linked, so the effect was not visible from the attacker's side. The report does not describe the server side check that is missing; the behaviour is consistent with the object reference being trusted as-is.

Impact

Because the twitterId value is a nine digit integer, the researcher notes that the parameter can be brute forced, which would unlink the Twitter accounts of every LinkedIn user whose identifier falls in that range. The impact is therefore integrity of the link between LinkedIn and Twitter for other users, not disclosure of data. The write-up does not claim any read access or account takeover.

Fix

The report does not state what LinkedIn changed. The fix implied by the behaviour is to bind the unlink operation to the authenticated session and verify that the supplied twitterId belongs to that user before acting on it, rather than trusting the identifier in the request.

Timeline

Event Time
Reported Tue, Sep 3, 2019, 11:47 PM
Investigation Wed, Sep 4, 2019, 8:42 AM
Issue Resolved Sep 12, 2019, 4:58 PM

On rewards, the researcher points to LinkedIn's HackerOne policy and to an old tweet by @brutelogic that explains the situation.

Variants to test

  1. Any link or unlink flow that takes a numeric third party identifier (Twitter, Facebook, GitHub and similar). Swap in a second account's identifier and watch the response code. A positive result is a 200 with no visible change in the UI, followed by the link actually being removed when the feature is used again.
  2. Post sharing and cross posting endpoints. Replace the destination account identifier and check the destination account for the post.
  3. State checks after every IDOR attempt. Re-enable the feature and use it, as the researcher did, because a generic success response and an unchanged UI can both hide a completed state change.
  4. Identifier ranges. Where the reference is a short numeric value, consider whether it can be enumerated, and what the effect of a successful call on each value would be.
Buy Me A Coffee
Buy Me A Coffee From the original on hailstorm1422.com

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

What happened, in plain words

LinkedIn lets you connect your Twitter account to your LinkedIn profile. Once the two are connected, anything you post on LinkedIn can also be posted to Twitter automatically. This is a handy feature, but it involves LinkedIn storing a link between your profile and your Twitter account.

A security researcher tested that link and found that LinkedIn was trusting a number sent by the browser to decide which Twitter account to act on. By changing that number, the researcher could make LinkedIn unlink a Twitter account even though the screen still showed it as linked. The strange part is that LinkedIn answered every request with the same success message, whether the number belonged to the person making the request or not, and the screen still showed the account as linked. The change only became visible later, when the feature was used again. That is why the researcher called it a "blind" IDOR.

This article walks through the whole thing slowly, assuming you have never done security testing before. You only need a browser and a computer to follow the ideas.

Some background concepts first

Before the details make sense, a few everyday ideas need explaining.

A web request. When you click a button on a website, your browser sends a message to a server (a computer somewhere else that runs the site). The server sends a message back. The browser's message is called a request, and the server's reply is called a response.

An API. Think of a restaurant. You do not walk into the kitchen and cook; you tell the waiter what you want, and the waiter brings it back. An API (Application Programming Interface) is the waiter between your browser and the server's kitchen. The browser asks for something in a structured way, and the server answers in a structured way, often with data rather than a whole web page.

A parameter. A parameter is a named piece of information sent along with a request, like a field on a form. If you order a coffee and say "size: large", then "size" is the parameter name and "large" is its value. In web requests, parameters often look like name=value.

A POST request. Requests come in types. A GET request is like asking to look at a page. A POST request is like submitting a form: it carries data to the server and is used when something should change, such as creating a post or deleting a link.

An identifier (ID). Every user, post or linked account on a big website needs a unique label so the server can tell them apart. That label is an identifier. It is often just a number. Your LinkedIn profile has one, your Twitter account has one, and the connection between them has one too.

An object reference. When a request says "act on object number 12345", the number 12345 is the object reference. It points at one specific thing in the server's database.

Access control. This is the rule that says who is allowed to do what. A good website checks, on the server, that the person making a request is allowed to touch the object they named. If you ask to delete your own link, fine. If you ask to delete someone else's, the server should refuse.

IDOR. IDOR stands for Insecure Direct Object Reference. It is the name for the bug that happens when a website takes an object reference from the browser and acts on it without checking that the object belongs to the person asking. Imagine a hotel where you tell the front desk "give me the key to room 204" and they hand it over without checking that you are the guest in 204. The room number is the object reference, and the missing check is the vulnerability.

A blind vulnerability. "Blind" means you cannot see the result directly from the response. A normal bug might show you someone else's data straight away. A blind one gives no visible sign, and you have to look elsewhere, or use the feature again later, to confirm something happened.

Brute force. If a value is a short number, a computer can simply try every possibility in turn: 1, 2, 3, and so on. That is brute forcing. It is only practical when the range of values is small enough.

A cookie or token. When you log in, the server gives your browser a small piece of data, often stored as a cookie or token, that proves who you are on each later request. Without it, the server would not know which account is asking. This matters because the whole question in an IDOR is whether the server checks that identity against the object being requested.

The feature under test

LinkedIn lets a user link a Twitter account to their LinkedIn profile. Once the link is in place, posts made on LinkedIn can be shared to Twitter alongside the original LinkedIn post. The linking flow sends a POST request containing a parameter named twitterId, whose value is a nine digit numeric identifier for the Twitter account. The same identifier is used by the unlink feature, which removes the Twitter account from the LinkedIn profile.

That identifier is the object reference the whole write-up turns on. It is a plain integer, it is supplied by the client, and the server appears to act on whatever value it receives.

Most of the time IDORs are pretty straightforward. They occur when there is no proper access control mechanism in place, or when the object references are weak and obvious. That makes them one of the easiest issues to find and exploit.

iPhone displaying social media apps
Photo by Kon Karampelas / Unsplash From the original on hailstorm1422.com

Photo by Kon Karampelas / Unsplash

In this case, the situation is a bit different. The researcher had recently started testing LinkedIn, and after playing around with the application for some time, discovered an endpoint where users can link their Twitter accounts with LinkedIn.

Here, once a Twitter account is linked successfully with LinkedIn, the user can tweet their LinkedIn posts on Twitter along with their original posts on LinkedIn.

Setting up the test

To test whether the server checks who owns the twitterId, the researcher needed two separate accounts. Two LinkedIn accounts were used:

  1. Account A, the attacker profile, with a Twitter account linked to it.
  2. Account B, a second LinkedIn account, with a different Twitter account linked to it.

You can think of it as a postal worker who opens your letter, swaps a number, and seals it again before delivery.

Finding it

When linking the Twitter account, the researcher straight away started to test for IDOR, because there is a POST parameter named twitterId with a key pair value of a nine digit numeric number.

A nine digit number is a strong hint. It is short enough that a computer could try many of them, and it is simple enough that a person can read it and change it by hand.

When the twitterId of profile A was replaced with the twitterId of account B while posting to LinkedIn and Twitter, the server answered:

JSON
{"result":{"message":"","responseCode":200}}

Line by line, in plain words:

  • The outer braces { } wrap a single JSON object. JSON is just a text format for structured data, like a very strict shopping list.
  • "result" is the name of the field inside that object. Its value is another object, shown by the inner braces.
  • "message" is an empty string, meaning the server had no message to give.
  • "responseCode" is 200. In web terms, 200 is the standard code for "OK, that worked".

So the server said: everything is fine. That is the first warning sign in an IDOR test. The server did not say "this is not your account". It said OK.

A 200 OK. The researcher then checked Twitter account B to see whether a tweet had actually been created there. It had not: despite the 200 OK, there was no tweet on the victim Twitter account. Changing the value to another user's twitterId when posting failed in the same silent way.

This is the moment the word "blind" starts to make sense. The response looked successful, but nothing visible happened on the other account. A careless tester might stop here and report a bug that does not exist. The researcher kept going.

Exploitation

Step 1: substitute the identifier on the post sharing request

With account A linked to Twitter account A, the twitterId in the post sharing request was replaced with the twitterId of account B. The response was the same 200 OK shown above. Checking Twitter account B showed no tweet, so the post sharing path did not produce an observable effect on the victim.

Why do this step at all? Because the post sharing feature is the most obvious place where the twitterId is used. If the server trusted the number there, a post from account A would appear on account B's Twitter. It did not, so this path was a dead end, but a useful one: it showed the response code alone proves nothing.

Step 2: substitute the identifier on the unlink request

The unlink feature was tested the same way. The endpoint involved is:

Text
https://www.linkedin.com/psettings/twitter-accounts/delete

Reading that address piece by piece:

  • https:// is the secure web protocol, the padlock in your browser.
  • www.linkedin.com is the site.
  • /psettings/ suggests a settings area.
  • /twitter-accounts/delete suggests an action that deletes a Twitter account link.

An endpoint is simply a specific address on a server that does one job. This one's job is to remove a Twitter link.

Replacing the twitterId with another user's twitterId returned the identical response:

JSON
{"result":{"message":"","responseCode":200}}

Again, line by line:

  • The server wrapped its answer in a result object.
  • message was empty, so there was no explanation.
  • responseCode was 200, meaning success.

There is no difference at all between the legitimate response and the IDOR response. Everything is a 200 OK. That is a problem for anyone testing: if the server says the same thing whether you are allowed or not, the response cannot tell you whether the bug is real.

Step 3: notice the state that should have changed

After the unlink attempt, the interface still showed the Twitter account as linked. That is what should not appear once Twitter has been successfully unlinked from LinkedIn:

This should not appear when we successfully unlink twitter from LinkedIn:

State here means the actual situation stored on the server: is the account linked or not? The screen is only a picture of that state. When the picture and the reality disagree, you have to find another way to check the reality.

Step 4: use the feature and observe the real behaviour

Back on LinkedIn, the researcher turned the post sharing feature on and posted something. The post did not appear on Twitter even though the feature was enabled. Looking more carefully, the account still appeared to be linked via Twitter, but the underlying unlink function had in fact executed successfully and removed the Twitter account. The visible link state and the actual state had diverged: the request had worked, but the UI gave no sign of it.

This is the key lesson of the whole report. The test that confirmed the bug was not the response code. It was using the feature afterwards and noticing that it no longer worked, because the link had quietly been removed.

Root cause

The unlink endpoint appears to act on a client supplied twitterId without checking that it belongs to the authenticated user. The response is a generic success object regardless of whose identifier was sent, and the UI still showed the account as linked, so the effect was not visible from the attacker's side. The report does not describe the server side check that is missing; the behaviour is consistent with the object reference being trusted as-is.

In plain terms: the server behaved like the hotel clerk who hands out any room key you ask for, and then says "done" without telling you whether the door actually opened.

Impact

Because the twitterId value is a nine digit integer, the researcher notes that the parameter can be brute forced, which would unlink the Twitter accounts of every LinkedIn user whose identifier falls in that range. The impact is therefore integrity of the link between LinkedIn and Twitter for other users, not disclosure of data. The write-up does not claim any read access or account takeover.

Integrity here means the link is correct and untouched. The bug lets someone else change it. It does not let them read private information, and it does not let them take over an account.

Fix

The report does not state what LinkedIn changed. The fix implied by the behaviour is to bind the unlink operation to the authenticated session and verify that the supplied twitterId belongs to that user before acting on it, rather than trusting the identifier in the request.

In everyday terms: before handing over the key, check the guest's name against the booking.

Timeline

Event Time
Reported Tue, Sep 3, 2019, 11:47 PM
Investigation Wed, Sep 4, 2019, 8:42 AM
Issue Resolved Sep 12, 2019, 4:58 PM

Response from LinkedIn Security Team

On rewards, the researcher points to LinkedIn's HackerOne policy and to an old tweet by @brutelogic that explains the situation.

🤷🏼‍♂️

Variants to test

If you want to try this kind of testing yourself, here are the patterns worth looking at. These are general ideas, not instructions to attack anyone; only test systems you are allowed to test.

  1. Any link or unlink flow that takes a numeric third party identifier (Twitter, Facebook, GitHub and similar). Swap in a second account's identifier and watch the response code. A positive result is a 200 with no visible change in the UI, followed by the link actually being removed when the feature is used again.
  2. Post sharing and cross posting endpoints. Replace the destination account identifier and check the destination account for the post.
  3. State checks after every IDOR attempt. Re-enable the feature and use it, as the researcher did, because a generic success response and an unchanged UI can both hide a completed state change.
  4. Identifier ranges. Where the reference is a short numeric value, consider whether it can be enumerated, and what the effect of a successful call on each value would be.
Buy Me A Coffee
Buy Me A Coffee From the original on hailstorm1422.com

Glossary

  • API: the structured way a browser and a server exchange requests and data, like a waiter carrying orders between you and the kitchen.
  • Access control: the rule that decides who is allowed to do what on a website.
  • Blind vulnerability: a bug whose effect cannot be seen in the response and has to be confirmed by other means.
  • Brute force: trying every possible value of something, one after another, until one works.
  • Cookie: a small piece of data your browser stores and sends back to a site, often used to remember who you are.
  • Endpoint: a specific address on a server that performs one particular job.
  • GET request: a request that asks to view something, without changing it.
  • IDOR (Insecure Direct Object Reference): a bug where a site acts on an object reference supplied by the browser without checking that the object belongs to the person asking.
  • Identifier (ID): a unique label, often a number, used to tell one user, post or account apart from another.
  • Integrity: the property that data is correct and has not been changed by someone who should not change it.
  • Intercepting: pausing a request between browser and server so it can be inspected or edited.
  • JSON: a text format for structured data, built from names and values in braces.
  • Object reference: the value in a request that points at one specific thing on the server, such as a user or a link.
  • Parameter: a named piece of information sent with a request, like a field on a form.
  • POST request: a request that sends data to the server and is used when something should change.
  • Response: the server's reply to a browser's request.
  • Response code: a number in the response saying how it went, such as 200 for OK.
  • State: the actual situation stored on the server, as opposed to what the screen shows.
  • Token: a piece of data proving your identity on later requests, similar in role to a cookie.
  • UI: the user interface, the part of the site you see and click on.

More from LinkedIn

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.