Soft-Deleted, Still Editable: BOLA in Munshi’s Invoice API
The invoice update endpoint did not check whether the target invoice was soft-deleted or whether the authenticated user owned it. An attacker with a valid account and an invoice identifier could overwrite financial data on archived invoices.
Published on medium.com
Cybersecurity
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.
Context
Munshi is an invoicing product. Its invoice feature lets an authenticated user work with invoices, and the backend exposes an endpoint that stores the data extracted from an invoice:
PUT /api/invoice/{invoice_id}/extracted-data
That extracted data is not cosmetic. It holds the seller and buyer information, the invoice identifiers, the product information and the invoice totals, plus room for custom metadata. In other words, it is the financial substance of the record.
Munshi archives invoices using soft deletion. Rather than removing the row, it sets a flag, is_deleted = 1, and the invoice drops out of the normal application workflows. The expectation that follows from that design is simple: an archived invoice should no longer be mutable through ordinary update routes.
Setup
The testing needed very little. The prerequisites were:
- A valid authenticated Munshi account.
- The identifier of an invoice.
- A target invoice that had already been soft deleted.
No special role, tooling or version is described. Database verification afterwards confirmed what had actually been persisted.
Finding it
The starting point was a review of how invoice deletion and invoice updates were handled. Soft deletion is a normal pattern: the record is retained for history but hidden from normal workflows, and in Munshi that state is represented by the is_deleted flag.
The update endpoint did not validate that state before processing a request. It accepted an extracted_data object supplied by the client even when the target invoice had already been archived. The record was logically deleted, yet its financial data was still mutable through the API.
A second gap sat in the same workflow. The endpoint did not enforce the expected object-level authorization checks before writing the supplied data. The missing checks were:
- invoice ownership verification;
- role-based authorization;
- explicit enforcement of the
invoice_editpermission; - prevention of updates to invoices whose lifecycle state was already marked as deleted.
So the endpoint took an invoice identifier and processed an update without establishing that the caller was authorised to modify that specific object. That is an object-level authorization failure, commonly called Broken Object Level Authorization (BOLA) or Insecure Direct Object Reference (IDOR), and the missing lifecycle validation made it worse.
Exploitation
Step 1: pick a soft-deleted invoice
With an authenticated account and the identifier of an invoice that had already been soft deleted, the target was ready. The deleted state was the whole point: the invoice had been removed from the normal workflow, so nothing should have been writing to it.
Step 2: send the update
I submitted a PUT request to the invoice extraction endpoint with modified extracted_data. The server accepted the request instead of rejecting it on the basis of ownership and deleted state.
Step 3: read the response
The API responded with HTTP/1.1 200 OK and a success response:

Figure 1: The invoice update endpoint returned a successful response to the modification request.
A successful HTTP response on its own would not have been enough to establish impact, so the stored data had to be checked as well.
Step 4: verify persistence in the database
Database verification confirmed that the invoice still had is_deleted = 1 after the update. The deletion state had not changed, but the underlying extracted data had.
During testing I was able to modify several business-critical fields:
- seller information;
- buyer information;
- invoice identifiers;
- product information;
- invoice totals.
Additional custom metadata could also be inserted into the record. The before-and-after comparison shows the stored invoice data changing while the invoice remained soft deleted:

Figure 2: Before-and-after database view showing changes to extracted invoice data on a soft-deleted record.
The update was not limited to a harmless display field. The affected data covered the parties involved, the identity of the invoice, the products and the financial summary.
The modified record also contained attacker-controlled metadata. Part of the resulting extracted-data structure looks like this:

Figure 3: The resulting invoice data includes modified invoice fields and additional metadata.
The important detail is that the invoice remained marked as deleted throughout. The API allowed the contents of an archived financial record to be changed without changing its deletion state.
Root cause
The update endpoint performed no lifecycle check on the target invoice and no object-level authorization check on the caller. Concretely, it did not verify ownership, did not apply role-based authorization, and did not enforce the invoice_edit permission before writing. It also accepted a client-controlled extracted_data object.
Hiding a deleted record from the normal interface is not a defence when another API endpoint can still modify it. The deleted state existed in the data model, but the write path never consulted it, so the flag protected nothing at the API layer.
Impact
An authenticated user with access to a target invoice identifier could modify records that should have been protected by ownership, permission and lifecycle checks. The affected data included the details describing the parties, identifying the invoice, representing the products and calculating the financial summary, plus custom metadata.
Invoices are not ordinary user-generated documents. Organisations may rely on them for accounting, reconciliation, reporting and audit processes, so overwriting historical invoice data can undermine the integrity and reliability of those records. Depending on how the application uses the modified fields, the consequences may include:
- incorrect seller or buyer details;
- altered invoice references;
- changed product entries;
- manipulated totals;
- unreliable historical records.
The issue also affects auditability. A record marked as deleted should not remain silently editable through a separate API route. If a correction or restoration workflow is needed, it should be explicit, permission-controlled and auditable.
The researcher's reference classifies the issue as BOLA / IDOR with Medium severity and CVSS 6. The CVE ID was still to be assigned.
Fix
The report sets out what the backend should do rather than describing a deployed change:
- Reject update requests for invoices where
is_deleted = 1. This check must happen on the server before any data is written, not only in the user interface. - On every update, verify that the authenticated user owns the target invoice or holds the specific permission required to modify it. The
invoice_editpermission should be enforced explicitly, alongside the application's role-based authorization rules. - Treat archived invoices as immutable through ordinary update routes. Restoration or amendment should go through a separate, controlled process with a clear audit trail.
- Restrict updates to approved invoice fields instead of accepting an unrestricted client-controlled
extracted_dataobject. Validate each field server-side before persistence, and record every modification with the responsible user and timestamp.
Variants to test
- Other soft-delete flags on other write routes. Look for endpoints that update or delete child objects of a parent record and check whether they consult the parent's deleted or archived state. A positive result is a successful write to a record whose archived flag remains set afterwards.
- Identifier substitution across accounts. Take an object identifier belonging to a second account and replay an update with your own session. A positive result is a
200plus a persisted change, rather than a403or404. - Permission-gated fields. Target fields that the UI only exposes to privileged roles, such as totals or seller details, and send them directly. A positive result is that the server persists them for a user without the corresponding permission.
- Unrestricted object bodies. Send extra keys inside the accepted object, as was possible here with custom metadata. A positive result is that unknown keys are stored and later returned by read endpoints.
- Lifecycle transitions. Try updates against records in other terminal states, such as cancelled, paid or locked, and see whether the same write path still accepts changes.
Closing thoughts
The invoice could be deleted, and the application did mark it as deleted. The problem was that deletion did not protect the record from further modification. An invoice remained marked as is_deleted = 1, yet its seller and buyer details, invoice identifiers, product information, totals and additional metadata could still be overwritten through the update API. Object-level authorization and lifecycle validation have to be enforced at the backend; hiding a deleted record from the interface is not enough when another endpoint can still write to it.
What happened, in plain words
Munshi is an invoicing product: software that businesses use to create and keep invoices. An invoice is the document a seller sends to a buyer saying what was sold and how much is owed. Inside Munshi, each invoice is stored as a record in a database, and the important parts of that record (who sold, who bought, what was sold, what the totals are) are kept in a bundle of data called the extracted data.
Munshi lets a user mark an invoice as deleted. It does not actually erase the record. Instead it sets a small marker on the record, a flag called is_deleted, to the value 1, which means "this one is deleted". The invoice then disappears from the normal screens. This approach is called soft deletion, and it is common: companies keep old records for history and accounting but hide them from day-to-day use.
The reasonable expectation is that once an invoice is marked deleted, nobody can change it any more through the normal update route. That expectation was wrong. The part of Munshi's backend that saves changes to an invoice's extracted data never looked at the deleted flag, and it never properly checked whether the person making the request was allowed to touch that particular invoice. So an authenticated user could send a change for an invoice that had already been marked deleted, and the server would accept it and save it.
This kind of mistake has a name: Broken Object Level Authorization, or BOLA, also known as Insecure Direct Object Reference, or IDOR. Both names describe the same failure: the server accepts an identifier for a specific object (here, an invoice) and acts on it without checking that the caller is entitled to that object. The missing check on the deleted state made it worse, because even records that had been taken out of the normal workflow stayed editable.
The researcher who found this is Vyom Nagpal, writing as TheWildEye. The reference at the end of the report classifies the issue as BOLA / IDOR, rates it Medium severity, gives the CVSS vector CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N, and notes that the CVE ID was still to be assigned. The testing date recorded there is 7 July 2026.
Some background you need first
What an API is
When you use a web application, your browser shows you pages with buttons and forms. Behind those pages, the browser talks to the company's servers by sending requests and receiving responses. An API (Application Programming Interface) is the set of addresses and rules for those conversations. Think of a restaurant: the menu and the waiter are the API. You do not walk into the kitchen yourself; you tell the waiter what you want, the waiter carries the order to the kitchen, and the kitchen sends back a plate. The API is the waiter and the menu, and the kitchen is the server and its database.
Each API address is called an endpoint. An endpoint is defined by two things: the path (the address, such as /api/invoice/...) and the method (a verb saying what kind of action you want). The methods that matter here are:
GET: please give me something (read).PUT: please replace something with the data I am sending (update).POST: please create something (or submit data).DELETE: please remove something.
So PUT /api/invoice/{invoice_id}/extracted-data means: "replace the extracted data of the invoice whose identifier is {invoice_id}". The curly braces are a placeholder: in a real request, {invoice_id} is replaced by an actual number or code that identifies one specific invoice.
What authentication is, and what a session is
Authentication means proving who you are. When you log in with a username and password, the server checks them and then needs a way to recognise you on your next request, because the web does not remember anything between requests by itself. It does this by giving your browser a small piece of data to carry around, usually a session cookie or a token. On every later request, your browser automatically attaches that cookie or token, and the server reads it to know which account is asking.
A cookie is just a small labelled value stored by your browser for a particular website. A token is similar: a string that stands for your logged-in session. Both are secrets. If someone else gets yours, they can act as you. In this article, any such value would be replaced with [redacted].
What authorization is, and what object-level authorization means
Authentication answers "who are you?". Authorization answers "are you allowed to do this?". These are different questions, and a system can get the first right and the second wrong.
Authorization comes in layers. At the broadest level, a role check might say "only users with the accountant role may edit invoices at all". At a finer level, a permission check might say "this user holds the invoice_edit permission". At the finest level, an object-level check asks about one specific record: "is this particular invoice yours, or have you been explicitly given the right to edit it?".
Object-level authorization is the check that ties a request to a specific record. If a server skips it, any logged-in user who can guess or obtain the identifier of someone else's record can act on that record. That is BOLA / IDOR.
What soft deletion is
Hard deletion means the record is removed from the database. Soft deletion means the record stays, but a flag is set to mark it as deleted. In Munshi that flag is is_deleted, and the value 1 means deleted. The application then filters such records out of normal screens and workflows. The benefit is that history is preserved. The risk is that the record still physically exists, so any code path that forgets to check the flag can still read or write it.
What the invoice feature stores
The extracted data of an invoice is not decoration. It holds:
- seller information (who issued the invoice);
- buyer information (who must pay);
- invoice identifiers (the invoice's own reference numbers);
- product information (what was sold);
- invoice totals (the money amounts);
- room for custom metadata (extra fields the client can attach).
In other words, it is the financial substance of the record. Changing it changes what the invoice says.
Setting up the test
The testing needed very little. The prerequisites were:
- A valid authenticated Munshi account.
- The identifier of an invoice.
- A target invoice that had already been soft deleted.
Why each one: the account is needed because the endpoint sits behind login, so a request without a valid session would simply be refused at the door. The identifier is needed because the endpoint addresses one specific invoice by its {invoice_id}; without it there is nothing to point at. The soft-deleted invoice is the whole point of the test: the question was whether a record that had been taken out of the normal workflow could still be written to.
No special role, tooling or version is described in the report. The work was done against the live invoice functionality, and database verification afterwards confirmed what had actually been saved.
Finding it
The starting point was a review of how invoice deletion and invoice updates were handled. Reading how a feature is built is often how these gaps are spotted: you compare what the design promises with what the code actually enforces.
Soft deletion is a normal pattern, and in Munshi the deleted state is represented by the is_deleted flag. The update endpoint did not validate that state before processing a request. It accepted an extracted_data object supplied by the client even when the target invoice had already been archived. The record was logically deleted, yet its financial data was still mutable through the API.
A second gap sat in the same workflow. The endpoint did not enforce the expected object-level authorization checks before writing the supplied data. The missing checks were:
- invoice ownership verification (is this invoice yours?);
- role-based authorization (does your role allow this kind of action?);
- explicit enforcement of the
invoice_editpermission (do you hold the specific right to edit invoices?); - prevention of updates to invoices whose lifecycle state was already marked as deleted (is this record still active?).
So the endpoint took an invoice identifier and processed an update without establishing that the caller was authorised to modify that specific object. That is an object-level authorization failure, commonly called Broken Object Level Authorization (BOLA) or Insecure Direct Object Reference (IDOR), and the missing lifecycle validation made it worse.
Exploitation
Step 1: pick a soft-deleted invoice
With an authenticated account and the identifier of an invoice that had already been soft deleted, the target was ready. The deleted state was the whole point: the invoice had been removed from the normal workflow, so nothing should have been writing to it. Choosing a deleted record makes the result unambiguous. If the write succeeds, the server clearly ignored the flag.
Step 2: send the update
I submitted a PUT request to the invoice extraction endpoint with modified extracted_data. The server accepted the request instead of rejecting it on the basis of ownership and deleted state.
The endpoint in question is:
PUT /api/invoice/{invoice_id}/extracted-data
Line by line:
PUTis the HTTP method meaning "replace the thing at this address with what I am sending"./api/invoice/is the path that leads to the invoice part of the API.{invoice_id}is the placeholder for the identifier of the specific invoice being targeted. In a real request it is replaced by an actual value./extracted-datanarrows the address to the extracted data of that invoice, as opposed to, say, its status or its attachments.
So the request says: "replace the extracted data of this invoice with the data in my request body". The request body is the part of an HTTP request that carries the data being sent, as opposed to the headers, which carry metadata such as the session cookie. The report does not reproduce the exact body that was sent; it describes it as an extracted_data object with modified values.
Step 3: read the response
The API responded with HTTP/1.1 200 OK and a success response:

Figure 1: The invoice update endpoint returned a successful response to the modification request.
What HTTP/1.1 200 OK means: HTTP is the language browsers and servers use to talk. Every response starts with a status line. HTTP/1.1 is the version of the protocol, and 200 OK is the status code meaning "the request succeeded". Status codes are grouped by their first digit: 2xx means success, 4xx means the client did something the server refused (for example 403 Forbidden for "you are not allowed" or 404 Not Found for "no such thing"), and 5xx means the server itself failed. A correct server should have answered this request with a refusal, not a 200.
A successful HTTP response on its own would not have been enough to establish impact, so the stored data had to be checked as well. A 200 only says the server accepted the request; it does not prove the change was actually written to the database. That is why the next step exists.
Step 4: verify persistence in the database
Database verification confirmed that the invoice still had is_deleted = 1 after the update. The deletion state had not changed, but the underlying extracted data had.
During testing I was able to modify several business-critical fields:
- seller information;
- buyer information;
- invoice identifiers;
- product information;
- invoice totals.
Additional custom metadata could also be inserted into the record. The before-and-after comparison shows the stored invoice data changing while the invoice remained soft deleted:

Figure 2: Before-and-after database view showing changes to extracted invoice data on a soft-deleted record.
The update was not limited to a harmless display field. The affected data covered the parties involved, the identity of the invoice, the products and the financial summary. That distinction matters: a cosmetic field would be an embarrassment, but seller, buyer, identifiers, products and totals are what an accountant or an auditor would rely on.
The modified record also contained attacker-controlled metadata. "Attacker-controlled" means the values came from the person sending the request rather than from anything the server decided. Part of the resulting extracted-data structure looks like this:

Figure 3: The resulting invoice data includes modified invoice fields and additional metadata.
The important detail is that the invoice remained marked as deleted throughout. The API allowed the contents of an archived financial record to be changed without changing its deletion state. In other words, the flag that was supposed to protect the record was still set, and it protected nothing.
Root cause
The update endpoint performed no lifecycle check on the target invoice and no object-level authorization check on the caller. "Lifecycle" here means the stages a record goes through: created, active, perhaps paid or cancelled, and finally deleted or archived. A lifecycle check asks "what stage is this record in, and is writing allowed in that stage?".
Concretely, the endpoint did not verify ownership, did not apply role-based authorization, and did not enforce the invoice_edit permission before writing. It also accepted a client-controlled extracted_data object. "Unrestricted" means the server did not have a fixed list of fields it would accept; it took the object as given.
Hiding a deleted record from the normal interface is not a defence when another API endpoint can still modify it. The deleted state existed in the data model, but the write path never consulted it, so the flag protected nothing at the API layer. A useful comparison: putting a "do not touch" sign on a box is pointless if the door to the room has no lock.
Impact
An authenticated user with access to a target invoice identifier could modify records that should have been protected by ownership, permission and lifecycle checks. The affected data included the details describing the parties, identifying the invoice, representing the products and calculating the financial summary, plus custom metadata.
Invoices are not ordinary user-generated documents. Organisations may rely on them for accounting, reconciliation, reporting and audit processes, so overwriting historical invoice data can undermine the integrity and reliability of those records. "Integrity" here means the guarantee that data is what it claims to be and has not been quietly changed. Depending on how the application uses the modified fields, the consequences may include:
- incorrect seller or buyer details;
- altered invoice references;
- changed product entries;
- manipulated totals;
- unreliable historical records.
The issue also affects auditability. Auditing means being able to reconstruct who did what and when. A record marked as deleted should not remain silently editable through a separate API route. If a correction or restoration workflow is needed, it should be explicit, permission-controlled and auditable.
The researcher's reference classifies the issue as BOLA / IDOR with Medium severity and CVSS 6. CVSS is a standard scoring system for describing how serious a vulnerability is; the vector is a compact string of measurements. The CVE ID was still to be assigned. A CVE is a public catalogue number given to a known vulnerability so that people can refer to it unambiguously.
Fix
The report sets out what the backend should do rather than describing a deployed change:
- Reject update requests for invoices where
is_deleted = 1. This check must happen on the server before any data is written, not only in the user interface. A check in the browser is a convenience for honest users; anyone can send a request directly and skip the browser entirely. - On every update, verify that the authenticated user owns the target invoice or holds the specific permission required to modify it. The
invoice_editpermission should be enforced explicitly, alongside the application's role-based authorization rules. - Treat archived invoices as immutable through ordinary update routes. "Immutable" means it cannot be changed. Restoration or amendment should go through a separate, controlled process with a clear audit trail, meaning a record of who did what and when.
- Restrict updates to approved invoice fields instead of accepting an unrestricted client-controlled
extracted_dataobject. Validate each field server-side before persistence, and record every modification with the responsible user and timestamp.
Variants to test
These are the follow-up ideas the report lists, for anyone testing a similar application:
- Other soft-delete flags on other write routes. Look for endpoints that update or delete child objects of a parent record and check whether they consult the parent's deleted or archived state. A positive result is a successful write to a record whose archived flag remains set afterwards.
- Identifier substitution across accounts. Take an object identifier belonging to a second account and replay an update with your own session. A positive result is a
200plus a persisted change, rather than a403or404. - Permission-gated fields. Target fields that the UI only exposes to privileged roles, such as totals or seller details, and send them directly. A positive result is that the server persists them for a user without the corresponding permission.
- Unrestricted object bodies. Send extra keys inside the accepted object, as was possible here with custom metadata. A positive result is that unknown keys are stored and later returned by read endpoints.
- Lifecycle transitions. Try updates against records in other terminal states, such as cancelled, paid or locked, and see whether the same write path still accepts changes.
Closing thoughts
The invoice could be deleted, and the application did mark it as deleted. The problem was that deletion did not protect the record from further modification. An invoice remained marked as is_deleted = 1, yet its seller and buyer details, invoice identifiers, product information, totals and additional metadata could still be overwritten through the update API. Object-level authorization and lifecycle validation have to be enforced at the backend; hiding a deleted record from the interface is not enough when another endpoint can still write to it.
Glossary
- API: the set of addresses and rules a program uses to talk to a server; the waiter between your browser and the kitchen.
- Endpoint: one address plus one method in an API, such as
PUT /api/invoice/{invoice_id}/extracted-data. - HTTP: the language browsers and servers use to exchange requests and responses.
- HTTP method: the verb in a request, such as
GET(read),PUT(replace),POST(create or submit) orDELETE(remove). - Status code: the three-digit number at the start of an HTTP response;
200means success,403means forbidden,404means not found. - Request body: the part of an HTTP request that carries the data being sent, as opposed to the headers.
- Header: metadata attached to an HTTP request or response, such as the session cookie.
- Cookie: a small value a website stores in your browser and your browser sends back on later requests, often used to identify your session.
- Token: a string that stands for a logged-in session or an identity, sent with requests instead of or alongside a cookie.
- Authentication: proving who you are, usually by logging in.
- Authorization: deciding whether an authenticated user is allowed to perform a particular action.
- Object-level authorization: the check that a user is allowed to act on one specific record, not just on records in general.
- BOLA (Broken Object Level Authorization): a vulnerability where the server acts on a specific object without checking that the caller is entitled to it.
- IDOR (Insecure Direct Object Reference): another name for the same failure, emphasising that the request refers directly to an object by its identifier.
- Permission: a specific right granted to a user, such as
invoice_edit. - Role-based authorization: granting rights according to a user's role, such as accountant or administrator.
- Soft deletion: marking a record as deleted with a flag instead of removing it from the database.
- Flag: a stored value that records a state, such as
is_deleted = 1. - Lifecycle: the stages a record passes through, such as active, paid, cancelled or deleted.
- Immutable: cannot be changed.
- Persistence: whether a change was actually saved in the database, as opposed to merely accepted in a response.
- Integrity: the guarantee that data is accurate and has not been quietly altered.
- Auditability: being able to reconstruct who changed what and when.
- Audit trail: the record that makes auditability possible.
- Metadata: extra descriptive data attached to a record, here custom fields supplied by the client.
- CVSS: a standard scoring system for describing the severity of a vulnerability; its vector is a compact string of measurements.
- CVE: a public catalogue number assigned to a known vulnerability.
- Medium severity: the severity rating the researcher's reference gives this issue.