Skip to content
IDOR Write-up Beginner

The Victim Paid. The Attacker Used Their Subscription.

An API for creating websites accepted a client-supplied subscription identifier without checking ownership. An attacker could use another customer's paid subscription to create websites, consuming the victim's paid resource.

medium.com

Published on medium.com

Cybersecurity

Mahmoud Adel (El7xoot), 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. 3 min read.

Context

The target was example.com, a web application with an API responsible for creating websites. The feature under test was the website creation endpoint, which accepted a client-controlled subscription_id to decide which subscription the new site would be billed against.

The researcher, Mahmoud Adel (el7xoot), describes himself as a bug hunter and security researcher focused on web applications and APIs. The report is about an IDOR in that subscription handling.

Setup

The researcher had an account whose subscription was limited to one website. For the later stage of the investigation he used two accounts:

  • Attacker: his own account.
  • Victim: an account with a paid subscription.

No tools, versions or other preconditions are described beyond these accounts and the API endpoint.

Finding it

While testing example.com, the researcher found the API that creates websites and noticed that it accepted a subscription_id supplied by the client. His own subscription was limited to one website, so the obvious question was whether that limit could be bypassed by changing the identifier.

Exploitation

Step 1: Capture the creation request

The request that creates a website looked like this:

POST /api/hosting/instancesHost: my.example.com{"subscription_id":"ATTACKER_SUB"}

The body carries the subscription identifier, which the client controls.

Step 2: Note the predictable identifier format

The subscription IDs followed a predictable format:

A-S02991817A-S02991818A-S02991819

The identifiers followed a predictable format, with numbers running in sequence.

Step 3: Swap in another subscription ID

The researcher changed the subscription_id and found that he could use another subscription ID to create additional websites, bypassing the one-website limitation of his own subscription. That was already an authorisation issue, and the report was initially classified as P3.

Step 4: Ask who owns the other subscription

The researcher was not satisfied with that impact and asked himself: if he could use another subscription ID, what happens if that subscription belongs to another user? He then tested with the two accounts described above and replaced his subscription ID with the victim's:

{"subscription_id":"VICTIM_SUB"}

The request was accepted. There was no ownership validation and no authorisation error: the backend simply trusted the supplied subscription ID.

Root cause

The backend trusted the client-supplied subscription_id when creating a website. It did not check that the subscription belonged to the authenticated user before consuming it. The missing ownership check is the flaw itself: the backend trusted whatever subscription ID was supplied.

Impact

The impact was no longer just creating more websites than a subscription allows. It became the ability to use a subscription that another customer paid for. The victim paid for the subscription, the attacker used it, and because the resource was now being consumed by the attacker, the victim could no longer use their own paid resource as intended.

The initial finding, bypassing the one-website limitation, was rated P3. After the researcher clarified the business impact, the severity was raised from P3 to P2.

From the original on medium.com

Fix

The report does not describe a fix. The change it implies is server-side ownership validation: before creating a website, the backend should verify that the supplied subscription_id belongs to the authenticated user and reject the request otherwise.

Variants to test

  1. Swap the subscription identifier in any billing or provisioning request. A positive result is a successful creation or provisioning response for an identifier that belongs to another account.
  2. Enumerate sequential identifiers. Where IDs follow a predictable pattern, walk neighbouring values and check whether any are accepted for your session.
  3. Test with a second account you control. Create a paid subscription on one account and try to consume it from the other; a positive result is acceptance without an ownership error.
  4. Check whether the victim's resource becomes unavailable. If the attacker's use consumes the paid resource, the victim can no longer use it as intended, which strengthens the business impact.
  5. Re-test the same identifier in other endpoints. The same subscription_id may be trusted by related APIs, so try it wherever the value is accepted.

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

What happened, in plain words

A security researcher was testing a website, example.com, that lets people create their own websites. Creating a website there is not free: you need a paid plan, called a subscription. The researcher noticed that when the site creates a new website for you, it asks the server which subscription to charge, and the answer to that question is sent by your own browser. In other words, the customer tells the server which subscription to use, and the server believes it.

The researcher's own subscription only allowed one website. So he tried changing the subscription number in that request to a different one. The server accepted it, and he got extra websites beyond his limit. That was already a security problem, and the company rated it P3, a fairly low severity.

Then he asked a better question: what if the subscription number I send belongs to somebody else? He tested with two accounts: his own, and an account with a paid subscription. The server accepted that too. The victim had paid for the subscription, but the attacker was the one using it, and the victim could no longer use the paid resource as intended. Once the researcher explained this business impact, the company raised the severity from P3 to P2.

The flaw is called an IDOR. The name sounds technical, but the idea is simple: the server takes an identifier from the user and never checks that the user is allowed to use the thing that identifier points to. Think of a hotel that hands out room keys by number: if you say "room 214" at the desk and the clerk gives you the key without checking that 214 is your room, that is an IDOR. The number is not secret; the missing check is the problem.

The pieces you need to know

Before walking through the steps, here are the few concepts the rest of the article relies on. Each one is explained from zero.

What an API is

A website has two sides. The part you see, with buttons and pages, runs in your browser. The part that stores data and makes decisions runs on a computer somewhere else, called the server. An API is the set of doors on the server that the browser (or any other program) can knock on to ask for something: create a website, list my websites, delete one, and so on. Each door has an address, called an endpoint, and each door expects a particular kind of request.

A useful comparison: a restaurant. The dining room is the part you see. The kitchen is the server. The API is the waiter, the only way to get a message to the kitchen and a plate back. You never walk into the kitchen yourself; you talk to the waiter, and the waiter carries your order.

What a request is

When your browser wants something from the server, it sends a request. A request has a few parts:

  • A method, which is the verb: GET means "give me something", POST means "here is some data, do something with it".
  • A path, which is the address of the endpoint, for example /api/hosting/instances.
  • Headers, which are small labelled notes attached to the request, such as which site name you are asking for.
  • A body, which is the actual data being sent, often in a format called JSON.

What JSON is

JSON is a way of writing data as text so that both a browser and a server can read it. It uses curly braces for an object and pairs of a name and a value separated by a colon. For example, {"colour":"blue"} means "the value of colour is blue". The quotes around names and text values are part of the format.

What a subscription and a subscription ID are

A subscription is the paid plan attached to an account. It says what the customer is entitled to, for example how many websites they may create. Every subscription also has an identifier, a short code that the server uses to look it up, much like a membership number at a gym. In this product that code is called subscription_id.

What authorisation means

Authentication is proving who you are, like showing your passport at the airport. Authorisation is what you are allowed to do once you are known, like which gate your boarding pass lets you through. A server can know perfectly well that you are logged in as Alice and still fail to check that the thing you are asking for belongs to Alice. That failure is an authorisation problem.

What an IDOR is

IDOR stands for Insecure Direct Object Reference. It means the server takes an identifier sent by the user (a number, a code, a file name) and uses it to fetch or act on something, without checking that this user is allowed to touch that something. The identifier is "direct" because it points straight at the object, and "insecure" because the check is missing. The classic example is a website with addresses like invoice?id=1001, where changing the number to 1002 shows you somebody else's invoice.

What severity ratings like P3 and P2 mean

Bug bounty programmes sort findings by how much damage they could cause. The exact scale varies between companies, but a common pattern is P1 for the most serious, down through P2, P3 and so on. P3 is typically a limited-impact issue, P2 a serious one. The rating is not fixed at the moment a report is filed: if the researcher can show a bigger real-world consequence, the rating can go up.

The setup

The researcher, Mahmoud Adel, who goes by el7xoot, describes himself as a bug hunter and security researcher focused on web applications and APIs. He had an ordinary account on example.com whose subscription was limited to one website. For the later part of the investigation he used two accounts:

  • Attacker: his own account.
  • Victim: an account with a paid subscription.

That is the whole setup. No special tools, software versions or other preconditions are described.

Finding it

While testing example.com, the researcher found the API that creates websites. He noticed something important about it: the request includes a subscription_id, and that value is supplied by the client, meaning the browser, meaning the person using the site. The server does not work it out for itself; it takes the customer's word for it.

His own subscription allowed only one website. So the natural question was whether that limit could be bypassed by changing the identifier. This is the right instinct in security testing: whenever a limit exists, ask where the limit is enforced, and whether the part of the request that describes the limit can be edited.

Exploitation

Step 1: Capture the creation request

The request that creates a website looked like this:

HTTP
POST /api/hosting/instancesHost: my.example.com{"subscription_id":"ATTACKER_SUB"}

Line by line, in plain words:

  • POST /api/hosting/instances is the method and the endpoint. POST says "I am sending data and asking you to create something". /api/hosting/instances is the address of the door that creates a hosting instance, which is the product's internal name for a website.
  • Host: my.example.com is a header. It tells the server which site name the request is for. Here it points at my.example.com.
  • {"subscription_id":"ATTACKER_SUB"} is the body, written in JSON. It says: use the subscription whose identifier is ATTACKER_SUB for this new website. The placeholder stands for the researcher's own subscription code.

The key observation is that the subscription value sits in the body, which is fully under the client's control. Nothing in the request proves that the subscription belongs to the person sending it.

Step 2: Note the predictable identifier format

The subscription IDs followed a predictable format:

Text
A-S02991817A-S02991818A-S02991819

This shows three identifiers in a row. Each one starts with A-S and then a number, and the numbers run in sequence: 02991817, then 02991818, then 02991819. The identifiers followed a predictable format, with numbers running in sequence. It is like a row of lockers numbered 1, 2, 3: if you know your own locker number, you know the numbers of the ones next to it.

Step 3: Swap in another subscription ID

The researcher changed the subscription_id and found that he could use another subscription ID to create additional websites, bypassing the one-website limitation of his own subscription. That was already an authorisation issue, and the report was initially classified as P3.

Why this matters: the server was not checking that the subscription being used was the one attached to his account. It accepted any valid-looking identifier. At this stage the damage looked small, because the researcher was only using other subscriptions to get more websites than he had paid for. The company agreed and rated it P3.

Step 4: Ask who owns the other subscription

The researcher was not satisfied with that impact. He asked himself a sharper question: if he could use another subscription ID, what happens if that subscription belongs to another user? This is the step where a modest finding turns into a serious one. The first test answered "can I use a subscription that is not mine?" The second test asks "whose is it, and who pays for it?"

He tested with the two accounts described above and replaced his subscription ID with the victim's:

JSON
{"subscription_id":"VICTIM_SUB"}

This is the body of the same creation request, with the placeholder for the victim's subscription code in place of his own. The rest of the request is unchanged.

The request was accepted. There was no ownership validation and no authorisation error: the backend simply trusted the supplied subscription ID. In everyday terms, the hotel clerk took the room number the guest said out loud and handed over the key without checking the guest's name against the booking.

Root cause

The backend trusted the client-supplied subscription_id when creating a website. It did not check that the subscription belonged to the authenticated user before consuming it. The missing ownership check is the flaw itself: the backend trusted whatever subscription ID was supplied.

That last point is worth pausing on. It is tempting to blame the sequential numbers, and they certainly made the attack easier. But the real defect is that the server never asked "does this subscription belong to you?"

Impact

The impact was no longer just creating more websites than a subscription allows. It became the ability to use a subscription that another customer paid for. The victim paid for the subscription, the attacker used it, and because the resource was now being consumed by the attacker, the victim could no longer use their own paid resource as intended.

This is why the business framing mattered so much. "I can create extra websites" sounds like a minor abuse of a limit. "I can spend somebody else's money and take away what they paid for" is a different kind of problem entirely, and it is the kind of consequence that companies care about.

The initial finding, bypassing the one-website limitation, was rated P3. After the researcher clarified the business impact, the severity was raised from P3 to P2.

From the original on medium.com

Fix

The report does not describe a fix. The change it implies is server-side ownership validation: before creating a website, the backend should verify that the supplied subscription_id belongs to the authenticated user and reject the request otherwise. The check has to happen on the server, because anything the browser sends can be edited by the person using the browser.

Variants to test

These are the follow-up tests the same idea suggests, useful if you want to look for similar problems yourself.

  1. Swap the subscription identifier in any billing or provisioning request. A positive result is a successful creation or provisioning response for an identifier that belongs to another account.
  2. Enumerate sequential identifiers. Where IDs follow a predictable pattern, walk neighbouring values and check whether any are accepted for your session.
  3. Test with a second account you control. Create a paid subscription on one account and try to consume it from the other; a positive result is acceptance without an ownership error.
  4. Check whether the victim's resource becomes unavailable. If the attacker's use consumes the paid resource, the victim can no longer use it as intended, which strengthens the business impact.
  5. Re-test the same identifier in other endpoints. The same subscription_id may be trusted by related APIs, so try it wherever the value is accepted.

The lesson

The researcher's own summary is that finding the vulnerability is only half the job. When you discover an IDOR, do not stop at the first impact you find. Ask what else the identifier can give you access to. In this case the first answer was more websites, and the second, much more important answer was someone else's paid subscription.

Glossary

  • API: the set of addresses on a server that programs and browsers can send requests to, in order to read or change data.
  • Endpoint: one specific address in an API, such as /api/hosting/instances, that performs one specific job.
  • Request: the message a browser or program sends to a server, made of a method, a path, headers and sometimes a body.
  • Method: the verb of a request, such as GET (fetch something) or POST (send data and create or change something).
  • Header: a small labelled note attached to a request, such as Host, which says which site name the request is for.
  • Body: the part of a request that carries the actual data, often written in JSON.
  • JSON: a text format for writing data as name and value pairs inside curly braces, readable by both browsers and servers.
  • Server: the computer that stores data and makes decisions on behalf of a website; the part the user never sees directly.
  • Backend: another word for the server-side part of an application, where the logic and checks are supposed to live.
  • Client: the program making the request, usually the browser, and by extension the person using it.
  • Client-controlled: a value that the client sends and can therefore change freely before sending.
  • Subscription: the paid plan attached to an account, which defines what the customer is entitled to, such as how many websites they may create.
  • Subscription ID: the short code that identifies a particular subscription, used by the server to look it up.
  • Hosting instance: the product's internal name for a website created through the API.
  • Authentication: proving who you are, for example by logging in.
  • Authorisation: what a known user is allowed to do, and which resources they are allowed to touch.
  • Ownership validation: a server-side check that the resource a user refers to actually belongs to that user.
  • IDOR (Insecure Direct Object Reference): a flaw where the server takes an identifier from the user and acts on the object it points to without checking that the user is allowed to.
  • Enumerate: to walk through a series of values one by one, for example neighbouring numbers, to find ones that are accepted.
  • Sequential identifier: an identifier whose values follow one another in order, making them easy to guess.
  • Severity rating: a label such as P2 or P3 that expresses how serious a finding is, with lower numbers generally meaning more serious.
  • P3: a severity level typically used for limited-impact findings.
  • P2: a severity level typically used for serious findings, above P3.
  • Business impact: the real-world consequence of a flaw, expressed in terms of money, lost service or harm to customers, rather than in technical terms.
  • Bug bounty programme: an arrangement in which a company rewards researchers for reporting security flaws to it.
  • Bug hunter: a security researcher who looks for such flaws, often across many companies' products.

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.