Summary
ERPNext has an endpoint that can return transaction child-table rows without checking the caller's permissions on the rows or their parent document. An authenticated user, including a portal user or a user without roles, may be able to use supplied document types and filters to access business details or probe record values.
Affected context
The issue is in an endpoint shared across ERPNext modules that returns transaction child-table rows. The described affected releases are ERPNext 15.8.0 up to, but not including, 15.121.4, and 16.x releases before 16.36.0. Risk depends on the endpoint being reachable by an authenticated user and on the request not being constrained by appropriate parent-document and child-row authorization checks.
Exploit preconditions
- Attack surface: The shared endpoint that returns transaction child-table rows
- Required access: An authenticated account; the description includes portal users and users without roles
- Trigger point: A request supplying document types and filter conditions
- Why exploitation is possible: The endpoint can return matching rows without verifying access to the child table or its parent document
Why this happens
The endpoint retrieves child-table data without enforcing authorization for the child rows and their parent document. This is a missing authorization check, mapping to CWE-862: Missing Authorization. The insecure pattern is returning records based on caller-controlled document types or filters without first confirming that the caller is permitted to read the relevant records.
Potential impact
- Authenticated users may read transaction line details they are not authorized to access
- Exposed business data could include sensitive operational or commercial information
- Callers could probe record values or infer whether matching records exist
General mitigation guidance
Defensive patterns focus on applying authorization consistently at the data-access boundary:
- Check the caller's permissions for both each child row and its parent document before returning data
- Derive allowed document types and query scope from the caller's privileges rather than trusting request parameters
- Use permission-aware query APIs or secure-by-default data-access layers
- Return only the minimum fields and rows required for the caller's task
- Apply least privilege to user roles and portal access, and avoid treating authentication alone as authorization
How teams detect issues like this
- Review shared endpoints that accept document types, record identifiers, or filters and return database rows
- Use static analysis or code review checks to identify data-return paths without authorization checks
- Test access controls across roles, including portal users and accounts with no assigned roles, and verify both parent and child permissions
- Enforce policies requiring permission-aware data access and authorization tests for endpoints that expose records

