Summary
A missing authorization check in ERPNext Payment Requests may let an authenticated Accounts User access source-document content they are not otherwise permitted to view. By creating a Payment Request that references another company's document and sending its loaded content to an address they choose, a user could disclose that information.
Affected context
The issue is described in Frappe ERPNext 6.18.0 before 15.124.0 and 16.x before 16.52.0. It occurs in Payment Request handling when a request can reference a source document without adequately enforcing the current user's permissions, and the loaded content can be emailed to a user-selected address.
Exploit preconditions
- Attack surface: Payment Request creation and email functionality in the ERPNext application
- Required access: An authenticated account with the Accounts User role
- Trigger point: Creating a Payment Request through the generic record interface that references a document the user cannot access, then sending its loaded content
- Why exploitation is possible: Authorization may not be checked for the referenced source document before its contents are loaded and made available for email
Why this happens
The underlying issue is a missing authorization check, mapped to CWE-862: Missing Authorization. The application allows a user to select or reference a source document without consistently verifying that the user is permitted to read it. A valid role for creating Payment Requests should not, by itself, grant access to every document that can be referenced.
Potential impact
- An authenticated user may read source-document content beyond their assigned permissions.
- Sensitive information belonging to another company could be disclosed.
- Content could be sent to an unintended or attacker-controlled email address.
- The incident could undermine confidentiality and trust in role-based access controls.
General mitigation guidance
Defensive patterns focus on enforcing authorization at the point where referenced records are resolved and used.
- Check the current user's read permissions for every referenced document on the server side.
- Apply the same authorization checks when loading content for display, processing, or email delivery.
- Treat record identifiers and client-submitted references as untrusted; do not infer permission from the ability to create a related record.
- Restrict email recipients and included content according to the user's privileges and organizational boundaries.
- Use least-privilege roles and secure-by-default denial when authorization cannot be established.
How teams detect issues like this
- Review Payment Request and related-record code paths for server-side permission checks on every referenced document.
- Use static analysis or code review rules to flag record lookups and email operations that do not enforce authorization.
- Test access-control boundaries with users who can create Payment Requests but lack permission to read referenced records.
- Monitor audit logs for Payment Requests that reference inaccessible or cross-company documents, and for unusual email recipients.
- Enforce policies requiring authorization checks before sensitive records are loaded or exported; automated review tools may help identify gaps.

