Summary
A missing authorization check in an ERPNext Manufacturing endpoint may let authenticated users cancel Stock Reservation Entries without having write permission for the affected records. If a low-privilege user can submit requests naming records outside their permitted scope, they could release reserved stock and disrupt stock allocation.
Affected context
The issue affects the Manufacturing module endpoint that cancels Stock Reservation Entries in the specified ERPNext release range. It becomes risky when the endpoint accepts a cancellation request without enforcing record-level write permissions, including applicable company boundaries and User Permissions.
Exploit preconditions
- Attack surface: The Manufacturing module endpoint for canceling Stock Reservation Entries
- Required access: An authenticated account; the description indicates that low-privilege access may be sufficient
- Trigger point: A request to cancel a reservation associated with a manufacturing document
- Why exploitation is possible: The endpoint does not adequately verify that the requester has write permission for the targeted record or is authorized to access its company or User Permission scope
Why this happens
The underlying issue is a missing authorization check, mapped to CWE-862: Missing Authorization. The endpoint permits a state-changing operation without consistently confirming that the authenticated user is authorized to modify the specific Stock Reservation Entry and related document. Authentication alone does not establish record-level permission.
Potential impact
- Reserved stock may be released without the responsible user's authorization.
- Inventory allocation and manufacturing workflows could be disrupted.
- Users may affect records belonging to other companies or outside their assigned User Permissions.
- Repeated or targeted cancellations could cause operational delays or require manual reconciliation.
General mitigation guidance
Defensive patterns focus on enforcing authorization at the point of every state-changing operation.
- Check record-level write permission for the specific reservation and its related documents before cancellation.
- Apply company boundaries and User Permission restrictions consistently on server-side requests.
- Derive the target record and its authorization scope from trusted server-side data rather than relying on client-supplied identifiers alone.
- Deny access by default when permission checks fail or cannot be completed.
- Keep application service accounts and user roles limited to the permissions needed for their workflows.
How teams detect issues like this
Review state-changing endpoints for permission checks that occur before any record mutation, and look for code paths that rely only on authentication or broad role checks. Static analysis and code review can flag cancellation operations that accept record identifiers without verifying record-level write access. Policy tests can confirm that users cannot modify records outside their company or User Permission scope; audit logs can also help identify unexpected reservation cancellations.

