Summary
Frappe India Payroll has a missing authorization check in tax-regime methods that may let authenticated, low-privileged users access other employees' payroll details. Depending on the method and record state, a user may also change the tax regime on a draft Salary Structure Assignment, potentially affecting tax withholding.
Affected context
The issue is described in Frappe India Payroll's tax_regime_selector.py, in the get_employee_details, compute_tax_comparison, and set_tax_regime methods. It may affect deployments where these methods accept employee or assignment identifiers without verifying that the authenticated user is authorized to access or modify the referenced records.
Exploit preconditions
- Attack surface: The affected tax-regime methods in the payroll application
- Required access: An authenticated account with low privileges
- Trigger point: A request that supplies another employee's identifier or targets a draft Salary Structure Assignment
- Why exploitation is possible: The methods may not enforce authorization against the specific employee or assignment being accessed or changed
Why this happens
The underlying issue is a missing authorization check, mapped to CWE-862: Missing Authorization. The application may accept a valid record identifier and perform a read or state change without confirming that the requesting user is permitted to access or modify that particular employee's payroll data.
Potential impact
- Unauthorized users may view base pay and earning or deduction components.
- Payroll information may be disclosed across employee access boundaries.
- A user may change the tax regime on a draft assignment, which could affect tax withholding.
- Unauthorized changes may create payroll processing errors or require corrective review.
General mitigation guidance
Defensive patterns for this class of issue include:
- Enforcing server-side, object-level authorization for every read and write operation.
- Deriving employee scope from the authenticated user's permissions rather than trusting supplied identifiers.
- Applying secure-by-default access rules and denying access when authorization cannot be established.
- Limiting mutation permissions to the roles and workflow states that require them.
- Treating client-supplied record identifiers as untrusted and validating them against the user's authorized scope.
- Running payroll services and background processes with only the privileges they need.
How teams detect issues like this
- Review the affected methods and similar endpoints for record access based only on caller-supplied identifiers.
- Use static analysis or code review checks to flag database reads and writes that lack nearby authorization enforcement.
- Test access-control policies with accounts of different roles and employee scopes, including attempts to access another employee's records.
- Add policy checks and audit logging for sensitive payroll reads and tax-regime changes.
- Automated code review tools may help identify missing object-level authorization patterns.

