Summary
CoopCycle's incident operations check for a courier role but may not verify that the courier is authorized to access each specific incident. A courier could potentially enumerate incident IDs and read or change incidents associated with other stores, including repricing, canceling, or rescheduling orders and tasks.
Affected context
The issue is described in CoopCycle coopcycle-web versions before 6.20.1 and concerns incident operations exposed through the API. It becomes risky when access is granted based only on the courier role, without checking whether the authenticated courier is permitted to act on the particular incident and its associated store, order, or task.
Exploit preconditions
- Attack surface: Incident API operations, including
PUT /api/incidents/{id}/action - Required access: An account with courier access
- Trigger point: Reading or submitting an action for an incident identified by its ID
- Why exploitation is possible: Role-level access checks may not enforce authorization for the specific incident; sequential IDs may make other incidents easier to discover
Why this happens
The underlying issue is a failure of object-level authorization. Checking that a caller has ROLE_COURIER establishes a broad role, but does not establish that the caller may access or modify the incident identified in a request. This maps to CWE-639: Authorization Bypass Through User-Controlled Key, where a user-controlled identifier can be used to access another subject's data or actions without an adequate per-object permission check.
Potential impact
- Couriers may be able to read incidents associated with other stores
- Orders or tasks may be repriced, canceled, or rescheduled without authorization
- Operational records and delivery workflows could be disrupted
- Incident data could be exposed across tenant or store boundaries
General mitigation guidance
Defensive patterns focus on enforcing authorization for every object and action, rather than relying on a role check alone.
- Scope incident lookups to the authenticated courier's permitted stores and resources
- Check authorization on both read and state-changing operations
- Treat client-supplied object identifiers as untrusted references
- Apply least privilege to courier roles and service accounts
- Use secure-by-default authorization policies that deny access unless explicitly granted
How teams detect issues like this
Review incident API handlers and service methods for role checks that are not followed by object-level authorization. Static analysis and code review can look for request-controlled identifiers used in data access or mutation without ownership, tenant, or relationship checks. Where appropriate, enforce policies requiring authorization checks for every read and state-changing endpoint, and monitor for unusual access to incidents across stores or repeated requests for sequential identifiers.

