CVE-2026-53637: Sylius Cart FormComponent Allows Modification Or Vulnerability
MODERATECVE-2026-53637 is a MODERATE (CVSS 6.5) cart formcomponent allows modification or vulnerability (CWE-841: Improper Enforcement of Behavioral Workflow) affecting Sylius libraries in the Packagist ecosystem. The issue involves cart formcomponent allows modification or deletion of an already-completed order. Remediation is available by upgrading affected packages to version 2.0.18, 2.1.15, 2.2.6.
CVE-2026-53637 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2026-53637
To remediate this vulnerability, upgrade all affected Sylius dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade sylius/sylius to 2.0.18
Upgrade sylius/sylius to 2.1.15
Upgrade sylius/sylius to 2.2.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for sylius/sylius
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-53637, inspect your project dependencies for Sylius:
inspect dependencies for sylius/sylius
Analyze the terminal output to locate any version of Sylius in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.18), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-841: Improper Enforcement of Behavioral Workflow, where the product supports a session in which more than one behavior must be performed by an actor, but it does not properly ensure that the actor performs the behaviors in the required sequence. In Sylius, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-53637 Affected Sylius Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sylius/sylius
|
Packagist |
≥ 2.0.0
< 2.0.18
|
2.0.18
|
|
sylius/sylius
|
Packagist |
≥ 2.1.0
< 2.1.15
|
2.1.15
|
|
sylius/sylius
|
Packagist |
≥ 2.2.0
< 2.2.6
|
2.2.6
|
References
Frequently Asked Questions
What is CVE-2026-53637?
Which Sylius versions are affected?
What version fixes CVE-2026-53637?
Is sylius/sylius affected?
What is the CVSS score of CVE-2026-53637?
What CWE is associated with CVE-2026-53637?
How can I check Packagist dependencies for CVE-2026-53637?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5597-7rmh-97q5",
"modified" : "2026-07-09T21:03:41Z",
"published" : "2026-07-09T21:03:41Z",
"aliases" : [ "CVE-2026-53637" ],
"summary" : "Sylius: Cart FormComponent allows modification or deletion of an already-completed order",
"details" : "### Impact\nA user opens the cart page in the browser. In the background, the order gets completed, e.g. an admin changes the status, or the user finalizes payment in another tab. The browser still displays the old cart: the LiveComponent is unaware the underlying order state has changed.\n\nIf the user then:\n\n- **clears the cart** → `clearCart()` calls `manager->remove()` on the\n completed order: the order is permanently **deleted** from the database;\n- **removes a product** → `removeItem()` mutates an item on the completed\n order;\n- **changes quantity** → `saveCart()` overwrites data on the completed order.\n\nIn all cases, the customer's order data is irreversibly corrupted or lost, even though the order has already been placed and paid for. The same vector can be triggered deliberately by an authenticated customer (keep the cart page open, complete checkout in another tab, then modify the \"cart\" to add quantity beyond what was paid for).\n\n### Patches\nThe issue is fixed in versions: 2.0.18, 2.1.15, 2.2.6 and above.\n\n### Workarounds\nIf users cannot update Sylius immediately, they should create a patched copy of the affected class in their application's `src/` directory and override the Sylius service definition to use it.\n\n#### Step 1. Create `src/Twig/Component/Cart/FormComponent.php`\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Twig\\Component\\Cart;\n\nuse Doctrine\\Persistence\\ObjectManager;\nuse Sylius\\Bundle\\UiBundle\\Twig\\Component\\ResourceFormComponentTrait;\nuse Sylius\\Bundle\\UiBundle\\Twig\\Component\\TemplatePropTrait;\nuse Sylius\\Component\\Core\\Model\\OrderInterface;\nuse Sylius\\Component\\Core\\OrderCheckoutStates;\nuse Sylius\\Component\\Core\\Repository\\OrderRepositoryInterface;\nuse Sylius\\Component\\Order\\SyliusCartEvents;\nuse Sylius\\Resource\\Model\\ResourceInterface;\nuse Symfony\\Component\\EventDispatcher\\EventDispatcherInterface;\nuse Symfony\\Component\\EventDispatcher\\GenericEvent;\nuse Symfony\\Component\\Form\\FormFactoryInterface;\nuse Symfony\\UX\\LiveComponent\\Attribute\\LiveAction;\nuse Symfony\\UX\\LiveComponent\\Attribute\\LiveArg;\nuse Symfony\\UX\\LiveComponent\\Attribute\\PreReRender;\nuse Symfony\\UX\\LiveComponent\\ComponentToolsTrait;\n\nclass FormComponent\n{\n use ComponentToolsTrait;\n\n /** @use ResourceFormComponentTrait<OrderInterface> */\n use ResourceFormComponentTrait;\n\n use TemplatePropTrait;\n\n public const SYLIUS_SHOP_CART_CHANGED = 'sylius:shop:cart_changed';\n\n public const SYLIUS_SHOP_CART_CLEARED = 'sylius:shop:cart_cleared';\n\n public bool $shouldSaveCart = true;\n\n /** @param OrderRepositoryInterface<OrderInterface> $orderRepository */\n public function __construct(\n OrderRepositoryInterface $orderRepository,\n FormFactoryInterface $formFactory,\n string $resourceClass,\n string $formClass,\n protected readonly ObjectManager $manager,\n protected readonly EventDispatcherInterface $eventDispatcher,\n ) {\n $this->initialize($orderRepository, $formFactory, $resourceClass, $formClass);\n }\n\n public function hydrateResource(mixed $value): ?ResourceInterface\n {\n if (empty($value)) {\n return $this->createResource();\n }\n\n /** @var OrderInterface|null $order */\n $order = $this->repository->find($value);\n\n if (\n !$order instanceof OrderInterface\n || $order->getCheckoutState() === OrderCheckoutStates::STATE_COMPLETED\n ) {\n return $this->createResource();\n }\n\n return $order;\n }\n\n #[PreReRender(priority: -100)]\n public function saveCart(): void\n {\n if ($this->shouldSaveCart && $this->resource?->getId() !== null) {\n $form = $this->getForm();\n if ($form->isValid()) {\n $this->eventDispatcher->dispatch(new GenericEvent($form->getData()), SyliusCartEvents::CART_CHANGE);\n $this->manager->flush();\n $this->emit(self::SYLIUS_SHOP_CART_CHANGED, ['cartId' => $this->resource->getId()]);\n }\n }\n }\n\n #[LiveAction]\n public function removeItem(#[LiveArg] int $index): void\n {\n if ($this->resource?->getId() === null) {\n return;\n }\n\n $data = $this->formValues['items'];\n unset($data[$index]);\n $this->formValues['items'] = array_values($data);\n\n $orderItem = $this->resource->getItems()->get($index);\n $this->eventDispatcher->dispatch(new GenericEvent($orderItem), SyliusCartEvents::CART_ITEM_REMOVE);\n\n $this->manager->persist($this->resource);\n $this->manager->flush();\n $this->manager->refresh($this->resource);\n\n $this->shouldSaveCart = false;\n $this->submitForm();\n $this->emit(self::SYLIUS_SHOP_CART_CHANGED, ['cartId' => $this->resource->getId()]);\n }\n\n #[LiveAction]\n public function clearCart(): void\n {\n if ($this->resource?->getId() === null) {\n return;\n }\n\n $this->formValues['items'] = [];\n $this->eventDispatcher->dispatch(new GenericEvent($this->resource), SyliusCartEvents::CART_CLEAR);\n $this->manager->remove($this->resource);\n $this->manager->flush();\n\n $this->resource = $this->createResource();\n $this->resetForm();\n $this->isValidated = false;\n $this->validatedFields = [];\n\n $this->shouldSaveCart = false;\n $this->submitForm();\n $this->emit(self::SYLIUS_SHOP_CART_CLEARED);\n }\n\n #[LiveAction]\n public function removeCoupon(): void\n {\n $this->formValues['promotionCoupon'] = '';\n\n $this->submitForm();\n }\n\n private function getDataModelValue(): string\n {\n return 'debounce(500)|*';\n }\n}\n```\n\n#### Step 2. Override the Sylius service in `config/services.yaml`\n\nAppend to the application's `config/services.yaml` (or a dedicated file loaded by the kernel, e.g. `config/packages/sylius_security_cart.yaml`):\n\n```yaml\nservices:\n sylius_shop.twig.component.cart.form:\n class: App\\Twig\\Component\\Cart\\FormComponent\n arguments:\n - '@sylius.repository.order'\n - '@form.factory'\n - '%sylius.model.order.class%'\n - 'Sylius\\Bundle\\ShopBundle\\Form\\Type\\CartType'\n - '@doctrine.orm.entity_manager'\n - '@event_dispatcher'\n calls:\n - [setLiveResponder, ['@ux.live_component.live_responder']]\n tags:\n - { name: sylius.live_component.shop, key: 'sylius_shop:cart:form' }\n```\n\nThis redeclares the existing Sylius service id `sylius_shop.twig.component.cart.form` so it instantiates the patched class from `App\\` while preserving every argument, call and tag from the original Sylius XML definition. The cart twig hook keeps resolving to the same Live Component key (`sylius_shop:cart:form`).\n\n#### Step 3. Clear the cache\n\n```bash\nbin/console cache:clear\n```\n\n### Reporters\n\nWe would like to extend our gratitude to the following individuals for their detailed reporting and responsible disclosure of this vulnerability:\n- Kévin Gonella (@kgonella)\n- Sam V.\n\n### For more information\n\nIf there are any questions or comments about this advisory:\n\n- Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)\n- Send an email to [security@sylius.com](mailto:security@sylius.com)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/sylius"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.18"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/sylius"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.1.15"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/sylius"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.2.0"
}, {
"fixed" : "2.2.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Sylius/Sylius/security/advisories/GHSA-5597-7rmh-97q5"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Sylius/Sylius"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-672", "CWE-841" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-09T21:03:41Z",
"nvd_published_at" : null
}
}