November 16, 2026
Soft-Deleted, Still Editable: BOLA in Munshi’s Invoice API
Missing ownership and invoice-lifecycle checks allowed an authenticated user to overwrite financial data even after an invoice had been…

By TheWildEye
5 min read
Missing ownership and invoice-lifecycle checks allowed an authenticated user to overwrite financial data even after an invoice had been soft deleted.
"Deleting a record should stop it from being changed. In this case, the API never got that message."
While testing Munshi's invoice functionality, I found that marking an invoice as deleted did not prevent its data from being modified through the backend API.
The application uses soft deletion to archive invoices. Instead of permanently removing a record, it marks the invoice with is_deleted = 1. That state should prevent the invoice from continuing through normal update workflows.
However, the invoice update endpoint did not check whether the target invoice had been deleted. It also did not properly verify whether the authenticated user owned that invoice or had explicit permission to edit it.
The affected endpoint was:
PUT /api/invoice/{invoice_id}/extracted-data
By submitting an update request for an invoice that had already been soft deleted, I was able to replace its extracted data. The server returned a successful response, and database verification confirmed that the modified values were persisted while the invoice remained marked as deleted.
The Invoice Was Deleted, But the API Still Accepted Changes
The issue became apparent when I reviewed how invoice deletion and invoice updates were handled.
Soft deletion is commonly used when an application needs to retain historical records without showing them in normal application workflows. In Munshi, the deleted state was represented by the is_deleted flag.
The problem was that the update endpoint did not validate this state before processing a request. It continued to accept an extracted_data object supplied by the client, even when the target invoice had already been archived.
This meant that the record was logically deleted, but its financial data was still mutable through the API.
Missing Ownership and Permission Checks
There was another problem with the same update workflow. The endpoint did not enforce the expected object-level authorization checks before writing the supplied data.
The missing checks included invoice ownership verification, role-based authorization, and explicit enforcement of the invoice_edit permission. The API also did not prevent updates to invoices whose lifecycle state was already marked as deleted.
For testing, the prerequisites were a valid authenticated Munshi account, the identifier of an invoice, and a target invoice that had already been soft deleted.
I then submitted a PUT request to the invoice extraction endpoint with modified extracted_data. The server accepted the request instead of rejecting the update based on the invoice's ownership and deleted state.
The Server Returned a Successful 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 alone would not have been enough to establish the impact, so I checked the stored invoice data as well.
The Deleted Invoice's Financial Data Was Overwritten
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, including seller information, buyer information, invoice identifiers, product information and invoice totals. Additional custom metadata could also be inserted into the record.
The before-and-after comparison below shows the stored invoice data changing even though 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 included details used to describe the parties involved, identify the invoice, represent the products and calculate the financial summary.
The modified record also contained attacker-controlled metadata. The screenshot below shows part of the resulting extracted-data structure.
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 this process. The API allowed the contents of an archived financial record to be changed without changing its deletion state.
Why This Is a BOLA / IDOR Vulnerability
The endpoint accepted an invoice identifier and processed updates without sufficiently establishing that the authenticated caller was authorized to modify that specific object.
This is an object-level authorization failure, commonly described as Broken Object Level Authorization (BOLA) or Insecure Direct Object Reference (IDOR).
The missing lifecycle validation made the issue worse. Even if an invoice had already been removed from the normal workflow through soft deletion, the same update route continued to accept changes.
The combination meant that an authenticated user with access to a target invoice identifier could modify records that should have been protected by ownership, permission and lifecycle checks.
Why It Matters
Invoices are not ordinary user-generated documents. They contain financial and business records that organisations may rely on for accounting, reconciliation, reporting and audit processes.
Allowing an authenticated user to overwrite 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 and unreliable historical records.
The issue also affects auditability. A record that is marked as deleted should not remain silently editable through a separate API route. If a correction or restoration workflow is required, it should be explicit, permission-controlled and auditable.
What Needs to Change
The backend should 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.
Every update should also verify that the authenticated user owns the target invoice or has the specific permission required to modify it. In this case, the invoice_edit permission should be enforced explicitly, alongside the application's role-based authorization rules.
Archived invoices should be treated as immutable through ordinary update routes. If the business needs to restore or amend an archived invoice, that should happen through a separate, controlled process with a clear audit trail.
The API should also restrict updates to approved invoice fields instead of accepting an unrestricted client-controlled extracted_data object. Each field should be validated server-side before persistence, and every modification should be recorded with the responsible user and timestamp.
Closing Thoughts
The issue was not that the invoice could not be deleted. The application did mark it as deleted. The problem was that deletion did not actually 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.
This is exactly why object-level authorization and lifecycle validation need to be enforced at the backend. Hiding a deleted record from the normal interface is not enough when another API endpoint can still modify it.
Researcher: Vyom Nagpal
Research Reference
- Product: Munshi
- Affected functionality: Invoice update / extracted data
- Endpoint:
PUT /api/invoice/{invoice_id}/extracted-data - Issue: Missing object-level authorization and deleted-state validation
- Classification: BOLA / IDOR
- Severity: Medium
- CVSS: 6 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
- CVE ID: To be Assigned