/

CVE-2026-22589

Severity:

HIGH RISK

(7.5)

Insecure Direct Object Reference (IDOR) in Spree Commerce

CVE-2026-22589

Analyzed

Vulnerability type

Category:

Insecure Direct Object Reference (IDOR)

CWE:

CWE-639

Impact:

Exposure of Sensitive Customer Address Information

Severity:

HIGH RISK

(7.5)

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

An insecure direct object reference (IDOR) in Spree Commerce allows unauthenticated users to retrieve guest address records without valid credentials or session cookies.

When exposed, this flaw can leak customers' shipping or billing address information by directly accessing internal identifiers instead of enforcing proper authorization checks.

Affected context

This vulnerability occurs in Spree Commerce deployments where guest checkout or guest address creation is enabled and backend endpoints expose address resources keyed by predictable or discoverable identifiers.

The issue manifests when the application relies on object IDs or parameters alone, rather than enforcing robust authorization controls to ensure that only the rightful user or session can access a given address record.

Environments that allow anonymous browsing and do not apply strict access checks on read-only address endpoints are particularly susceptible.

Exploit preconditions

  • Attack surface: Public HTTP(S) endpoints serving address-related resources in the Spree storefront or API.
  • Required access: No authentication or valid session cookie is required; a network path to the application is sufficient.
  • Trigger point: Direct requests to address-related routes (e.g., by manipulating IDs or parameters) that fetch guest address records.
  • Why exploitation is possible: The application authorizes access primarily by the presence of an identifier (such as an address ID) without verifying that the requester is associated with the corresponding guest checkout or session, leading to an insecure direct object reference.

Why this happens

The underlying problem is an authorization design flaw where object-level access is not properly constrained.

Instead of enforcing that each address record is only accessible to the authenticated user or the specific guest session that created it, the application implicitly trusts the provided identifier and returns the corresponding resource.

This behavior maps to CWE-639: Insecure Direct Object Reference, where internal object references (IDs, tokens, or keys) are exposed and acted upon without adequate authorization checks, enabling attackers to iterate or guess identifiers and access data that does not belong to them.

Potential impact

  • Unauthorized access to guest shipping and billing address details.
  • Exposure of personal information such as names, physical addresses, and potentially linked contact information.
  • Privacy violations and possible non-compliance with data protection regulations depending on jurisdiction.
  • Intelligence gathering for targeted phishing, fraud, or social engineering attacks using leaked address data.

General mitigation guidance

Mitigation typically focuses on strengthening object-level authorization and minimizing direct exposure of internal identifiers.

Recommended defensive patterns include:

  • Enforcing ownership checks on every address-related read or write operation, ensuring that only the associated authenticated user or guest session can access a given address.
  • Avoiding reliance on raw, sequential IDs for access control; instead, bind resources to user accounts or session-scoped tokens and validate that binding on each request.
  • Implementing a centralized authorization layer or policy that consistently applies object-level checks across controllers and APIs, rather than ad-hoc authorization logic.
  • Reducing exposed data fields in responses to the minimum necessary, particularly for endpoints accessible to unauthenticated clients.
  • Applying a privacy-by-default approach, where any access to personal data requires explicit verification of user identity or session ownership.

How teams detect issues like this

Effective detection of IDOR vulnerabilities generally combines automated analysis with targeted review of authorization logic.

Common approaches include:

  • Static analysis or security linting configured to flag controller actions or API endpoints that read resources by ID without corresponding authorization checks.
  • Code review checklists that require reviewers to confirm explicit authorization for every action that loads address, order, or user-related models.
  • Dynamic application security testing (DAST) or API fuzzing focused on manipulating object IDs and parameters to verify that data from other users or sessions cannot be retrieved.
  • Logging and monitoring for anomalous patterns such as rapid enumeration of address IDs or repeated access attempts to different identifiers from the same client.
  • Incorporating automated security tests into CI pipelines that assert object-level access controls for representative address and order endpoints.

Sources

SourceLink
github.comgithub.com/spree/spree/commit/16067def6de8e0742d55313e83b0fbab6d2fd795
github.comgithub.com/spree/spree/commit/4c2bd62326fba0d846fd9e4bad2c62433829b3ad
github.comgithub.com/spree/spree/commit/d051925778f24436b62fa8e4a6b842c72ca80a67
github.comgithub.com/spree/spree/commit/e1cff4605eb15472904602aebaf8f2d04852d6ad
github.comgithub.com/spree/spree/security/advisories/GHSA-3ghg-3787-w2xr

Frequently asked

questions

Yes. Because the flaw affects publicly reachable endpoints and does not require authentication or session cookies, any remote user with network access to the Spree application can attempt to exploit it.

No special privileges are required. An attacker only needs the ability to send HTTP requests to the affected endpoints; they do not need an account, login credentials, or a valid session.

The most robust fix is to enforce strict object-level authorization checks on all address-related operations, ensuring that the requester is either the authenticated owner of the record or the exact guest session that created it, and to centralize this logic so it cannot be bypassed.

Adopt a consistent access-control strategy where every controller and API action that loads a resource also verifies ownership, complement this with secure coding guidelines, automated tests for access control, and tooling that flags data access without explicit authorization.

Find out what's already
exploitable in your codebase.