CVE-2026-53637: Sylius Cart FormComponent Allows Modification Or Vulnerability

MODERATE
Advisory Identifier: GHSA-5597-7rmh-97q5
CVSS 6.5
CWE-841 CWE-672
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-53637
GHSA Identifier GHSA-5597-7rmh-97q5
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-841: Improper Enforcement of Behavioral Workflow
Affected Product Sylius
Package Ecosystem Packagist
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (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.

sylius/sylius fixed: 2.0.18
Upgrade sylius/sylius to 2.0.18
sylius/sylius fixed: 2.1.15
Upgrade sylius/sylius to 2.1.15
sylius/sylius fixed: 2.2.6
Upgrade sylius/sylius to 2.2.6
Verify Direct and Transitive Dependencies

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

### Impact A 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. If the user then: - **clears the cart** → `clearCart()` calls `manager->remove()` on the completed order: the order is permanently **deleted** from the database; - **removes a product** → `removeItem()` mutates an item on the completed order; - **changes quantity** → `saveCart()` overwrites data on the completed order. In 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). ### Patches The issue is fixed in versions: 2.0.18, 2.1.15, 2.2.6 and above. ### Workarounds If 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. #### Step 1. Create `src/Twig/Component/Cart/FormComponent.php` ```php <?php declare(strict_types=1); namespace App\Twig\Component\Cart; use Doctrine\Persistence\ObjectManager; use Sylius\Bundle\UiBundle\Twig\Component\ResourceFormComponentTrait; use Sylius\Bundle\UiBundle\Twig\Component\TemplatePropTrait; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\OrderCheckoutStates; use Sylius\Component\Core\Repository\OrderRepositoryInterface; use Sylius\Component\Order\SyliusCartEvents; use Sylius\Resource\Model\ResourceInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; use Symfony\Component\Form\FormFactoryInterface; use Symfony\UX\LiveComponent\Attribute\LiveAction; use Symfony\UX\LiveComponent\Attribute\LiveArg; use Symfony\UX\LiveComponent\Attribute\PreReRender; use Symfony\UX\LiveComponent\ComponentToolsTrait; class FormComponent { use ComponentToolsTrait; /** @use ResourceFormComponentTrait<OrderInterface> */ use ResourceFormComponentTrait; use TemplatePropTrait; public const SYLIUS_SHOP_CART_CHANGED = 'sylius:shop:cart_changed'; public const SYLIUS_SHOP_CART_CLEARED = 'sylius:shop:cart_cleared'; public bool $shouldSaveCart = true; /** @param OrderRepositoryInterface<OrderInterface> $orderRepository */ public function __construct( OrderRepositoryInterface $orderRepository, FormFactoryInterface $formFactory, string $resourceClass, string $formClass, protected readonly ObjectManager $manager, protected readonly EventDispatcherInterface $eventDispatcher, ) { $this->initialize($orderRepository, $formFactory, $resourceClass, $formClass); } public function hydrateResource(mixed $value): ?ResourceInterface { if (empty($value)) { return $this->createResource(); } /** @var OrderInterface|null $order */ $order = $this->repository->find($value); if ( !$order instanceof OrderInterface || $order->getCheckoutState() === OrderCheckoutStates::STATE_COMPLETED ) { return $this->createResource(); } return $order; } #[PreReRender(priority: -100)] public function saveCart(): void { if ($this->shouldSaveCart && $this->resource?->getId() !== null) { $form = $this->getForm(); if ($form->isValid()) { $this->eventDispatcher->dispatch(new GenericEvent($form->getData()), SyliusCartEvents::CART_CHANGE); $this->manager->flush(); $this->emit(self::SYLIUS_SHOP_CART_CHANGED, ['cartId' => $this->resource->getId()]); } } } #[LiveAction] public function removeItem(#[LiveArg] int $index): void { if ($this->resource?->getId() === null) { return; } $data = $this->formValues['items']; unset($data[$index]); $this->formValues['items'] = array_values($data); $orderItem = $this->resource->getItems()->get($index); $this->eventDispatcher->dispatch(new GenericEvent($orderItem), SyliusCartEvents::CART_ITEM_REMOVE); $this->manager->persist($this->resource); $this->manager->flush(); $this->manager->refresh($this->resource); $this->shouldSaveCart = false; $this->submitForm(); $this->emit(self::SYLIUS_SHOP_CART_CHANGED, ['cartId' => $this->resource->getId()]); } #[LiveAction] public function clearCart(): void { if ($this->resource?->getId() === null) { return; } $this->formValues['items'] = []; $this->eventDispatcher->dispatch(new GenericEvent($this->resource), SyliusCartEvents::CART_CLEAR); $this->manager->remove($this->resource); $this->manager->flush(); $this->resource = $this->createResource(); $this->resetForm(); $this->isValidated = false; $this->validatedFields = []; $this->shouldSaveCart = false; $this->submitForm(); $this->emit(self::SYLIUS_SHOP_CART_CLEARED); } #[LiveAction] public function removeCoupon(): void { $this->formValues['promotionCoupon'] = ''; $this->submitForm(); } private function getDataModelValue(): string { return 'debounce(500)|*'; } } ``` #### Step 2. Override the Sylius service in `config/services.yaml` Append to the application's `config/services.yaml` (or a dedicated file loaded by the kernel, e.g. `config/packages/sylius_security_cart.yaml`): ```yaml services: sylius_shop.twig.component.cart.form: class: App\Twig\Component\Cart\FormComponent arguments: - '@sylius.repository.order' - '@form.factory' - '%sylius.model.order.class%' - 'Sylius\Bundle\ShopBundle\Form\Type\CartType' - '@doctrine.orm.entity_manager' - '@event_dispatcher' calls: - [setLiveResponder, ['@ux.live_component.live_responder']] tags: - { name: sylius.live_component.shop, key: 'sylius_shop:cart:form' } ``` This 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`). #### Step 3. Clear the cache ```bash bin/console cache:clear ``` ### Reporters We would like to extend our gratitude to the following individuals for their detailed reporting and responsible disclosure of this vulnerability: - Kévin Gonella (@kgonella) - Sam V. ### For more information If there are any questions or comments about this advisory: - Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen) - Send an email to [security@sylius.com](mailto:security@sylius.com)

CVE-2026-53637 Affected Sylius Versions

3 component(s)
Fixed Versions:
2.0.182.1.152.2.6
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?
CVE-2026-53637 is a security vulnerability in Sylius involving Cart FormComponent allows modification or deletion of an already-completed order under CWE-841: Improper Enforcement of Behavioral Workflow.
Which Sylius versions are affected?
Affected versions include releases prior to 2.0.18, 2.1.15, 2.2.6 across affected packages: sylius/sylius.
What version fixes CVE-2026-53637?
Upgrading to 2.0.18, 2.1.15, 2.2.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sylius/sylius affected?
Yes, sylius/sylius is affected in releases prior to 2.0.18, 2.1.15, 2.2.6. Upgrade your dependency to 2.0.18, 2.1.15, 2.2.6 or later.
What is the CVSS score of CVE-2026-53637?
CVE-2026-53637 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-53637?
CVE-2026-53637 is classified under CWE-841: Improper Enforcement of Behavioral Workflow (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.).
How can I check Packagist dependencies for CVE-2026-53637?
Run the dependency tree command: 'inspect dependencies for sylius/sylius'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}