Skip to content
IDOR Write-up Beginner

When Authentication Isn’t Enough: A Cross-Tenant Authorization Flaw in a Payment API

A payment API failed to check that a requested deposit or transaction belonged to the authenticated account, so any logged-in user could read another account's deposit details and transaction history, and could modify transaction state, by supplying that account's object identifier. The identifier could be derived from a public payment page, making discovery easier.

L15B04 Follow

Published on medium.com

Bola

L15B04, 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. 6 min read.

Context

The target was a payment-related API. The functionality involved deposits and deposit transaction history, plus a second transaction-related operation that suggested the authorization problem could extend to modifying transaction state or tracking information. The application generated public payment pages for deposits, designed to be shared with other parties as part of the payment flow.

The API required authentication before allowing access to the affected functionality. The flaw was that, after authenticating the requester, the backend did not consistently verify that the requested object belonged to the authenticated account. The author classifies this as Broken Object Level Authorization (BOLA), also commonly associated with IDOR-style access control failures.

Setup

Two separate test accounts were used, referred to as:

Text
Account A = object owner
Account B = unauthorized account

Each account received its own authentication token. A deposit was then created under Account A. No victim credentials were required.

Finding it

The starting observation is conceptual: authentication answers who you are, but authorization answers what you are allowed to access. The application correctly enforced authentication, yet the backend did not consistently check ownership of the object referenced in the request.

The vulnerable logic behaved like this:

Text
Authenticated user
       │
       ▼
Request contains object ID
       │
       ▼
Does object exist?
       │
       ▼
Return object

The authorization model should instead have been:

Text
Authenticated user
       │
       ▼
Request contains object ID
       │
       ▼
Does object exist?
       │
       ▼
Does object belong to this user?
       │
   ┌───┴───┐
   │       │
  YES      NO
   │       │
   ▼       ▼
Return   Reject
object   request

The missing ownership check meant a valid token was being treated as sufficient to reach objects the API accepted without verifying they belonged to the requester.

Exploitation

Step 1: create a deposit under Account A

A deposit was created under Account A. The API returned an object containing a unique deposit identifier, and that identifier was associated with Account A.

From the original on medium.com

Step 2: reuse Account A's deposit identifier with Account B's token

The same API request was made using Account B's authentication token while supplying Account A's deposit identifier. The server returned:

HTTP
HTTP/1.1 200 OK

and returned information associated with Account A's deposit. There was no relationship between Account B and that deposit. Authentication was working, but authorization was not.

Step 3: retrieve deposit transaction history across tenants

The problem became more significant when testing the endpoint responsible for retrieving deposit transaction history. Using Account B's credentials and Account A's deposit identifier, the API again returned:

HTTP
HTTP/1.1 200 OK
From the original on medium.com

For deposits containing transaction activity, the response included information such as:

  • Transaction identifiers
  • Transaction amounts
  • Token information
  • Source or payer addresses
  • Transaction status
  • Settlement amounts
  • Settlement currencies
  • Timestamps

This was not merely exposing the existence of another user's object: it could expose business and financial activity associated with that object.

Step 4: object discovery through the public payment flow

Obtaining an object identifier did not necessarily require privileged API access. The application generated public payment pages associated with deposits, designed to be shared with other parties as part of the payment flow. During testing, the public page contained application data from which the underlying deposit identifier could be determined.

The resulting attack chain was:

Text
User creates deposit
        │
        ▼
Public payment link is generated
        │
        ▼
Another party obtains the link
        │
        ▼
Deposit identifier can be determined
        │
        ▼
Attacker authenticates with their own account
        │
        ▼
Attacker supplies the identifier
        │
        ▼
API fails to verify ownership
        │
        ▼
Unauthorized deposit information is returned

The security distinction is that public visibility of a payment page does not imply authorization to access private account data through an authenticated API. A public identifier should always be treated as potentially discoverable.

Step 5: a second authorization failure on a transaction operation

Further testing revealed a similar pattern in another transaction-related operation. A transaction associated with Account A could be referenced while authenticated as Account B. The API accepted the request and reported successful processing, suggesting the same underlying authorization problem was present in more than one endpoint.

The application appeared to validate that the supplied transaction existed, but did not sufficiently establish that the transaction belonged to the authenticated principal:

Text
transactionId supplied by client
             │
             ▼
       Transaction exists?
             │
             ▼
            YES
             │
             ▼
       Process transaction

The required check should instead be:

Text
transactionId supplied by client
             │
             ▼
       Transaction exists?
             │
             ▼
 Does transaction belong to authenticated account?
          │      ┌───┴───┐
          │       │
         YES      NO
          │       │
          ▼       ▼
       Process   Reject

This matters particularly for APIs that allow state changes or registration of transaction information.

Root cause

The likely root cause was insufficient object-level authorization enforcement. A secure implementation should conceptually enforce a relationship such as:

Text
requested_object.owner_id
        ==
authenticated_user.id

before returning or modifying the object. For example:

Python
deposit = get_deposit(deposit_id)
Python
if deposit.owner_id != authenticated_user.id:
    return unauthorized()

Even better, ownership can be enforced directly at the data-access layer:

SQL
SELECT *
FROM deposits
WHERE id = ?
  AND owner_id = ?;

This approach reduces the chance that developers retrieve an object first and forget to perform the authorization check afterward. Authentication was enforced for the affected functionality, but it did not stop an authenticated tenant from referencing another tenant's object.

Impact

The fundamental security boundary in a multi-tenant application is that one customer must never be able to access another customer's data simply by knowing an object identifier. Here, possession of an object ID was effectively enough to cross that boundary. The potential impact included:

  • Cross-tenant data access: an authenticated user could access deposit information belonging to another account.
  • Financial information disclosure: transaction history could contain amounts, tokens, settlement information and transaction timestamps.
  • Address disclosure: transaction records could expose blockchain addresses associated with payments.
  • Business intelligence leakage: transaction activity can reveal information about payment volume, activity patterns, settlements and potentially business operations.
  • Unauthorized transaction manipulation: the additional transaction-related endpoint suggested the authorization problem could extend beyond data disclosure into operations that modify transaction state or tracking information.

The author explicitly did not demonstrate access to the victim's authentication credentials, account takeover, direct movement of funds, compromise of the victim's account, or bypassing authentication entirely. The issue was specifically an authorization failure between authenticated tenants.

Fix

The report does not describe a fix that was applied. The recommended approach is to enforce ownership on every object access, either with an explicit check after retrieval or, preferably, by scoping the query at the data-access layer so the object is only returned when it belongs to the authenticated user, as in the SELECT example above. The same ownership check must apply to operations that modify transaction state, not only to reads.

Variants to test

  1. Swap object identifiers between two accounts on every read endpoint. Create an object under Account A, then request it with Account B's token. A positive result is Account A's data returned to Account B's token.
  2. Test nested and history endpoints, not just the primary object endpoint. Use Account A's deposit identifier against the transaction history endpoint with Account B's token. A positive result is transaction data belonging to Account A returned to Account B's token.
  3. Test write and state-change operations. Reference Account A's transaction identifier while authenticated as Account B on operations that register or process transactions. In the reported case, the API accepted the request and reported successful processing.
  4. Look for identifiers in public or shareable pages. Check public payment links and similar shareable pages for application data from which the underlying object identifier can be derived, then use that identifier with your own account. The original says the identifier could be determined from the public page; it does not describe following that identifier through to a request.
  5. Check whether unauthenticated rejection is the only control. Confirm the endpoint rejects requests without a token, then repeat with a valid token for a different tenant.

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

What happened, in plain words

A researcher was testing a payment service, the kind of website or app that lets people send and receive money. The service had a programming interface behind it, called an API, that the website and app use to fetch and change data. The researcher found that once you were logged in, you could ask the API for information belonging to a completely different customer, just by knowing a short identifier that pointed at that customer's deposit. You did not need that customer's password, and you did not need to break the login at all. You only needed your own valid account and someone else's identifier.

The same mistake appeared in more than one place. The API returned another account's deposit details, and the transaction history endpoint returned that deposit's transaction data, including amounts, addresses and settlement information. A further transaction-related operation accepted a request referencing a transaction associated with Account A while authenticated as Account B, and reported successful processing.

The researcher also found that the identifier was not even hard to get: the service created public payment pages for deposits, pages meant to be shared with other people, and those pages contained data from which the deposit identifier could be worked out.

This kind of flaw has a name: Broken Object Level Authorization, usually shortened to BOLA. It is also often described as an IDOR-style problem. Both terms are explained as we go.

The basics you need first

Before the details make sense, here are the few ideas the whole report rests on.

What an API is. Think of a restaurant. You do not walk into the kitchen and cook. You tell the waiter what you want, the waiter takes your order to the kitchen, and the kitchen sends back a plate. An API is the waiter between a website or app and the server that holds the data. The app sends a request, the server sends back a response. When people talk about "calling an endpoint", they mean sending a request to one specific address on that server, for example the address that handles deposits.

What authentication is. Authentication is proving who you are. At a restaurant, it is showing your booking name at the door. On a website, it is logging in with your username and password. Once you are logged in, the server gives your browser or app a small piece of text to carry around, called a token. Every later request includes that token, so the server knows which account is asking. A token works a bit like a wristband at an event: the staff check the wristband instead of asking for your ID every time.

What authorization is. Authorization is deciding what you are allowed to do once you are inside. Your event wristband might get you into the main hall but not backstage. Authentication answers "who are you?". Authorization answers "what are you allowed to access?". These are two separate questions, and a system can get the first one right and the second one wrong. That is exactly what happened here.

What an object is. In this context, an object is a single record in the database, such as one deposit or one transaction. Each object has an identifier, a short unique code that points at it, a bit like a ticket number. If you know the ticket number, you can ask for that ticket.

What BOLA and IDOR mean. Broken Object Level Authorization means the server checks that you are logged in, but does not check that the specific object you asked for belongs to you. IDOR stands for Insecure Direct Object Reference and describes the same family of mistake: the server lets you refer directly to an object by its identifier and trusts that reference. The everyday comparison is a cloakroom. If the attendant hands over any coat to anyone who reads out a ticket number, without checking that the ticket matches the person, the cloakroom has a BOLA problem.

What a multi-tenant application is. A service that serves many separate customers from the same system is multi-tenant. Each customer is a tenant. The most important rule in such a system is that one tenant must never reach another tenant's data.

The vulnerability

The application did require you to be logged in before you could use the affected features. That part worked. The problem was what happened next: after confirming who was asking, the server did not consistently check that the object being requested belonged to that account.

The researcher drew the faulty logic like this:

Text
Authenticated user
       │
       ▼
Request contains object ID
       │
       ▼
Does object exist?
       │
       ▼
Return object

Read it from top to bottom. First, the user is authenticated, meaning the server has confirmed the token is valid. Second, the request carries an object ID, the ticket number of the record being asked for. Third, the server asks one question only: does an object with this ID exist? If yes, it returns the object. Nowhere in that chain does the server ask whether this particular user is allowed to see it.

The logic should have looked like this instead:

Text
Authenticated user
       │
       ▼
Request contains object ID
       │
       ▼
Does object exist?
       │
       ▼
Does object belong to this user?
       │
   ┌───┴───┐
   │       │
  YES      NO
   │       │
   ▼       ▼
Return   Reject
object   request

This version adds one extra question after the existence check: does the object belong to this user? If yes, return it. If no, reject the request. That single missing question is the whole vulnerability. A valid token was being treated as permission to reach any object the API would accept.

Two accounts were enough

To test this safely, the researcher used two separate accounts on the service:

Text
Account A = object owner
Account B = unauthorized account

Account A is the honest customer whose data will be targeted. Account B is the attacker's own account, a normal account with normal permissions. The point of using two accounts is to be able to say clearly: this data belongs to A, this request was made by B, and B should never have seen it.

Each account received its own authentication token, its own wristband. A deposit was then created under Account A. No victim credentials were required, meaning the researcher never needed Account A's password. Account A here is a test account the researcher controls, which is how this kind of testing is done without touching a real customer.

From the original on medium.com

The screenshot shows the result of creating that deposit under Account A. The API returned an object containing a unique deposit identifier, and that identifier was associated with Account A. In plain terms: the researcher now held a ticket number that belonged to A.

Step 1: create a deposit under Account A

This step is simply setting up the test. You need an object to try to reach before you can try to reach it. Creating a deposit under Account A gives you a real record with a real identifier, owned by a known account. Everything that follows depends on having that identifier in hand.

Step 2: use Account A's identifier with Account B's token

The next step was to make the same API request again, but with two changes. The request now carried Account B's authentication token, and it supplied Account A's deposit identifier. In other words: B's wristband, A's ticket number.

The server returned:

HTTP
HTTP/1.1 200 OK

This line is the first line of the server's reply. HTTP/1.1 is the version of the protocol being used to talk between client and server. 200 OK is the status code, a number that says how the request went. 200 means success: the server did what was asked. Other common codes you may have seen are 404 for not found and 403 for forbidden. Here, the server said success and returned information associated with Account A's deposit.

There was no relationship between Account B and that deposit. B did not own it, had never interacted with it, and had no permission to see it. The request was accepted as coming from a logged-in user, so authentication was working, but authorization was not, because the ownership check was missing.

Step 3: read another account's transaction history

The problem became more serious when the researcher tested the endpoint responsible for retrieving deposit transaction history. A deposit can have transactions attached to it, the individual movements of money in or out. This endpoint returns that list.

Using Account B's credentials and Account A's deposit identifier, the API again returned:

HTTP
HTTP/1.1 200 OK
From the original on medium.com

The screenshot shows that response. For deposits containing transaction activity, the response included information such as:

  • Transaction identifiers
  • Transaction amounts
  • Token information
  • Source or payer addresses
  • Transaction status
  • Settlement amounts
  • Settlement currencies
  • Timestamps

Each of these is a piece of financial detail. Transaction identifiers are the ticket numbers of individual movements. Amounts are how much moved. Token information refers to the particular digital token or currency involved. Source or payer addresses are the addresses money came from, which in crypto-style payments are blockchain addresses, long strings that act like account numbers. Status says whether a transaction completed or is pending. Settlement amounts and currencies describe how the payment was finally cleared and in what currency. Timestamps say when each thing happened.

This is why the finding matters more than it first appears. The flaw was not merely revealing that another user's object exists. It was exposing business and financial activity attached to that object: how much, from where, in what currency, and when.

Step 4: finding identifiers through the public payment flow

One detail made the whole thing easier to exploit. Getting an object identifier did not necessarily require any special access. The application generated public payment pages associated with deposits, pages designed to be shared with other parties as part of the payment flow. Think of a payment link you might send to a friend so they can pay you.

During testing, the public page contained application data from which the underlying deposit identifier could be determined. So the identifier could be determined from application data on a page anyone with the link could open.

The full attack chain looked like this:

Text
User creates deposit
        │
        ▼
Public payment link is generated
        │
        ▼
Another party obtains the link
        │
        ▼
Deposit identifier can be determined
        │
        ▼
Attacker authenticates with their own account
        │
        ▼
Attacker supplies the identifier
        │
        ▼
API fails to verify ownership
        │
        ▼
Unauthorized deposit information is returned

Follow it step by step. A user creates a deposit. The service generates a public payment link for it. Someone else obtains that link, which is normal, because the link is meant to be shared. From the page behind the link, the deposit identifier can be worked out. The attacker then logs in with their own ordinary account. They send that identifier to the API. The API fails to check ownership. It returns the deposit information to someone who should never have seen it.

The security point to take away is this: a payment page being public does not mean the private account data behind it is public. The page is meant to be seen. The API that returns account details is not. A public identifier should always be treated as something an attacker might find, so it can never be used as proof of permission.

Step 5: a second authorization failure

Further testing found the same pattern in another transaction-related operation. A transaction associated with Account A could be referenced while logged in as Account B. The API accepted the request and reported successful processing.

This is a step beyond reading. Reading is looking at data. The original says this suggested the problem could extend to operations that modify transaction state or tracking information; no such change was demonstrated. The fact that it succeeded suggests the same underlying authorization problem existed in more than one endpoint, not just one.

The application appeared to check that the supplied transaction existed, but did not sufficiently establish that the transaction belonged to the person making the request:

Text
transactionId supplied by client
             │
             ▼
       Transaction exists?
             │
             ▼
            YES
             │
             ▼
       Process transaction

Again, read it as a sequence. The client, meaning the app or tool making the request, supplies a transaction ID. The server checks whether a transaction with that ID exists. If yes, it processes it. The question of ownership is never asked.

The required check should instead be:

Text
transactionId supplied by client
             │
             ▼
       Transaction exists?
             │
             ▼
 Does transaction belong to authenticated account?
          │      ┌───┴───┐
          │       │
         YES      NO
          │       │
          ▼       ▼
       Process   Reject

Here the extra question appears: does this transaction belong to the authenticated account? If yes, process it. If no, reject it. This matters especially for APIs that allow state changes or registration of transaction information, because a wrong answer there does not just leak data, it can alter it.

Why this matters

The fundamental security boundary in a multi-tenant application is that one customer must never be able to access another customer's data simply by knowing an object identifier. In this case, possession of an object ID was effectively enough to cross that boundary. The potential impact included:

Cross-tenant data access. An authenticated user could access deposit information belonging to another account. One tenant reached into another tenant's records.

Financial information disclosure. Transaction history could contain amounts, tokens, settlement information and transaction timestamps. Anyone who obtained it would learn the financial details of someone else's payments.

Address disclosure. Transaction records could expose blockchain addresses associated with payments. Those addresses are the equivalent of account numbers for crypto-style payments.

Business intelligence leakage. Transaction activity can reveal information about payment volume, activity patterns, settlements and potentially business operations. Even without names attached, a steady stream of payment data tells a story about how much a business moves and when.

Unauthorized transaction manipulation. The additional transaction-related endpoint suggested the authorization problem could extend beyond data disclosure into operations that modify transaction state or tracking information. That is the difference between someone reading your bank statement and someone editing it.

What was not demonstrated

It is just as important to be clear about the limits of a finding. During testing, the researcher did not demonstrate:

  • Access to the victim's authentication credentials
  • Account takeover
  • Direct movement of funds
  • Compromise of the victim's account
  • Bypassing authentication entirely

The issue was specifically an authorization failure between authenticated tenants. Nobody's password was stolen, nobody's account was taken over, and no money was actually moved. The failure was that one logged-in customer could reach another logged-in customer's objects. Being precise about this matters when judging how serious the problem really is.

Root cause

The likely root cause was insufficient object-level authorization enforcement. In plain words, the server did not check who owned the object before handing it over.

A secure implementation should enforce a relationship like this:

Text
requested_object.owner_id
        ==
 authenticated_user.id

This is a comparison. requested_object.owner_id is the account that owns the object being asked for. authenticated_user.id is the account making the request. The two must be equal. If they are not, the request should not go through.

For example, a program might first fetch the deposit:

Python
deposit = get_deposit(deposit_id)

This line asks the database for the deposit with the given identifier and stores the result in a variable called deposit. On its own it does no authorization at all; it just retrieves.

Then it should check ownership:

Python
if deposit.owner_id != authenticated_user.id:
    return unauthorized()

Line by line: if starts a condition. deposit.owner_id is the owner stored on the deposit. != means "is not equal to". So the line reads: if the deposit's owner is not the person asking, then run the next line. return unauthorized() stops the request and sends back a refusal. Only if the two match does the code continue and return the deposit.

Even better, ownership can be enforced directly at the data-access layer, in the database query itself:

SQL
SELECT *
FROM deposits
WHERE id = ?
  AND owner_id = ?;

This is SQL, the language used to talk to databases. SELECT * means return all columns of the matching rows. FROM deposits says which table to look in. WHERE id = ? says only rows whose identifier matches the first value. AND owner_id = ? adds a second condition: the owner must also match the second value. The question marks are placeholders filled in by the program. The effect is that the database only ever returns a deposit if it belongs to the asking user. If it belongs to someone else, the query simply finds nothing.

This approach reduces the chance that a developer retrieves an object first and forgets to perform the authorization check afterwards. The check is built into the retrieval, which reduces the chance of forgetting it. Authentication was enforced for the affected functionality, but it did not stop an authenticated tenant from referencing another tenant's object.

Lessons for API security

The assessment reinforced a simple but frequently overlooked principle: authentication is not authorization. A valid token does not mean the bearer of that token can access every object the API accepts. A wristband gets you into the building, not into every room.

A secure multi-tenant API needs to establish three things:

Text
Who is making the request?
        +
What object are they requesting?
        +
Is that object authorized for this user?

Only after all three conditions are satisfied should the operation proceed. The first question is authentication. The second identifies the target. The third is the ownership check that was missing here.

Final thoughts

Broken Object Level Authorization remains one of the most important API security problems because the exploitation can be surprisingly simple. The attacker may not need:

  • A stolen password
  • A compromised account
  • An advanced exploit
  • Malware
  • Privileged access

Sometimes all that is required is a valid account and an object identifier that the application should never have trusted as proof of ownership.

For developers building multi-tenant APIs, the takeaway is straightforward: never authorize access based solely on the existence of an object ID. Always establish ownership or explicit permission before reading or modifying the object.

For security researchers, this is a useful reminder that testing logged-in functionality should not stop after confirming that the endpoint rejects requests without a token. The more important question is: can User B perform User A's operation simply by replacing the object identifier? That single test can uncover serious authorization flaws.

Glossary

  • API: the interface a website or app uses to ask a server for data or to change it; the waiter between the app and the kitchen.
  • Endpoint: one specific address on a server that handles one kind of request, such as creating a deposit or fetching transaction history.
  • Authentication: proving who you are, for example by logging in.
  • Authorization: deciding what a logged-in user is allowed to access or do.
  • Token: a piece of text issued after login that the client sends with each request so the server knows which account is asking; like a wristband.
  • Object: a single record in a database, such as one deposit or one transaction.
  • Object identifier: a short unique code that points at one object, like a ticket number.
  • BOLA (Broken Object Level Authorization): a flaw where the server checks that you are logged in but not that the object you requested belongs to you.
  • IDOR (Insecure Direct Object Reference): a closely related flaw where the server lets you refer directly to an object by its identifier and trusts that reference.
  • Multi-tenant application: a service that serves many separate customers from the same system, where each customer is a tenant.
  • Cross-tenant access: one customer reaching another customer's data.
  • HTTP status code: the number in a server's reply saying how the request went, such as 200 for success or 403 for forbidden.
  • 200 OK: the status code meaning the request succeeded.
  • Deposit: a payment into an account, recorded as an object in the system.
  • Transaction: an individual movement of money attached to a deposit.
  • Transaction history: the list of transactions belonging to a deposit.
  • Settlement: the final clearing of a payment, including the amount and currency involved.
  • Blockchain address: a long string that acts like an account number for crypto-style payments.
  • Public payment page: a shareable page generated for a deposit so other parties can take part in the payment flow.
  • Attack chain: the sequence of steps an attacker follows from first access to final result.
  • Root cause: the underlying reason a flaw exists, as opposed to its visible symptoms.
  • SQL: the language used to query databases.
  • Data-access layer: the part of a program that talks to the database.
  • State change: an operation that alters stored data rather than only reading it.
  • Account takeover: an attacker gaining control of someone else's account.
  • Credential: the username and password, or similar secret, used to log in.

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.