/

CVE-2026-94462

Severity:

HIGH RISK

(7.1)

Insecure Direct Object Reference (CWE-639) in Spree

CVE-2026-94462

Awaiting Analysis

Vulnerability type

Category:

Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Unauthorized access to sensitive cart data and unauthorized cart reassignment

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Spree's cart-association endpoint can allow an authenticated customer to claim an eligible guest cart without proving possession of its cart token. This may expose the guest cart's billing and shipping addresses and disrupt an in-progress checkout when cart identifiers can be derived.

Affected context

The issue occurs in Spree API v3 store cart association flows when a guest cart can be located using a reversible prefixed identifier without an additional possession check. Risk is greatest on stores that allow checkout without login and where guest carts contain billing or shipping address information.

Exploit preconditions

  • Attack surface: PATCH /api/v3/store/carts/:id/associate
  • Required access: An authenticated customer account, plus the ability to derive or obtain eligible guest cart identifiers
  • Trigger point: The cart association action handled by Spree::Api::V3::Store::CartsController#associate
  • Required target state: A guest cart must exist, contain address data, and belong to a store that permits checkout without login
  • Why exploitation is possible: Cart lookup relies on a prefixed identifier without requiring a cart token or otherwise verifying possession of the selected guest cart

Why this happens

The underlying bug is an object-level authorization failure. The endpoint identifies a guest cart from a client-supplied identifier and permits reassignment without checking whether the requester possesses the corresponding cart secret or is authorized to access that cart.

This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because a user-controlled object reference is accepted as sufficient authority to access or modify another user's resource. Reversible identifiers increase the risk when they can be derived without a separate authorization proof.

Potential impact

  • An attacker may obtain billing and shipping address data from another customer's guest cart
  • An attacker could associate the guest cart with their own account
  • The original guest may lose access to an in-progress cart
  • Checkout completion, order contents, or cart ownership could be disrupted
  • Exposed address information could contribute to privacy or targeted social-engineering risks

General mitigation guidance

Mitigation generally focuses on enforcing object-level authorization at the point of cart lookup and association.

Common defensive patterns include:

  • Require possession of a high-entropy cart token or equivalent secret before associating a guest cart
  • Bind guest-cart operations to a validated session or other narrowly scoped proof of ownership
  • Treat prefixed or reversible identifiers as locators rather than authorization credentials
  • Apply authorization checks consistently to both read and state-changing cart operations
  • Minimize address data returned to clients and avoid exposing it before authorization succeeds
  • Use least-privilege service permissions and audit cart ownership changes

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review rules that flag resource lookups based only on request parameters
  • Review of controller actions that modify ownership, association, or access state
  • Tests that attempt to access and associate carts belonging to other sessions or accounts
  • API policy checks requiring a cart token, session binding, or equivalent ownership proof
  • Monitoring for unusual cart-association activity, repeated identifier enumeration, and cross-account changes

Automated application-security testing can help identify authorization gaps when test data includes multiple users and guest sessions.

Sources

SourceLink
github.comgithub.com/spree/spree/commit/8834230a1f47bb5988f23f45dbd162776cf592bd
github.comgithub.com/spree/spree/commit/af0d1a2d582a60d179de65b7d3ea024cb26426a8
github.comgithub.com/spree/spree/pull/14314
github.comgithub.com/spree/spree/releases/tag/v5.4.4
github.comgithub.com/spree/spree/releases/tag/v5.5.4
github.comgithub.com/spree/spree/security/advisories/GHSA-4825-p4xm-pcf2

Frequently asked

questions

Yes, it can be reached through the exposed API endpoint when the affected store permits the relevant guest-cart workflow and the attacker has an authenticated customer account.

No. The attacker generally needs their own authenticated customer account and a way to derive or obtain a target guest cart's identifier; access to the victim's credentials is not the stated prerequisite.

Require a separate proof of cart possession, such as a high-entropy cart token or securely bound session, and enforce authorization before returning data or changing cart ownership.

Treat every client-supplied object identifier as untrusted, test cross-user access and mutation paths, minimize sensitive responses, and enforce object-level authorization consistently across API endpoints.

Find out what's already
exploitable in your codebase.