Skip to content
IDOR Write-up Beginner

BOLA in Munshi: Sub-Users Could Delete the Tenant Owner’s Invoices

A sub-user in the same tenant could delete invoices owned by the tenant owner because the backend checked tenant membership but not object-level ownership. An authenticated sub-user could therefore remove the owner's financial records through both single and bulk deletion endpoints.

TheWildEye Follow

Published on medium.com

Cybersecurity

TheWildEye, 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

Munshi is a web application by Petpooja, reachable at https://munshi.petpooja.com. It supports multiple users inside a single tenant: an owner and one or more sub-users. Invoices are the financial records the application manages, and the product exposes an API for deleting them, both one at a time and in bulk.

The feature under review is invoice deletion. The application had a role-based access control (RBAC) implementation for user management, and the deletion endpoints required an authenticated session. What they did not do was check whether the authenticated user was allowed to delete the particular invoice being referenced.

That is the whole finding: a Broken Object Level Authorization (BOLA) flaw in the invoice deletion workflow, where the backend checked tenant membership but not ownership of the target object. The assessment documented it in both the single-invoice and the bulk-deletion paths.

Setup

The test required two things: a tenant with an owner account, and a sub-user account inside the same tenant. The sub-user was a legitimate, authenticated account; no login bypass, session forgery or privilege escalation was involved at any point.

The target invoice had to belong to the tenant owner rather than to the sub-user. The researcher first confirmed this ownership from the invoice record itself, which associated the record with the owner role. Sensitive record identifiers, personal information, company details, invoice metadata and financial values were redacted from the published screenshot.

From the original on medium.com

Figure 1 shows that invoice record, with the ownership by the tenant owner visible and the sensitive fields masked. Establishing this ownership was the precondition for the whole test: without it, a sub-user deleting an invoice would prove nothing.

The affected endpoints were:

Text
DELETE /api/invoice/{invoice_id}
POST /api/invoices/bulk-delete

Finding it

During the assessment, the researcher found that the invoice mutation endpoints did not apply the same authorization boundary as the rest of the application. User management had RBAC, but invoice deletion appeared to rely on tenant membership alone.

That distinction is the reason the issue looked wrong. Authentication establishes who is making a request. Tenant membership establishes which organisation the user belongs to. Neither, on its own, proves that the user may delete a specific invoice. A backend that stops at the tenant boundary treats membership as permission to operate on every record belonging to every user in that tenant, which is exactly the over-broad evaluation BOLA describes.

Exploitation

Step 1: Confirm the target belongs to the owner

Before sending anything, the researcher verified from the invoice record that the invoice was owned by the tenant owner and not by the sub-user who would perform the deletion. This is what separates the test from a user legitimately deleting an invoice they are permitted to manage.

Step 2: Send the single-invoice DELETE as the sub-user

Using the authenticated sub-user account, the researcher submitted a deletion request referencing the owner's invoice through the single-invoice endpoint:

HTTP
DELETE /api/invoice/{invoice_id}

The {invoice_id} path segment is the user-controlled key: it identifies the object the request acts on, and the server is responsible for checking that the caller may act on that object. Here the server did not.

From the original on medium.com

Figure 2 shows the DELETE request performed with the sub-user account.

Step 3: Observe the response and verify the record

The server returned an HTTP 200 response with a success result.

From the original on medium.com

Figure 3 shows that successful response.

The response alone would not have established that the underlying record was gone, so the researcher verified separately that the owner's invoice had in fact been deleted. The significance of the finding comes from the complete chain: the target belonged to the tenant owner, the request came from a sub-user account, and the invoice was successfully removed.

Step 4: Repeat against bulk deletion

The same authorization gap was documented in the bulk-deletion endpoint:

HTTP
POST /api/invoices/bulk-delete

Both single and bulk invoice deletion were affected. That matters because the same missing boundary can potentially be exercised against multiple financial records in one request, rather than one record at a time.

Root cause

The root cause was the absence of object-level ownership validation before invoice deletion.

The assessment identified a helper responsible for resolving accessible users that expanded the operation's scope to all users within the tenant. The delete workflow then used that expanded scope when locating records to remove. Because the target invoice's ownership was not validated before deletion, an invoice belonging to the tenant owner could satisfy the database query and be deleted by an authenticated sub-user.

The existing defences did not stop it because they answered a different question. Authentication confirmed the sub-user was a valid account. Tenant scoping confirmed the invoice was inside the same organisation. RBAC existed, but the invoice mutation endpoints did not consistently apply the same authorization boundary as user management, so the destructive operation ran without a per-object permission check. The weakness is classified as Broken Object Level Authorization, associated here with CWE-639, Authorization Bypass Through User-Controlled Key.

Impact

An authenticated sub-user could delete invoices belonging to the tenant owner, through the application's normal API workflow, in both the single and bulk paths. Invoices are business records rather than mere database rows, so unauthorised deletion can affect accounting integrity, auditability and the reliability of records used by connected workflows. Where invoice changes are synchronised with downstream systems, unauthorised deletions may also affect those systems.

The demonstrated issue was the deletion of the tenant owner's invoice by a sub-user. The broader consequences depend on how the application and its connected systems handle deleted records.

Fix

The remediation status recorded for the finding is Fixed. The fix has to be enforced by the backend, at the point where the invoice is modified or deleted, and the report sets out what it should include:

  1. Enforce object-level authorization: check invoice ownership and the user's assigned permissions before deleting a record.
  2. Apply RBAC consistently: make single-delete and bulk-delete follow the same authorization policy as the rest of the application.
  3. Validate every item in bulk operations: do not let a bulk request bypass the ownership checks applied to individual invoices.
  4. Scope database operations correctly: restrict deletion queries to records the requesting user is authorised to manage.
  5. Add regression tests: verify that a sub-user can manage permitted invoices but cannot delete owner-owned or otherwise unauthorised records.
  6. Log and reject unauthorised operations: record denied cross-user deletion attempts without exposing sensitive record details in responses.

Testing should cover both single and bulk deletion, including mixed batches containing records the user can manage and records they cannot. An unauthorised invoice must not be deleted merely because other records in the request are accessible. Changing or obscuring the identifier would not fix the weakness; the ownership and authorisation decision must be enforced by the backend on every relevant operation.

Variants to test

  • Other destructive verbs on the same object type. Try update, archive or restore endpoints that take an invoice identifier, using a sub-user against an owner-owned record.
  • Bulk endpoints with mixed batches. Submit a batch containing one invoice the sub-user may manage and one owned by the owner.
  • Other tenant-scoped resources. Apply the same pattern to customers, payments, staff or settings objects that accept an identifier.
  • The accessible-users helper elsewhere. Look for other workflows that resolve "accessible users" and then widen a query to the whole tenant.
  • Cross-tenant rather than intra-tenant. Swap in an identifier from a different tenant while authenticated in your own.
  • Read paths on the same object. Request the owner's invoice by identifier as a sub-user.

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

What happened, in plain words

Munshi is a web application made by Petpooja, and you can reach it at https://munshi.petpooja.com. Think of it as a shared online office for a business: it keeps track of invoices, which are the bills a business sends to its customers and the records it keeps of money owed and paid. Inside one Munshi account, called a tenant, there can be several people. One of them is the owner, the person who set up the account and owns the business records. The others are sub-users, staff members who have been given a login to help out.

A tenant is simply one organisation's separate space in the application. Everything belonging to that business lives inside it, and people from other businesses cannot see it. That separation is important, and we will come back to it.

Munshi lets people delete invoices. You can delete one invoice at a time, or you can select several and delete them all in one go, which is called bulk deletion. The application does this through something called an API.

An API (Application Programming Interface) is the set of doors and windows a program uses to talk to another program. When you click a button in a web page, the page usually does not do the work itself. It sends a message to the company's server, a computer somewhere else that holds the real data, and asks it to do something. That message is an API request, and the server's answer is the API response. You can think of the API as a service counter: you hand over a written request, the clerk behind the counter checks it, and either does what you asked or refuses.

Each request has a method, which is the verb telling the server what kind of action you want. GET means "give me something". POST means "create something" or "submit something". DELETE means "remove something". The request also has a path, which is the address of the thing you are acting on, a bit like a street address on an envelope.

To know who is making a request, the application uses a session. When you log in, the server gives your browser a small piece of data, often called a cookie or a token, and your browser sends it back with every request. It works like a wristband at an event: the staff at the door check the wristband, and once you are inside, the wristband is what proves you were let in. In this report, the requests were made with a valid sub-user session, so the server always knew exactly who was asking.

The problem found here is called Broken Object Level Authorization, or BOLA for short. Let us unpack that phrase. Authorization means deciding whether a person is allowed to do a particular thing. Object level means the decision has to be made about one specific record, the object, not just about the general area. Broken means the check was missing or wrong. So BOLA means: the application checked that you are a legitimate user, but it did not check whether you are allowed to touch this particular record.

An everyday comparison: imagine a hotel where every guest's key card opens the front door, the lift and the corridor on their floor. That is fine. Now imagine the key card also opens every other guest's room, because the lock only checks that the card belongs to the hotel and not which room it is for. The guest is a real, paying guest, and the door is a real door. Nothing was forged. The lock simply asked the wrong question. That is exactly what happened in Munshi: the server asked "does this person belong to this tenant?" and never asked "is this person allowed to delete this invoice?".

The researcher who found this is Vyom Nagpal. The report is dated 28 July 2026, and the remediation status recorded for the finding is Fixed. The weakness is associated with CWE-639, Authorization Bypass Through User-Controlled Key. CWE is a public catalogue of common software weaknesses, and CWE-639 describes exactly this pattern: the application lets the person making the request choose which record to act on, through an identifier in the request, and then trusts that choice without checking it.

The setup: two accounts and one invoice

To test this properly, the researcher needed two things: a tenant with an owner account, and a sub-user account inside that same tenant. The sub-user was a real, legitimate account. No login was bypassed, no session was forged, and no privileges were escalated at any point. The sub-user simply logged in normally, as any staff member would.

The invoice being targeted had to belong to the tenant owner, not to the sub-user. This is the heart of the whole test. If a sub-user deletes an invoice that belongs to them, nothing is wrong: they are allowed to manage their own records. The finding only means something if the invoice belongs to somebody else.

So the first thing the researcher did was confirm, from the invoice record itself, that the invoice was associated with the owner role. The published screenshot has the sensitive parts masked: record identifiers, personal information, company details, invoice metadata and financial values were all redacted, which is normal practice when sharing evidence publicly.

From the original on medium.com

Figure 1 shows that invoice record. You can see that it is owned by the tenant owner, and the sensitive fields are hidden. Without this step, the rest of the test would prove nothing, because there would be no way to say whose invoice was deleted.

The two API endpoints involved were:

Text
DELETE /api/invoice/{invoice_id}
POST /api/invoices/bulk-delete

Line by line:

  • DELETE /api/invoice/{invoice_id} is the request for deleting a single invoice. DELETE is the verb meaning remove. /api/invoice/ is the address of the invoice feature on the server. {invoice_id} is a placeholder for the actual identifier of the invoice, a unique code the application uses to tell one invoice apart from another. When a real request is sent, that placeholder is replaced by a real value, for example /api/invoice/12345. The important point is that the person sending the request chooses that value.
  • POST /api/invoices/bulk-delete is the request for deleting several invoices at once. POST is used because the request carries a body, a list of invoices to remove, rather than naming a single one in the address. /api/invoices/bulk-delete is the address of the bulk deletion feature.

How the researcher found it

The researcher was studying how Munshi decides who may do what, which is called its authorization model. While doing that, they noticed something inconsistent. The part of the application that manages users did have proper role-based access control, or RBAC.

RBAC is a simple idea: instead of giving every person individual permissions, you give them a role, and the role carries the permissions. A cashier role can take payments; a manager role can also change prices. In Munshi, the user management screens followed this model. But the invoice deletion endpoints did not seem to apply the same boundary. They appeared to rely on tenant membership alone.

That distinction is the reason the behaviour looked wrong. Three different questions exist, and they are not the same question:

  1. Authentication: who is making this request? The sub-user was authenticated correctly.
  2. Tenant membership: which organisation does this person belong to? The sub-user was in the same tenant as the owner.
  3. Object-level authorization: is this person allowed to delete this specific invoice? This is the question that was never asked.

A server that stops at question two treats membership as permission to operate on every record belonging to every user in the tenant. That is the over-broad evaluation that BOLA describes.

Step by step: what was done and why

Step 1: Confirm the target belongs to the owner

Before sending any request, the researcher checked the invoice record and confirmed it was owned by the tenant owner, not by the sub-user who would perform the deletion. This is what separates a real test from a user legitimately deleting an invoice they are allowed to manage. It also gives the test a clear expectation: if the application is working correctly, the deletion should be refused.

Step 2: Send the single-invoice DELETE as the sub-user

Using the authenticated sub-user account, the researcher sent a deletion request that pointed at the owner's invoice:

HTTP
DELETE /api/invoice/{invoice_id}

Line by line:

  • DELETE is the HTTP method, the verb that tells the server "remove this".
  • /api/invoice/{invoice_id} is the path. The {invoice_id} part is the user-controlled key: it identifies the object the request acts on, and the person sending the request decides what goes there. The server is responsible for checking that the caller is allowed to act on that object. Here, it did not.

The request was sent with the sub-user's normal session, so the server had no doubt about who was asking. The only question was whether it would check what that person was allowed to touch.

From the original on medium.com

Figure 2 shows the DELETE request as it was performed with the sub-user account.

Step 3: Observe the response and verify the record

The server returned an HTTP 200 response with a success result. HTTP status codes are the server's short way of saying how a request went. 200 means "OK, done". A refusal would normally look like 403, meaning "forbidden, you are not allowed", or 404, meaning "not found".

From the original on medium.com

Figure 3 shows that successful response.

A success message alone would not have proven that the record was really gone, so the researcher checked separately and confirmed that the owner's invoice had in fact been deleted. The finding rests on the complete chain: the target belonged to the tenant owner, the request came from a sub-user account, and the invoice was successfully removed.

Step 4: Repeat against bulk deletion

The same gap was documented in the bulk-deletion endpoint:

HTTP
POST /api/invoices/bulk-delete

Line by line:

  • POST is the method used to submit data to the server, here a list of invoices to delete.
  • /api/invoices/bulk-delete is the path of the bulk deletion feature.

Both single and bulk invoice deletion were affected. That matters because the same missing check can potentially be used against many financial records in one request, rather than one record at a time. The same missing check can potentially be used against many financial records in one request.

Why it happened: the root cause

The root cause was the absence of object-level ownership validation before invoice deletion. In plain words: before removing an invoice, the application never checked who owned it.

The assessment identified a helper, a piece of code used by several parts of the application, responsible for resolving accessible users. This helper expanded the operation's scope to all users within the tenant. The delete workflow then used that expanded scope when locating records to remove. Because the target invoice's ownership was not validated before deletion, an invoice belonging to the tenant owner could satisfy the database query and be deleted by an authenticated sub-user.

A database query is the instruction the application sends to its database, the store where all the records live, to find or change data. If the query says "find invoices belonging to anyone in this tenant", then the owner's invoice matches, and it gets deleted. If the query had said "find invoices belonging to this user", the owner's invoice would not have matched.

The existing defences did not stop it because they answered a different question. Authentication confirmed the sub-user was a valid account. Tenant scoping confirmed the invoice was inside the same organisation. RBAC existed, but the invoice deletion endpoints did not consistently apply the same boundary as user management, so the destructive operation ran without a per-object permission check.

What the impact is

An authenticated sub-user could delete invoices belonging to the tenant owner, through the application's normal API workflow, in both the single and bulk paths. Invoices are business records, not just rows in a database. Unauthorised deletion can affect accounting integrity, auditability and the reliability of records used by connected workflows. Where invoice changes are synchronised with downstream systems, unauthorised deletions may also affect those systems.

Auditability means being able to show, later, what happened and when. If records can vanish without authorisation, that becomes hard or impossible. The demonstrated issue was the deletion of the tenant owner's invoice by a sub-user. The broader consequences depend on how the application and its connected systems handle deleted records.

The fix

The remediation status recorded for the finding is Fixed. The fix has to be enforced by the backend, the server side, at the point where the invoice is modified or deleted. It cannot live only in the web page, because anyone can send requests directly to the API and skip the page entirely.

The report sets out what the fix should include:

  1. Enforce object-level authorization: check invoice ownership and the user's assigned permissions before deleting a record.
  2. Apply RBAC consistently: make single-delete and bulk-delete follow the same authorization policy as the rest of the application.
  3. Validate every item in bulk operations: do not let a bulk request bypass the ownership checks applied to individual invoices.
  4. Scope database operations correctly: restrict deletion queries to records the requesting user is authorised to manage.
  5. Add regression tests: verify that a sub-user can manage permitted invoices but cannot delete owner-owned or otherwise unauthorised records. A regression test is an automated check that runs again and again, so a bug that was fixed does not quietly come back later.
  6. Log and reject unauthorised operations: record denied cross-user deletion attempts without exposing sensitive record details in responses.

Testing should cover both single and bulk deletion, including mixed batches containing records the user can manage and records they cannot. An unauthorised invoice must not be deleted merely because other records in the request are accessible. Changing or obscuring the identifier would not fix the weakness; the ownership and authorisation decision must be enforced by the backend on every relevant operation.

Variants to test

Once you understand the pattern, you can look for it elsewhere.

  • Other destructive verbs on the same object type. Try update, archive or restore endpoints that take an invoice identifier, using a sub-user against an owner-owned record.
  • Bulk endpoints with mixed batches. Submit a batch containing one invoice the sub-user may manage and one owned by the owner.
  • Other tenant-scoped resources. Apply the same pattern to customers, payments, staff or settings objects that accept an identifier.
  • The accessible-users helper elsewhere. Look for other workflows that resolve "accessible users" and then widen a query to the whole tenant.
  • Cross-tenant rather than intra-tenant. Swap in an identifier from a different tenant while authenticated in your own.
  • Read paths on the same object. Request the owner's invoice by identifier as a sub-user.

Vulnerability reference

  • Vulnerability: Broken Object Level Authorization in Invoice Deletion
  • Product: Munshi web application
  • Affected host: https://munshi.petpooja.com
  • Affected endpoints: DELETE /api/invoice/{invoice_id} and POST /api/invoices/bulk-delete
  • Vulnerability class: Broken Object Level Authorization (BOLA)
  • Primary CWE: CWE-639, Authorization Bypass Through User-Controlled Key
  • Report date: 28 July 2026
  • Remediation status: Fixed
  • CVE ID: to be assigned

Glossary

  • API: the set of addresses and rules a program uses to ask another program, usually a server, to do something.
  • API request: a message sent to a server asking it to perform an action, such as fetching or deleting a record.
  • API response: the server's answer to a request, including a status code and usually some data.
  • Authentication: proving who you are, for example by logging in.
  • Authorization: deciding whether an identified person is allowed to do a particular thing.
  • Backend: the server-side part of an application, where the real checks and data handling happen.
  • BOLA (Broken Object Level Authorization): a flaw where the application checks that you are a valid user but not whether you may act on the specific record you named.
  • Bulk deletion: deleting several records in one request instead of one at a time.
  • Cookie: a small piece of data a website stores in your browser, often used to remember that you are logged in.
  • CVE ID: a public identifier assigned to a known security vulnerability.
  • CWE: a public catalogue of common software weakness types.
  • CWE-639: the catalogue entry for authorization bypass through a user-controlled key, where the requester chooses which record to act on and the server trusts that choice.
  • Database: the store where an application keeps its records.
  • Database query: the instruction sent to a database to find or change data.
  • DELETE: the HTTP method meaning remove.
  • Endpoint: one specific address in an API that performs one specific action.
  • GET: the HTTP method meaning give me something.
  • Helper: a piece of code reused by several parts of an application to do a common job.
  • HTTP 200: a status code meaning the request succeeded.
  • HTTP 403: a status code meaning the request was understood but refused because you are not allowed.
  • HTTP 404: a status code meaning the requested thing was not found.
  • HTTP method: the verb in a request, such as GET, POST or DELETE, saying what kind of action is wanted.
  • HTTP status code: a number in the response saying how the request went, such as 200, 403 or 404.
  • Identifier (ID): a unique code used to tell one record apart from another.
  • Invoice: a bill a business sends to a customer, and the record of money owed or paid.
  • Object: one specific record in an application, such as a single invoice.
  • Object-level authorization: checking whether a user may act on one particular record, not just on the general area it lives in.
  • Path: the part of a request address that points at a feature or record, such as /api/invoice/{invoice_id}.
  • POST: the HTTP method used to submit data to the server, for example a list of invoices to delete.
  • RBAC (role-based access control): giving people roles, where each role carries a set of permissions.
  • Redacted: hidden or masked, usually to protect sensitive information before publishing.
  • Regression test: an automated check that runs repeatedly so a fixed bug does not return unnoticed.
  • Request body: the part of a request that carries data, such as a list of records.
  • Session: the state of being logged in, usually kept alive by a cookie or token sent with each request.
  • Sub-user: a staff account inside a tenant, with fewer rights than the owner.
  • Tenant: one organisation's separate space in a multi-user application, holding that organisation's data.
  • Tenant membership: belonging to a tenant, which says which organisation you are part of but not what you may do.
  • Token: a piece of data, similar to a cookie, that proves you are logged in when sent with a request.
  • User-controlled key: an identifier in a request that the person sending the request chooses, which the server must not trust without checking.

More by TheWildEye

View all

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