IDOR Vulnerability in Spree API Associate Endpoint
An Insecure Direct Object Reference (IDOR) vulnerability in the Spree API v3 allows authenticated users to associate and exfiltrate PII from arbitrary guest carts using reversible Sqids identifiers.
CVE search metadata
CVE search record: CVE-2026-94462. Severity: high. CVSS: 7.1. KEV: no. Product: spree_api (5.4.0 - 5.4.3, 5.5.0 - 5.5.3). Brief: IDOR Vulnerability in Spree API Associate Endpoint. Brief link: https://feed.craftedsignal.io/briefs/2026-09-spree-idor/
Spree versions 5.4.0 through 5.4.3 and 5.5.0 through 5.5.3 contain a high-severity Insecure Direct Object Reference (IDOR) vulnerability in the PATCH /api/v3/store/carts/:id/associate endpoint. The vulnerability arises because the controller fails to perform the standard authorize!(:update, @cart, cart_token) check for the association process. Instead, it relies on a prefixed_id which is generated via reversible Sqids encoding of sequential database primary keys. An authenticated store user can derive candidate cart IDs offline and iterate through them, associating victim guest carts to their own account. Successful exploitation permits the attacker to read sensitive customer checkout information, including full names, street addresses, and phone numbers stored in the guest cart objects.
Attack Chain
- Attacker registers an ordinary customer account on the target Spree storefront.
- Attacker logs into the store via
POST /api/v3/store/auth/loginto obtain a valid session JWT. - Attacker uses the known Sqids algorithm and target sequential database IDs to generate a list of candidate
prefixed_idstrings (e.g.,cart_XXXXXXXXXX). - Attacker iterates through the generated list, sending
PATCH /api/v3/store/carts/:id/associaterequests for each candidate ID. - The backend controller processes the request, locates the guest cart via
find_cart_for_association, and skips the required authorization check. - The
Spree.cart_associate_servicereassigns the guest order to the attacker's account and overwrites the associated email address. - The API returns a
200 OKresponse containing the serialized customer PII (billing and shipping addresses) previously stored on the victim's guest cart.
Impact
Successful exploitation results in the unauthorized exposure of personally identifiable information (PII) including names, physical addresses, and contact details for store guests. Furthermore, it causes a disruption to the original guest's shopping experience as their in-progress cart is hijacked and reassigned to the attacker's account. This affects any Spree-based storefront not running in login_required mode.
Recommendation
Prioritized actions for administrators:
- Upgrade Spree backend components to version 5.4.4 or 5.5.4 immediately to address CVE-2026-94462.
- Audit access logs for high-frequency
PATCHrequests to the/api/v3/store/carts/endpoint originating from single authenticated user sessions. - Monitor for anomalous
404or422error patterns on the association endpoint which may indicate automated ID enumeration attempts.
Immediate actions
Patch Spree API to version 5.4.4 or 5.5.4
Threat Hunt
Multiple PATCH requests to /associate endpoint from a single user session
Data: Web server access logs
Mitigations
Upgrade Spree API
CVE-2026-94462