CVEReports
Reports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Reports
  • Sitemap
  • RSS Feed

Company

  • About
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Powered by Google Gemini & CVE Feed

|
•

CVE-2026-21447
CVSS 7.1

I'll Have What He's Having: IDOR in Bagisto eCommerce

Alon Barad
Alon Barad
Software Engineer•January 2, 2026•5 min read
PoC Available

Executive Summary (TL;DR)

Bagisto trusted user input a little too much. By simply changing the Order ID in a reorder request, an attacker could force the application to fetch items from *anyone's* past order and dump them into their own shopping cart. It's the digital equivalent of reaching into someone else's grocery bag at the checkout line.

An Insecure Direct Object Reference (IDOR) in the Bagisto Laravel eCommerce platform allows authenticated users to 'reorder' items from any other customer's order history, effectively leaking purchasing habits and sensitive cart data.

The Hook: eCommerce and the "Reorder" Button

eCommerce platforms are complex beasts. They have to juggle inventory, payments, shipping, and the ever-demanding user experience. One feature designed to reduce friction is the "Reorder" button. It’s simple: you bought 50 pounds of coffee beans last month, and you want to do it again without searching for the product page.

Bagisto, a popular open-source Laravel eCommerce package, implements this handy feature. It takes an old order, grabs the items, and tosses them into your current cart. It’s convenient, efficient, and—until version 2.3.10—completely blind to who actually placed the original order. This feature turned into a massive privacy leak, allowing nosy neighbors or corporate spies to see exactly what other people were buying.

The Flaw: Trusting the ID

The vulnerability here is a textbook Insecure Direct Object Reference (IDOR). In the world of web security, IDOR is the "forgot to lock the bathroom door" of vulnerabilities. The application receives a request to access a specific object (in this case, an Order ID) and retrieves it from the database.

However, the application forgot the second, most critical step: checking if the person asking for the order actually owns it. Bagisto's code essentially said, "Oh, you want Order #1337? Sure, here it is!" without verifying if the requester was the customer who placed Order #1337. Because database IDs are often sequential integers, an attacker doesn't even need to be clever. They can just count up: 100, 101, 102, grabbing cart data for every single purchase on the platform.

The Code: The Smoking Gun

Let's look at the PHP code in OrderController.php. This is a classic Laravel oversight. The developer used a repository method that finds a record by ID but doesn't scope it to the current user.

The Vulnerable Code:

public function reorder(int $id)
{
    // DIRECT LOOKUP: No ownership check!
    $order = $this->orderRepository->findOrFail($id);
 
    foreach ($order->items as $item) {
        // ... logic to add items to cart ...
    }
    // ...
}

See that findOrFail($id)? That is the root of all evil here. It queries the database for any order with that ID. If it exists, it returns it. It doesn't care if the logged-in user is Customer A and the order belongs to Customer B.

The Fixed Code:

public function reorder(int $id)
{
    // SCOPED LOOKUP: Must match ID AND current Customer ID
    $order = $this->orderRepository->findOneWhere([
        'customer_id' => auth()->guard('customer')->id(),
        'id'          => $id,
    ]);
 
    // If it's not yours, it doesn't exist to you.
    abort_if(! $order, 404);
 
    foreach ($order->items as $item) {
       // ...
    }
}

The fix is elegant and simple. Instead of just looking for $id, the query now mandates that the customer_id on the record must match auth()->guard('customer')->id(). If I try to access your order now, the database returns null, and the app throws a 404.

The Exploit: Shopping from Your Cart

Exploiting this requires zero elite hacking tools. You just need a browser and a logged-in account. Here is how a competitor might use this to spy on sales trends or how a stalker might track a victim's purchases.

  1. Authenticate: The attacker creates a legitimate account on the Bagisto store and logs in.
  2. Target Selection: The attacker guesses an Order ID. If the site is busy, IDs might be in the thousands. Let's say the attacker's last order was #500. They want to see what Order #499 was.
  3. The Request: The attacker sends a POST request (or visits the URL, depending on implementation specifics) to: POST /customer/account/reorder/499
  4. The Execution: The server processes the ID 499, retrieves the order details (product names, quantities, variants), and adds them to the attacker's active shopping cart.
  5. The Reveal: The attacker clicks on "My Cart." Suddenly, their cart is full of items they didn't select. "Oh, User 499 bought a 'Limited Edition GPU' and 'Gaming Chair'? Interesting."

This can be automated with a simple script to iterate from ID 1 to 10,000, scraping product popularity data or revealing sensitive purchases.

The Impact: Privacy & Fraud

While this doesn't dump the database credentials or allow Remote Code Execution (RCE), the privacy impact is rated High (Confidentiality).

Business Intelligence Leak: A competitor could enumerate all orders to calculate precise sales volume, identify best-selling items, and map out order frequency.

Privacy Violation: In specific niches (medical supplies, adult industries, political merchandise), knowing what someone bought can be devastatingly sensitive. Since the attacker effectively "sees" the items by having them added to their cart, the confidentiality of the purchase history is completely breached.

Fraud Potential: While less direct, an attacker could potentially manipulate inventory availability by "reordering" massive quantities of items from other orders, locking up stock in their cart (depending on how the cart reservation system works).

The Fix: Scoping the Query

If you are running Bagisto, you need to upgrade to version 2.3.10 immediately. The patch was released in late December 2025.

If you cannot upgrade the entire platform, you must patch packages/Webkul/Shop/src/Http/Controllers/Customer/Account/OrderController.php manually. Replace the findOrFail call with the composite findOneWhere check shown in the code section above.

Developer Lesson: Never trust an ID provided by the client. Whenever you look up a resource that belongs to a specific user, your database query must include the user's ID as a WHERE clause. Do not rely on checking ownership after fetching the object; scope the fetch itself.

Official Patches

BagistoOfficial fix commit on GitHub

Fix Analysis (1)

Technical Appendix

CVSS Score
7.1/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N

Affected Systems

Bagisto eCommerce Platform

Affected Versions Detail

ProductAffected VersionsFixed Version
Bagisto
Bagisto
< 2.3.102.3.10
AttributeDetail
CWECWE-639 (Authorization Bypass Through User-Controlled Key)
CVSS v3.17.1 (High)
Attack VectorNetwork (Authenticated)
ImpactConfidentiality Loss (High)
Exploit StatusTrivial / PoC Available
Patch Date2025-12-23

MITRE ATT&CK Mapping

MITRE ATT&CK Mapping

T1596Search Open Technical Databases
Reconnaissance
T1078Valid Accounts
Initial Access
T1213Data from Information Repositories
Collection
CWE-639
Insecure Direct Object Reference (IDOR)

The application does not verify that the user ID associated with the requested object matches the currently authenticated user, allowing access to unauthorized records.

Exploit Resources

Known Exploits & Detection

Manual AnalysisExploitation is trivial via manual manipulation of the URL ID parameter.

Vulnerability Timeline

Vulnerability Timeline

Vendor releases patch (Commit b2b1cf62)
2025-12-23
CVE-2026-21447 assigned and published
2026-01-02
GHSA-x5rw-qvvp-5cgm advisory published
2026-01-02

References & Sources

  • [1]GitHub Security Advisory
  • [2]NVD Detail

Subscribe to updates

Get the latest CVE analysis reports delivered to your inbox.

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.