Summary
An Accounts module endpoint in ERPNext can return tax and charge rows without checking whether the requester has permission to access the associated document. An authenticated user, including a portal user or a user with no roles, may be able to read tax data from arbitrary document types and records.
Affected context
The issue occurs in an ERPNext Accounts module endpoint that returns taxes and charges for documents. It becomes risky when the endpoint accepts document types and record identifiers but does not enforce the requesting user's permissions for those records.
Exploit preconditions
- Attack surface: The Accounts module endpoint that returns document taxes and charges
- Required access: An authenticated account; the description includes portal users and users with no roles
- Trigger point: A request for tax rows associated with a document type and record
- Why exploitation is possible: The endpoint does not check record permissions before returning the data
Why this happens
The endpoint retrieves and returns document-related data without verifying that the requester is authorized to access the corresponding record. This is a missing access-control check, mapping to CWE-862: Missing Authorization. Accepting a document type and record identifier must not substitute for an authorization decision.
Potential impact
- Authenticated users may read tax and charge rows outside their permitted scope
- Sensitive financial or business information could be disclosed
- Repeated or broad requests could expose data across multiple document types or records
General mitigation guidance
Mitigation generally centers on enforcing authorization at the point where protected data is accessed.
- Check the current user's permissions for each requested document and record before returning related data
- Apply the same authorization policy across document types, including portal and role-less accounts
- Use secure-by-default access controls and deny requests when permission checks fail or cannot be completed
- Reduce reliance on caller-supplied identifiers as evidence of access rights
- Limit returned fields to the minimum necessary and run application services with least privilege
How teams detect issues like this
- Review endpoints that accept document types or record identifiers and return associated data
- Use static analysis or code review checks to identify data access paths that lack authorization checks
- Test access-control policies with users of different roles, including portal users and users with no roles
- Monitor policy enforcement and investigate requests for records outside a user's authorized scope
- Automated code review tools may help flag endpoint handlers where permission checks are absent

