Summary
ERPNext's Manufacturing module has an endpoint that can replace one bill of materials (BOM) with another without verifying that the caller is authorized to change either BOM or the affected assemblies. An authenticated user who can create a BOM Update Log may be able to trigger site-wide substitutions, potentially disrupting manufacturing data and operations.
Affected context
The vulnerability occurs in a Manufacturing module endpoint used to replace BOMs across assemblies. The risk exists when the endpoint processes a replacement request without checking the caller's permissions for both BOMs and the assemblies that would be affected. The issue is reported for Frappe ERPNext releases before 15.122.0 and 16.x releases before 16.50.0.
Exploit preconditions
- Attack surface: The Manufacturing module's BOM replacement endpoint
- Required access: An authenticated account permitted to create a BOM Update Log
- Trigger point: Processing a request that names a source BOM and a replacement BOM
- Why exploitation is possible: The endpoint does not adequately authorize changes to the named BOMs or the affected assemblies
Why this happens
The endpoint performs a sensitive state-changing operation without verifying that the caller has permission to modify the relevant BOMs and assemblies. This is a missing authorization flaw, mapped to CWE-862, where access controls are absent or not enforced at the point of action.
Potential impact
- Unauthorized users may be able to replace BOM references across assemblies
- Manufacturing records could become inaccurate or inconsistent
- Production planning and related business processes could be disrupted
- Changes could affect multiple assemblies across a site
General mitigation guidance
Defensive patterns focus on enforcing authorization at the point where each sensitive change is made.
- Check the caller's permissions for both the source and replacement BOMs and every affected assembly.
- Apply object-level access controls consistently across all entry points to the operation.
- Limit bulk changes to roles that require them, following least-privilege principles.
- Validate requested changes and provide a review or approval step for broad-impact operations.
- Use secure-by-default authorization policies that deny changes unless explicitly permitted.
How teams detect issues like this
- Review code paths that update BOM references or perform bulk changes for object-level authorization checks.
- Use static analysis or code review rules to flag state-changing endpoint handlers that lack permission checks.
- Monitor audit logs for BOM replacement activity, especially requests affecting many assemblies or initiated by unexpected roles.
- Enforce policy checks in automated tests and CI for authorization on sensitive Manufacturing operations.

