Summary
Saleor's order retrieval mechanism contains an Insecure Direct Object Reference (IDOR) issue that allows attackers to access order details they do not own via the order() GraphQL query.
In affected versions, unauthenticated or non-staff users may be able to exfiltrate sensitive information, including PII from orders created before Saleor 3.2.0, when they can guess or enumerate order identifiers.
Affected context
This vulnerability occurs in Saleor's order retrieval functionality exposed through the order() GraphQL query.
It affects deployments running:
- Saleor 3.2.0 through 3.20.109
- Saleor 3.21.0-a.0 through 3.21.44
- Saleor 3.22.0-a.0 through 3.22.28
The risk is highest where:
- Order identifiers are predictable or discoverable, and
- The application allows non-staff or unauthenticated users to call the order lookup API.
Orders created before Saleor 3.2.0 are specifically called out as potentially leaking personally identifiable information (PII) in plain text.
Exploit preconditions
- Attack surface: Public-facing GraphQL API, specifically the
order()query endpoint. - Required access: Network access to the API; in some configurations, no authentication or only low-privileged/non-staff access is required.
- Trigger point: Supplying identifiers (such as order IDs or tokens) for orders that belong to other customers to the
order()query. - Why exploitation is possible: The API relies on object identifiers to fetch order records but does not consistently enforce proper authorization checks ensuring the requester owns or is authorized to view the referenced order. This is the essence of CWE-639: access control depends solely on user-controllable identifiers.
Why this happens
The core issue is an access control flaw where authorization is not tightly bound to the resource being accessed.
In an IDOR scenario, backend logic accepts a client-supplied identifier (e.g., order ID, token, or reference) and returns the corresponding object without validating that the requester is the legitimate owner or has sufficient privileges to view that resource.
For Saleor's order() GraphQL query, the system trusted the identifier and performed a direct lookup, but did not reliably check that the caller is authenticated as the customer associated with the order or as a staff member with appropriate privileges.
This pattern maps directly to CWE-639: Authorization Bypass Through User-Controlled Key, where the security decision is incorrectly based solely on a user-manipulable key instead of robust, server-enforced ownership and role checks.
Potential impact
- Exposure of customers' personally identifiable information (PII) contained in historical orders.
- Disclosure of order contents, including purchased items and pricing details, which can aid profiling or competitive intelligence.
- Leakage of contact information such as names, addresses, phone numbers, and email addresses associated with older orders.
- Potential regulatory and compliance impact (e.g., GDPR/CCPA) due to unauthorized exposure of customer data.
- Erosion of customer trust and reputational damage due to privacy violations.
General mitigation guidance
Effective mitigation focuses on enforcing strict, server-side authorization checks around object access:
- Ensure that any API handling order retrieval validates that the requesting user is either:
- The authenticated customer associated with the order, or
- A staff/admin account with explicit permission to view orders.
- Bind resource access decisions to server-side known attributes (e.g., user session, customer ID) rather than relying only on user-supplied identifiers.
- Use opaque, hard-to-guess identifiers or tokens for orders, separate from internal primary keys, and validate these tokens against the current user's identity.
- Centralize authorization logic for object retrieval so that all orders-related queries and mutations pass through a consistent permission-checking layer.
- Apply the principle of least privilege to ensure non-staff users have access only to their own orders and only to the minimal data necessary for customer workflows.
- Consider data minimization for historical orders, reducing retention or masking sensitive fields that are not operationally required.
How teams detect issues like this
To detect and monitor for similar access control issues:
- Static analysis and code review:
- Search for GraphQL resolvers, REST handlers, or services that fetch orders by ID or token without an explicit ownership or permission check.
- Flag patterns where database queries select order objects based solely on user-provided IDs without referencing the current authenticated user.
- Review custom GraphQL schema and resolvers to ensure each resource-level resolver enforces authorization independent of client-side checks.
- Security tests and tooling:
- Incorporate authorization-focused tests in CI (e.g., automated tests that attempt to access other users' orders using captured or guessed IDs).
- Use dynamic application security testing (DAST) tools to probe object access patterns and identify IDOR exposures.
- Implement logging for access to order retrieval endpoints, capturing user identity, requested order ID, and outcome; periodically analyze logs for suspicious cross-user access attempts.
- Policy and governance:
- Establish coding standards that mandate ownership checks for all object retrieval by user-supplied identifiers.
- Integrate API gateway or GraphQL middleware policies that enforce authentication and authorization for sensitive resource types such as orders.

