Summary
A broken access control flaw in the Ruoyi Vue Pro ErpSaleOrderController lets users with shipment-level erp:sale-out permissions access and manipulate sale order operations intended for the erp:sale-order namespace.
Under misconfigured namespace enforcement, attackers can create, modify, delete, and read financially sensitive sale orders without possessing the correct business-role permissions.
Affected context
This vulnerability appears in Ruoyi Vue Pro ERP modules where HTTP controller endpoints guard business operations using permission namespaces.
It manifests when the ErpSaleOrderController checks for erp:sale-out shipment permissions instead of the stricter erp:sale-order namespace for sale order actions.
Environments that grant shipment-level roles broad access, or reuse permission codes across modules, are more exposed to unintended access paths.
Exploit preconditions
- Attack surface: HTTP API endpoints exposed by ErpSaleOrderController (web UI or REST calls).
- Required access: Valid application account with assigned
erp:sale-outpermission (shipment-level role). - Trigger point: Invoking sale order create, update, delete, or read endpoints that incorrectly validate
erp:sale-outinstead oferp:sale-order. - Why exploitation is possible: Authorization checks rely on the wrong permission namespace, allowing roles scoped to shipment operations to pass checks designed for sale order operations.
Why this happens
The core issue is misaligned authorization logic—business operations for sale orders are guarded by a permission string intended for shipment operations.
This maps to CWE-863: Incorrect Authorization, where the system validates access using an inappropriate or overly broad privilege, breaking the intended separation between financial and logistics roles.
At a pattern level, the controller couples endpoint protection to string-based permission codes without centralized verification, increasing the risk that a typo or copy-paste error silently widens access.
Potential impact
- Attackers with shipment-level permissions may create unauthorized sale orders.
- They could update existing sale orders to manipulate pricing, quantities, or customer details.
- They can delete legitimate sale orders, disrupting financial records and audit trails.
- They may read sensitive financial and customer information embedded in sale orders.
- They could indirectly impact downstream invoicing, revenue reporting, and compliance processes.
General mitigation guidance
Mitigation generally focuses on tightening and centralizing authorization rules around business operations.
Useful patterns include:
- Enforcing role-appropriate permission namespaces for each controller, separating shipment, sales, finance, and administrative scopes.
- Driving authorization decisions from a centralized policy layer or RBAC engine instead of scattered string checks in controllers.
- Applying least-privilege principles when defining roles, ensuring shipment roles cannot indirectly cover financial operations.
- Adding consistency checks or unit tests for permission mappings so that every endpoint is bound to its intended namespace.
- Using coarse-grained business capabilities (e.g., "manage sale orders") rather than reusing similar-sounding permission codes across modules.
How teams detect issues like this
Detection typically relies on combining code-level inspection with policy analysis:
- Static analysis or custom linters can flag controllers whose permission codes do not match the domain they serve (e.g., sale order endpoints protected by shipment permissions).
- Security-focused code reviews can cross-check each endpoint's authorization annotation against a canonical permission catalog.
- RBAC policy audits can look for roles that unexpectedly allow access to finance-related operations via shared or reused permission strings.
- Automated tests can assert that users with specific roles (e.g., shipment-only) cannot perform financial actions, catching regressions early.

