Summary
Dolibarr contains an improper authorization flaw in the payments REST API delete endpoint. An authenticated attacker who has invoice-deletion rights may delete payment records without also holding the intended payment-issuance permission, potentially corrupting financial records and accounting exports.
Affected context
The issue occurs in Dolibarr deployments where the payments REST API is enabled and users can access the payment deletion endpoint. The endpoint may authorize deletion using invoice-deletion privileges without separately enforcing the permission intended to control payment issuance or management. The risk is greatest when users with limited accounting responsibilities can access invoices and their associated payment records.
Exploit preconditions
- Attack surface: Payments REST API delete endpoint
- Required access: An authenticated account with invoice-deletion rights
- Trigger point: A request to delete a payment record
- Why exploitation is possible: The endpoint checks an unrelated or
insufficient permission and does not consistently enforce the intended
payment-issuance authorization requirement
Why this happens
The underlying bug is an authorization mismatch in which a sensitive payment deletion operation relies on an invoice-deletion permission rather than the permission governing payment records. This creates a confused-deputy condition: a user authorized to perform one invoice-related action is treated as authorized for a separate, higher-impact financial operation. The behavior maps to CWE-863, Improper Authorization, because access control enforcement does not correctly match the requested resource and action.
Potential impact
- Attackers may permanently delete legitimate payment records.
- Paid amounts on invoices may be reduced or removed from financial views.
- Accounting exports may omit payment entries.
- Financial reporting and reconciliation may become inaccurate.
- Organizations could face audit issues, operational disruption, or fraud
investigation costs.
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the operation and
resource level rather than inferring access from related invoice permissions.
Common defensive patterns include:
- Require a dedicated payment-management permission for payment deletion.
- Apply server-side authorization checks to every REST API operation.
- Ensure permission checks distinguish invoice actions from payment actions.
- Use deny-by-default behavior for destructive financial operations.
- Limit payment-deletion privileges to narrowly defined accounting roles.
- Add confirmation, audit logging, and review controls for destructive changes.
- Reconcile invoice totals and accounting exports against authoritative records.
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and authorization reviews that compare endpoint actions with
the permissions they enforce.
- Code review checks for destructive endpoints protected only by permissions
associated with related resources.
- API tests that exercise each endpoint with combinations of authorized and
unauthorized roles.
- Policy enforcement requiring explicit authorization for delete operations
involving financial records.
- Audit-log monitoring for payment deletions by users who lack dedicated
payment-management privileges.
- Automated security review tools that identify inconsistent access-control
checks.

