Skip to content
IDOR Write-up Intermediate

Discovered a Critical IDOR and Earned $900 for My First P1 Vulnerability!

The application exposed private messages through an insecure direct object reference: a POST request to a messages endpoint accepted a chat identifier and returned another user's messages when it was swapped. The chat identifiers could then be enumerated because a separate endpoint leaked message identifiers whose values followed a simple fixed increment, letting the attacker reach every user's chats.

Abhisek R Follow

Published on medium.com

Bounty$900 View original

Hello Guys, It is been a very long time since I wrote a bug bounty write-up. Without any delay let’s get into it.

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

Context

The target was a web application belonging to a company the author is not permitted to name, referred to throughout as "Redacted Company." The feature in question is a chat or messaging function: the application exposes an endpoint, /get-messages, that returns the messages belonging to a conversation. Each conversation is identified by a chatId, and each individual message by a messageId.

IDOR, as the author frames it, is a vulnerability in web applications that occurs due to insecure references, allowing users to access private information belonging to other users. That definition sets the theme for the whole write-up: the application trusted a client-supplied identifier to decide which conversation's data to return.

Setup

The author works manually rather than relying on automation, and the discovery came from reviewing the application's requests and responses by hand. Two accounts were involved:

  1. The author's own account, used to observe the normal request flow.
  2. A quickly created dummy account, used to obtain a second, independent chatId for comparison.

No specific tools, versions or special preconditions are described beyond an authenticated session against the application.

Finding it

While reviewing the web application, the author examined the request that loads messages and noted three things in it:

  1. A request to /get-messages using the POST method.
  2. A JSON body containing a chatId and a unique value.
  3. Anti-CSRF protection in an X-Csrf-Token header.
From the original on medium.com

From those observations the author drew two conclusions. On IDOR: it might be vulnerable, because the unique value may reference an insecure object. On CSRF: no, because an anti-CSRF token in the header makes exploitation hard or even impossible. The CSRF question was therefore set aside and the IDOR lead pursued.

Research Meme From the original on medium.com

Exploitation

Step 1: Confirm the IDOR with a second account

The author created a dummy account and obtained the chatId belonging to it. Replacing the chatId in the previously observed request resulted in information disclosure, and the application was confirmed vulnerable to IDOR.

From the original on medium.com

The author replaced the chatId in the previously observed request and the response disclosed information, confirming the IDOR. The anti-CSRF token did not help, because the attacker is not forging a cross-site request: they are sending their own authenticated request with a valid token and a swapped identifier.

Step 2: Try to enumerate chatId values

The obvious next question was how to enumerate chatId values. The author went back to analysing the application's requests for this purpose, but this attempt did not succeed: nothing useful was found at this stage.

From the original on medium.com

The author then took a break and returned to the task later, noting that taking breaks when stuck can help clear the mind.

Step 3: Find the leaked messageId parameter

After two hours of analysis, the author uncovered a cryptographic failure and information disclosure. A parameter called messageId was discovered, along with an endpoint that leaked messageId values for many users. That leak supplied the missing input for enumeration: instead of guessing chatId values directly, the author could work from message identifiers that the application itself disclosed.

Step 4: Break the relationship between messageId and chatId

By breaking the cryptographic relationship between messageId and chatId, the author found that it was just a simple fixed byte increment. With that relationship understood, the author had access to private information for all chatId values associated with users.

From the original on medium.com

The relationship between messageId and chatId was a simple fixed byte increment, which gave the author access to private information for all chatId values associated with users.

Step 5: Report

The author wrote a detailed report and submitted it with a proof of concept. After a week the report was accepted and rewarded with $900.

Root cause

The request carried a client-supplied chatId, and replacing it returned another conversation's data, which is an insecure direct object reference. That is a classic insecure direct object reference.

The messageId to chatId relationship was a simple fixed byte increment, which the author describes as a cryptographic failure. The anti-CSRF token in the X-Csrf-Token header made CSRF exploitation hard or even impossible, so the author set that lead aside.

Impact

An authenticated attacker could read private information belonging to other users. Because the messageId to chatId relationship was a fixed byte increment and an endpoint leaked messageId values for many users, the exposure extended beyond a single guessed conversation: the author states access to private information for all chatId values associated with users. The report does not describe write access, account takeover or any effect beyond information disclosure.

Fix

The report does not state what the company changed. The fix implied by the finding is to enforce object-level authorisation on /get-messages: resolve the conversation from the authenticated session, or verify that the supplied chatId belongs to the current user before returning any messages. Separately, identifiers that are meant to resist enumeration should not be derived by a fixed byte increment from one another.

Variants to test

  1. Swap the conversation identifier in any messaging, ticketing or document endpoint for one belonging to a second account you control. A positive result is a response containing the other account's data.
  2. Look for endpoints that leak identifiers for many users, then check whether those identifiers can be transformed into other object identifiers. A positive result is a predictable mapping, such as a fixed increment, between the two.
  3. Compare identifiers across two accounts you own and check for sequential or byte-incremented patterns. A positive result is an identifier you can compute rather than guess.
  4. Re-test endpoints protected by an anti-CSRF header with your own valid token and a swapped object identifier. A positive result shows the token protects against forgery but not against object-level access control failures.
  5. When direct enumeration of one identifier fails, look for a second parameter or endpoint that exposes related identifiers, as the messageId leak did here. A positive result is a chain from a leaked value to a private object.

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

What happened, in plain words

A security researcher was looking at a chat feature on a company website. The company did not want to be named, so the write-up calls it "Redacted Company." The chat feature lets people send messages to each other. Each conversation has an identifier, a kind of label, called a chatId, and each single message has its own label called a messageId.

The researcher noticed that when the website asked the server for the messages of a conversation, it sent the chatId along with the request. When the researcher replaced the chatId with one from a dummy account, the server returned that conversation's data. By changing the chatId to the dummy account's value, the researcher obtained information disclosure. This kind of mistake is called an IDOR, short for Insecure Direct Object Reference.

That alone was a serious finding. But the researcher wanted to go further: could they find out other people's chatId values without guessing? At first they could not. Later they found a second parameter, messageId, and an endpoint that leaked messageId values belonging to many users. Then they worked out that messageId and chatId were related by a simple fixed byte increment, meaning one could be calculated from the other. With that, they had access to private information for all chatId values associated with users.

They wrote a detailed report with a proof of concept, which is a demonstration that the problem is real. After a week the report was accepted and they were paid $900.

From the original on medium.com

First, what is IDOR?

The write-up opens with a definition, and it is worth unpacking because everything else depends on it:

It is a critical vulnerability in web applications that occurs due to insecure references, allowing users to access private information belonging to other users.

Let us take that apart. A web application is a program that runs on a server and that you use through your browser: your online banking, a shop, a chat site. When you use such a site, your browser constantly asks the server for things: show me my inbox, save this message, load this photo. Each of those asks is a request, and the server answers with a response.

Often the request has to say which thing you want. "Show me the messages of conversation 1234." That number, 1234, is a reference: a name or label for a specific object stored on the server. The word "object" here just means a piece of data the application keeps, such as a conversation, a message, an invoice or a photo.

A reference is "insecure" when the server trusts whatever label the browser sends, without checking that the person sending it is allowed to see that object. Imagine a hotel where you tell the receptionist your room number and they hand you the key, without checking that the room is actually booked in your name. Anyone who says "room 204" gets the key to room 204. That is exactly the shape of an IDOR: the application uses a label supplied by the client to decide which data to return, and forgets to ask "does this data belong to you?"

Because the label is often a simple number, an attacker can try other numbers. If conversation 1234 is yours, maybe 1235 belongs to a stranger.

Setting up

The researcher explains their working style: instead of relying on automation, they prefer hands-on manual bug hunting. Automation means tools that scan a website automatically, firing thousands of requests and looking for known patterns. Manual hunting means a person reads the traffic and thinks about it. Both have their place, but the interesting findings in this story came from reading requests and responses by hand.

Two accounts were involved:

  1. The researcher's own account, used to see what a normal request looks like.
  2. A quickly created dummy account, a second account made only for testing, used to obtain a second, independent chatId to compare against the first.

Why a second account? Because to prove an IDOR you need to show that account A can read data belonging to account B. If you only ever look at your own data, you cannot tell whether the server is checking ownership or not. The dummy account gives you a known object that is definitely not yours.

The write-up does not describe any special tools, software versions or preconditions beyond being logged in to the application.

Finding it

While reviewing the web application, the researcher examined the request that loads messages and noted three things in it:

  1. A request to /get-messages using the POST method.
  2. A JSON body containing a chatId and a unique value.
  3. Anti-CSRF protection in an X-Csrf-Token header.
From the original on medium.com

That list is dense, so let us go through each item from zero.

The endpoint. /get-messages is a path on the website. Think of a website as a building with many doors, each with a sign. The sign /get-messages marks the door you knock on when you want your messages. In technical language this is called an endpoint: a specific address on a server that performs a specific job. The write-up does not give the full URL, only this path.

POST. When your browser talks to a server it uses a method, which is a word describing the kind of request. GET means "give me this page or this data." POST means "here is some data, do something with it." Loading messages with POST means the browser is sending information along with the request, rather than just asking for an address.

JSON body. The data sent along with a POST request is called the body. JSON is a way of writing structured data as text, using curly brackets, names in quotes and colons. It is the common language that web pages and servers use to exchange information. A JSON body containing a chatId means the request literally carries the label of the conversation whose messages are wanted. That is the reference we talked about earlier, and it is being sent by the client, which is the browser. The client is the program on your side; the server is the program on the other side.

The header and the anti-CSRF token. A request is made of more than a body. It also has headers: small labelled lines of extra information, like the address block on an envelope. One of these headers here is X-Csrf-Token. CSRF stands for Cross-Site Request Forgery. It is an attack where a malicious website makes your browser send a request to another site where you are logged in, without you intending it. For example, you are logged in to your bank, you visit a bad page, and that page quietly tells your browser to send a transfer request to the bank. The bank cannot tell the difference, because the request really does come from your browser.

A common defence is a token: a long random value that the real site gives your browser and that the bad site cannot know. If every sensitive request must carry the correct token in a header, a forged request from another site will not have it and will be rejected. A header is just a labelled line in the request, and X-Csrf-Token is the name of this particular one.

From these three observations the researcher drew two conclusions.

On IDOR: it might be vulnerable, because the unique value may reference an insecure object. In plain words, the request says "give me conversation X" and the server may not check that X is yours.

On CSRF: no, because an anti-CSRF token in the header makes exploitation hard or even impossible. The token is doing its job, so that door is closed. The researcher set the CSRF question aside and followed the IDOR lead instead.

Research Meme From the original on medium.com

Step 1: Confirm the IDOR with a second account

The researcher created a dummy account and obtained the chatId belonging to it. Replacing the chatId in the previously observed request resulted in information disclosure, and the application was confirmed vulnerable to IDOR.

From the original on medium.com

Information disclosure is a plain phrase with a plain meaning: information that should have stayed private was shown to someone not entitled to it. Here, the server returned the messages of a conversation that belonged to the dummy account, while the researcher was logged in as themselves.

The important property is that the server accepted a chatId that did not belong to the logged-in session and returned the associated data. A session is the server's memory of "you are logged in as this user." When you log in, the server gives your browser a cookie, a small piece of data the browser stores and sends back with every later request, so the server can recognise you. The session says who you are; the chatId says what you want. The bug is that the server checked the first and not the second.

Why did the anti-CSRF token not help? Because the attacker is not forging a cross-site request. They are sending their own request, from their own browser, with their own valid token, and simply changing the identifier inside it. The token proves the request came from the real site; it says nothing about whether the requested object belongs to you. This is a useful distinction to remember: CSRF protection and access control solve different problems.

Step 2: Try to enumerate chatId values

The obvious next question was how to enumerate chatId values. To enumerate means to go through values one by one, or in a pattern, to discover which ones exist. If chatId values were small sequential numbers, an attacker could simply try 1, 2, 3 and so on. The researcher went back to analysing the application's requests for this purpose, but this attempt did not succeed: nothing useful was found at this stage.

From the original on medium.com

The researcher then took a break and returned to the task later, noting that taking breaks when stuck can help clear the mind. That is not a technical step, but it is part of the story: the breakthrough came after stepping away.

Step 3: Find the leaked messageId parameter

After two hours of analysis, the researcher uncovered a cryptographic failure and information disclosure. A parameter called messageId was discovered, along with an endpoint that leaked messageId values for many users.

A parameter is simply a named value that a request carries, like chatId or messageId. The word "cryptographic" refers to cryptography, the science of scrambling data so that only the right people can read it. A cryptographic failure means something that was supposed to be protected by scrambling was not really protected at all, because the scrambling was weak or predictable.

Why was this leak important? Because it supplied the missing input for enumeration. Instead of guessing chatId values directly, the researcher could start from message identifiers that the application itself handed out. If you cannot guess the key, look for a place where the application gives you a copy.

Step 4: Break the relationship between messageId and chatId

By breaking the cryptographic relationship between messageId and chatId, the researcher found that it was just a simple fixed byte increment. With that relationship understood, the researcher had access to private information for all chatId values associated with users.

From the original on medium.com

Let us unpack that. A byte is a small unit of computer data, one of the building blocks that numbers and text are made of. An increment means adding a fixed amount. So a fixed byte increment means the identifiers were not random at all: each one was the previous one plus a constant step. They looked opaque, like a scrambled code, but underneath they were as predictable as house numbers on a street. If you know number 10, you know number 11 is next.

That is why the word "cryptographic" is used with "failure": the identifiers were treated as if they were cryptographic, meaning unguessable, but they were not. The relationship between messageId and chatId was a simple fixed byte increment, which gave the author access to private information for all chatId values associated with users. The chain is: leak a messageId, calculate the related chatId, request the conversation, receive private messages.

Step 5: Report

The researcher wrote a detailed report and submitted it with a proof of concept. A proof of concept is a demonstration that the problem is real, usually a careful record of the exact steps and the exact result, so that the company can reproduce it themselves. After a week the report was accepted and rewarded with $900.

Why it worked

The request carried a client-supplied chatId, and replacing it returned another conversation's data, which is an insecure direct object reference. Authorised here means "confirmed you are logged in." That is not the same as "confirmed this object is yours." The first check was present, the second was missing, and that is a classic insecure direct object reference.

The messageId to chatId relationship was a simple fixed byte increment, which the author describes as a cryptographic failure. The anti-CSRF token in the X-Csrf-Token header made CSRF exploitation hard or even impossible, so the author set that lead aside.

What the impact was

An authenticated attacker, meaning someone with any normal account, could read private information belonging to other users. Because the messageId to chatId relationship was a fixed byte increment and an endpoint leaked messageId values for many users, the exposure extended beyond a single guessed conversation: the researcher states access to private information for all chatId values associated with users.

How it should be fixed

The fix implied by the finding is to enforce object-level authorisation on /get-messages: resolve the conversation from the logged-in session, or verify that the supplied chatId belongs to the current user before returning any messages. In hotel terms, stop handing out keys based on the room number the guest says, and check the booking first. Separately, identifiers that are meant to resist enumeration should not be derived by a fixed byte increment from one another.

Things worth trying yourself

  1. Swap the conversation identifier in any messaging, ticketing or document endpoint for one belonging to a second account you control. A positive result is a response containing the other account's data.
  2. Look for endpoints that leak identifiers for many users, then check whether those identifiers can be transformed into other object identifiers. A positive result is a predictable mapping, such as a fixed increment, between the two.
  3. Compare identifiers across two accounts you own and check for sequential or byte-incremented patterns. A positive result is an identifier you can compute rather than guess.
  4. Re-test endpoints protected by an anti-CSRF header with your own valid token and a swapped object identifier. A positive result shows the token protects against forgery but not against object-level access control failures.
  5. When direct enumeration of one identifier fails, look for a second parameter or endpoint that exposes related identifiers, as the messageId leak did here. A positive result is a chain from a leaked value to a private object.

Glossary

  • API: a defined set of addresses and rules that a program uses to talk to another program, such as a web page asking a server for data.
  • Authentication: proving who you are, for example by logging in with a username and password.
  • Authorisation: deciding what a proven user is allowed to do or see.
  • Body: the part of a request or response that carries the actual data, as opposed to the headers.
  • Byte: a small unit of computer data, one of the building blocks of numbers and text.
  • Client: the program on your side, usually your browser, that sends requests.
  • Cookie: a small piece of data a site stores in your browser and that your browser sends back with later requests, often used to keep you logged in.
  • Cross-Site Request Forgery (CSRF): an attack where a malicious site makes your browser send a request to another site where you are logged in, without your intent.
  • Cryptographic failure: a situation where data that was supposed to be protected by scrambling is not really protected, because the scrambling is weak or predictable.
  • Cryptography: the science of scrambling data so that only the right people can read it.
  • Dummy account: a second account created only for testing, so you have a known object that is definitely not yours.
  • Endpoint: a specific address on a server that performs a specific job, such as /get-messages.
  • Enumerate: to go through values one by one, or in a pattern, to discover which ones exist.
  • Fixed byte increment: a pattern where each identifier is the previous one plus a constant step, making them predictable.
  • GET: a request method meaning "give me this page or this data."
  • Header: a small labelled line of extra information sent with a request or response, like the address block on an envelope.
  • IDOR (Insecure Direct Object Reference): a vulnerability where the server uses a label supplied by the client to pick which data to return, without checking that the data belongs to that user.
  • Information disclosure: private information being shown to someone not entitled to see it.
  • JSON: a way of writing structured data as text, using curly brackets, quoted names and colons, commonly used between web pages and servers.
  • Method: the word in a request that says what kind of request it is, such as GET or POST.
  • Object: a piece of data the application keeps, such as a conversation, a message, an invoice or a photo.
  • Parameter: a named value carried in a request, such as chatId or messageId.
  • POST: a request method meaning "here is some data, do something with it."
  • Proof of concept: a demonstration that a problem is real, usually a record of the exact steps and result so it can be reproduced.
  • Request: a message your browser sends to a server asking for something or sending data.
  • Response: the server's answer to a request.
  • Server: the program on the other side that stores data and answers requests.
  • Session: the server's memory of who is logged in, usually tied to a cookie.
  • Token: a long random value used to prove a request is genuine, for example an anti-CSRF token.
  • chatId: the identifier of a conversation in the chat feature.
  • messageId: the identifier of a single message in the chat feature.
  • X-Csrf-Token: the header carrying the anti-CSRF token in the requests described here.

More by Abhisek R

View all

2 more disclosed reports, best first.

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.