/

CVE-2026-21447

Severity:

HIGH RISK

(7.1)

Insecure Direct Object Reference in Bagisto Customer Order

CVE-2026-21447

Analyzed

Vulnerability type

Category:

Insecure Direct Object Reference

CWE:

CWE-284, CWE-639

Impact:

Unauthorized Access to Other Customers' Order Data and Potential Fraud

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

An Insecure Direct Object Reference vulnerability in Bagisto's customer order reorder feature allows an authenticated user to access and reuse another customer's order data by manipulating the order ID parameter.

Under these conditions, an attacker can add items from another customer's order to their own shopping cart, exposing sensitive purchase information and enabling potential fraud.

Affected context

This issue occurs in Bagisto's customer-facing eCommerce flows, specifically in the reorder functionality exposed to authenticated shoppers.

The vulnerability is present when:

  • The reorder endpoint accepts an order identifier as input from the client
  • Authorization checks verify that the user is logged in, but do not verify ownership of the referenced order
  • The server logic relies on the client-supplied order ID for identifying which order to reorder

In such environments, any authenticated customer may be able to reference order records belonging to other customers.

Exploit preconditions

  • Attack surface: Web application layer, within the authenticated customer portal.
  • Required access: Valid customer account with standard login; no elevated roles needed.
  • Trigger point: Invoking the reorder action while modifying the order ID parameter (e.g., in a URL, form field, or API request) to refer to another customer's order.
  • Why exploitation is possible: The backend action processes the supplied order ID without enforcing strict ownership checks, leading to a direct reference from user-controlled input to internal order records (an IDOR condition).

Why this happens

The root cause is a missing or incomplete authorization check on a sensitive object—the customer order—after authentication succeeds.

The reorder endpoint appears to:

  • Accept an order ID provided by the client
  • Look up that order in persistence
  • Proceed to copy items from that order into the caller's cart

Without an explicit check that the order belongs to the currently authenticated customer, the system exhibits the core pattern of CWE-639: Authorization Bypass Through User-Controlled Key and relates to CWE-284: Improper Access Control.

Conceptually, the implementation treats knowledge or control of an identifier as proof of authorization, rather than binding access to the authenticated user's own resources.

Potential impact

  • Exposure of other customers' purchase details through items and metadata visible in the attacker's cart.
  • Ability for an attacker to add products from another customer's order to their own cart, simulating or replaying another user's purchasing choices.
  • Facilitation of fraudulent behavior, such as unauthorized use of promotional configurations tied to past orders or misrepresentation of customer activity.
  • Erosion of customer trust and potential regulatory or contractual issues due to unauthorized access to order-related data.

General mitigation guidance

Effective mitigation centers on enforcing object-level authorization and reducing reliance on client-controlled identifiers:

  • Implement strict ownership checks whenever accessing or mutating order records, binding operations to the authenticated customer's identity.
  • Avoid treating the presence or format of an order ID as sufficient for access; always verify that the order belongs to the requesting user.
  • Encapsulate authorization logic in reusable server-side policies (e.g., "customer can access this order") instead of duplicating ad-hoc checks.
  • Use indirect references where appropriate, such as deriving accessible orders based on the logged-in customer's session rather than arbitrary IDs provided by the client.
  • Design endpoints so that they operate on "current user's resources by default" (e.g., fetching the current user's orders from the session context) to minimize exposure of ID-based access patterns.
  • Apply the principle of least privilege to customer actions, ensuring features like reorder only work on resources clearly owned by the invoking account.

How teams detect issues like this

Identifying similar access control weaknesses benefits from a combination of review techniques:

  • Static analysis and code scanning:
  • Flag controller or route handlers that accept identifiers for sensitive objects (orders, invoices, profiles) and access them without associated ownership checks.
  • Look for direct ORM calls (e.g., Order::find($id)) that are not scoped by the authenticated user (e.g., lack of where('customer_id', auth()->id()) or equivalent).
  • Code review practices:
  • Highlight any endpoint where access control is "assumed" due to authentication, but object-level authorization is not explicitly enforced.
  • Review all "reorder," "view order," "download invoice," and similar flows for consistent use of centralized authorization policies or guards.
  • Security testing and QA workflows:
  • Incorporate test cases that change resource IDs in authenticated requests to verify that cross-user access is denied.
  • Use automated API testing tools or DAST to systematically fuzz identifiers in authenticated contexts, looking for IDOR patterns.
  • Policy enforcement:
  • Establish development guidelines requiring an explicit authorization policy for every endpoint dealing with user-specific resources.
  • Integrate automated checks in CI/CD that search for known anti-patterns (e.g., raw identifier usage without accompanying authorization calls).

Sources

SourceLink
github.comgithub.com/bagisto/bagisto/commit/b2b1cf62577245d03a68532478cffbe321df74d3
github.comgithub.com/bagisto/bagisto/security/advisories/GHSA-x5rw-qvvp-5cgm

Frequently asked

questions

No. The weakness resides in the customer portal and requires a valid authenticated customer account. However, any ordinary customer account may be able to exploit it against other customers if the check is missing.

The attacker only needs standard customer-level access. Once logged in, they can manipulate the order ID parameter in the reorder request to target other customers' orders, assuming no additional controls are in place.

The most robust fix is to implement object-level authorization that ensures the referenced order is owned by the authenticated user before performing any action. All order-related operations should be guarded by centralized authorization policies that enforce ownership, rather than relying on the presence of an order ID alone.

Teams can prevent IDOR-style flaws by standardizing on secure access patterns: derive resources from the logged-in user's context, enforce explicit authorization on every resource access, and avoid trusting client-provided identifiers as proof of access rights. Incorporating targeted code review checklists, static analysis rules, and API tests that deliberately tamper with IDs helps catch these issues early in the development lifecycle.

Find out what's already
exploitable in your codebase.