Summary
PrestaShop's Webservice API can fail to enforce a key's shop-level permissions when a request expands its shop context. A holder of a key restricted to one shop may be able to access, change, or delete data belonging to other shops by submitting requests with certain shop-scope parameters.
Affected context
The flaw is in PrestaShop's Webservice API authorization handling in classes/webservice/WebserviceRequest.php. It may affect installations where a Webservice key is limited to particular shops but requests can specify id_shop=all or an id_shop_group value that expands the effective shop context without checking that the key is associated with those shops.
Exploit preconditions
- Attack surface: The PrestaShop Webservice API must be reachable.
- Required access: The attacker must hold a valid Webservice key, such as one restricted to a single shop.
- Trigger point: A request supplies
id_shop=allor anid_shop_groupvalue to broaden the shop context. - Why exploitation is possible: The expanded context is not adequately checked against the key's shop associations, allowing authorization evaluation to grant access based on the broader set.
Why this happens
The authorization check does not reliably bind the requested shop context to the shops assigned to the Webservice key. Expanding the context and evaluating rights across that set as a disjunction can allow access when the key lacks permission for the specific shop containing the requested data. This is an authorization bypass, mapped to CWE-863: Incorrect Authorization.
Potential impact
- An attacker may read data belonging to shops they are not authorized to access.
- An attacker could modify or delete data across other shops.
- Customer records, including email addresses, secure keys, and password hashes, may be exposed.
- Cross-shop access could affect the confidentiality and integrity of data across the installation.
General mitigation guidance
Defensive patterns focus on enforcing authorization against the exact resources requested:
- Bind each request's effective shop scope to the Webservice key's explicit shop associations.
- Deny requests that expand scope beyond the key's granted permissions.
- Apply authorization checks to each target shop and resource, rather than relying on a broad context-level result.
- Follow least-privilege practices when creating and distributing Webservice keys.
- Limit exposure of the Webservice API and monitor use of keys and shop-scope parameters.
How teams detect issues like this
- Review authorization code for request parameters that broaden shop or tenant scope without rechecking the caller's assigned permissions.
- Use static analysis and code review to trace shop-context expansion through authorization checks, including disjunctive or "any match" permission logic.
- Test that keys restricted to one shop cannot access resources in other shops when requests specify broader shop or group scopes.
- Apply API policies that reject scope-expanding parameters unless the caller is explicitly authorized for the resulting scope.
- Monitor logs for unusual use of
id_shop=allorid_shop_groupvalues by narrowly scoped keys.

