CVE-2026-31824: Sylius/sylius Sylius Has A Promotion Usage Vulnerability

HIGH
Advisory Identifier: GHSA-7mp4-25j8-hp5q
CVSS 8.2
CWE-362 CWE-367
Published
Advisory Summary

CVE-2026-31824 is a HIGH (CVSS 8.2) sylius has a promotion usage vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Sylius/sylius libraries in the Packagist ecosystem. The issue involves sylius has a promotion usage limit bypass via race condition. Remediation is available by upgrading affected packages to version 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3.

CVE-2026-31824 at a Glance

CVE Identifier CVE-2026-31824
GHSA Identifier GHSA-7mp4-25j8-hp5q
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Sylius/sylius
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2026-31824

To remediate this vulnerability, upgrade all affected Sylius/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: 1.9.12
Upgrade sylius/sylius to 1.9.12
sylius/sylius fixed: 1.10.16
Upgrade sylius/sylius to 1.10.16
sylius/sylius fixed: 1.11.17
Upgrade sylius/sylius to 1.11.17
sylius/sylius fixed: 1.12.23
Upgrade sylius/sylius to 1.12.23
sylius/sylius fixed: 1.13.15
Upgrade sylius/sylius to 1.13.15
sylius/sylius fixed: 1.14.18
Upgrade sylius/sylius to 1.14.18
sylius/sylius fixed: 2.0.16
Upgrade sylius/sylius to 2.0.16
sylius/sylius fixed: 2.1.12
Upgrade sylius/sylius to 2.1.12
sylius/sylius fixed: 2.2.3
Upgrade sylius/sylius to 2.2.3
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-31824, inspect your project dependencies for Sylius/sylius:

inspect dependencies for sylius/sylius

Analyze the terminal output to locate any version of Sylius/sylius in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.12), 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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In Sylius/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 Time-of-Check To Time-of-Use (TOCTOU) race condition was discovered in the promotion usage limit enforcement. The same class of vulnerability affects three independent limits: 1. **Promotion usage limit** - the global `used` counter on `Promotion` entities 2. **Coupon usage limit** - the global `used` counter on `PromotionCoupon` entities 3. **Coupon per-customer usage limit** - the per-customer redemption count on `PromotionCoupon` entities In all three cases, the eligibility check reads the `used` counter (or order count) from an in-memory Doctrine entity during validation, while the actual usage increment in `OrderPromotionsUsageModifier` happens later during order completion — with no database-level locking or atomic operations between the two phases. Because Doctrine flushes an absolute value (`SET used = 1`) rather than an atomic increment (`SET used = used + 1`), and because the affected entities lack optimistic locking, concurrent requests all read the same stale usage counts and pass the eligibility checks simultaneously. An attacker can exploit this by preparing multiple carts with the same limited-use promotion or coupon and firing simultaneous `PATCH /api/v2/shop/orders/{token}/complete` requests. All requests pass the usage limit checks and complete successfully, allowing a single-use promotion or coupon to be redeemed an arbitrary number of times. The per-customer limit can be bypassed in the same way by a single customer completing multiple orders concurrently. No authentication is required to exploit this vulnerability. This may lead to direct financial loss through unlimited redemption of limited-use promotions and discount coupons. ### Patches The issue is fixed in versions: 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 and above. ### Workarounds Decoration of the `OrderPromotionsUsageModifier` service to use atomic operations based on actual database-synchronized values. The decorated service id in Sylius >=2.0 is `sylius.modifier.promotion.order_usage`, while <2.0 it's `sylius.promotion_usage_modifier`; The following instruction uses the latter, but it needs to be changed depending on the Sylius version. #### Step 1. Create the decorator service `src/Modifier/AtomicOrderPromotionsUsageModifier.php`: ```php <?php declare(strict_types=1); namespace App\Modifier; use Doctrine\DBAL\Connection; use Doctrine\ORM\OptimisticLockException; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\PromotionCouponInterface; use Sylius\Component\Core\Promotion\Modifier\OrderPromotionsUsageModifierInterface; use Sylius\Component\Promotion\Model\PromotionInterface; // use Symfony\Component\DependencyInjection\Attribute\AsDecorator; // #[AsDecorator(decorates: 'sylius.promotion_usage_modifier')] final class AtomicOrderPromotionsUsageModifier implements OrderPromotionsUsageModifierInterface { /** @var Connection */ private $connection; public function __construct(Connection $connection) { $this->connection = $connection; } public function increment(OrderInterface $order): void { foreach ($order->getPromotions() as $promotion) { $this->incrementPromotionUsage($promotion); } /** @var PromotionCouponInterface|null $coupon */ $coupon = $order->getPromotionCoupon(); if (null === $coupon) { return; } $this->incrementCouponUsage($coupon, $order); } public function decrement(OrderInterface $order): void { foreach ($order->getPromotions() as $promotion) { $this->decrementPromotionUsage($promotion); } /** @var PromotionCouponInterface|null $coupon */ $coupon = $order->getPromotionCoupon(); if (null === $coupon) { return; } if (OrderInterface::STATE_CANCELLED === $order->getState() && !$coupon->isReusableFromCancelledOrders()) { return; } $this->decrementCouponUsage($coupon); } private function incrementPromotionUsage(PromotionInterface $promotion): void { $affected = $this->doExecuteStatement( 'UPDATE sylius_promotion SET used = used + 1 WHERE id = :id AND (usage_limit IS NULL OR used < usage_limit)', ['id' => $promotion->getId()] ); if (0 === $affected) { throw new OptimisticLockException(sprintf('Promotion "%s" is no longer applicable.', $promotion->getCode()), $promotion); } $newUsed = (int) $this->doFetchOne( 'SELECT used FROM sylius_promotion WHERE id = :id', ['id' => $promotion->getId()] ); $promotion->setUsed($newUsed); } private function decrementPromotionUsage(PromotionInterface $promotion): void { $this->doExecuteStatement( 'UPDATE sylius_promotion SET used = GREATEST(used - 1, 0) WHERE id = :id', ['id' => $promotion->getId()] ); $newUsed = (int) $this->doFetchOne( 'SELECT used FROM sylius_promotion WHERE id = :id', ['id' => $promotion->getId()] ); $promotion->setUsed($newUsed); } private function incrementCouponUsage(PromotionCouponInterface $coupon, OrderInterface $order): void { $row = $this->doFetchAssociative( 'SELECT used, usage_limit, per_customer_usage_limit FROM sylius_promotion_coupon WHERE id = :id FOR UPDATE', ['id' => $coupon->getId()] ); if (false === $row) { throw new OptimisticLockException(sprintf('Promotion coupon "%s" is no longer applicable.', $coupon->getCode()), $coupon); } if (null !== $row['usage_limit'] && (int) $row['used'] >= (int) $row['usage_limit']) { throw new OptimisticLockException(sprintf('Promotion coupon "%s" is no longer applicable.', $coupon->getCode()), $coupon); } if (null !== $row['per_customer_usage_limit']) { $this->assertPerCustomerCouponUsageLimitNotReached( $coupon, $order, (int) $row['per_customer_usage_limit'] ); } $this->doExecuteStatement( 'UPDATE sylius_promotion_coupon SET used = used + 1 WHERE id = :id', ['id' => $coupon->getId()] ); $coupon->setUsed((int) $row['used'] + 1); } private function assertPerCustomerCouponUsageLimitNotReached( PromotionCouponInterface $coupon, OrderInterface $order, int $perCustomerUsageLimit ): void { $customer = $order->getCustomer(); if (null === $customer || null === $customer->getId()) { return; } $sql = 'SELECT o.id FROM sylius_order o WHERE o.customer_id = :customerId AND o.promotion_coupon_id = :couponId AND o.state != :stateCart'; $params = [ 'customerId' => $customer->getId(), 'couponId' => $coupon->getId(), 'stateCart' => OrderInterface::STATE_CART, ]; if ($coupon->isReusableFromCancelledOrders()) { $sql .= ' AND o.state != :stateCancelled'; $params['stateCancelled'] = OrderInterface::STATE_CANCELLED; } $sql .= ' FOR UPDATE'; $count = count($this->doFetchAllAssociative($sql, $params)); if ($count >= $perCustomerUsageLimit) { throw new OptimisticLockException(sprintf('Promotion coupon "%s" is no longer applicable.', $coupon->getCode()), $coupon); } } private function decrementCouponUsage(PromotionCouponInterface $coupon): void { $this->doExecuteStatement( 'UPDATE sylius_promotion_coupon SET used = GREATEST(used - 1, 0) WHERE id = :id', ['id' => $coupon->getId()] ); $newUsed = (int) $this->doFetchOne( 'SELECT used FROM sylius_promotion_coupon WHERE id = :id', ['id' => $coupon->getId()] ); $coupon->setUsed($newUsed); } /** @return int Number of affected rows */ private function doExecuteStatement(string $sql, array $params): int { if (method_exists($this->connection, 'executeStatement')) { return $this->connection->executeStatement($sql, $params); } return $this->connection->executeUpdate($sql, $params); } /** @return mixed|false */ private function doFetchOne(string $sql, array $params) { if (method_exists($this->connection, 'fetchOne')) { return $this->connection->fetchOne($sql, $params); } return $this->connection->fetchColumn($sql, $params); } /** @return array|false */ private function doFetchAssociative(string $sql, array $params) { if (method_exists($this->connection, 'fetchAssociative')) { return $this->connection->fetchAssociative($sql, $params); } return $this->connection->fetchAssoc($sql, $params); } /** @return array[] */ private function doFetchAllAssociative(string $sql, array $params): array { if (method_exists($this->connection, 'fetchAllAssociative')) { return $this->connection->fetchAllAssociative($sql, $params); } return $this->connection->fetchAll($sql, $params); } } ``` #### Step 2. Register the service **Option A:** If your app uses autowiring and supports the `#[AsDecorator]` attribute, uncomment it in the class and no further configuration is necessary. **Option B:** Manually register the service in `config/services.yaml`: ```yaml services: App\Modifier\AtomicOrderPromotionsUsageModifier: decorates: 'sylius.promotion_usage_modifier' arguments: ['@doctrine.dbal.default_connection'] ``` #### Step 3. Update exception mapping (optional) Check if your `api_platform` configuration maps `OptimisticLockException` to a code and update it if not: ```yaml api_platform: ... exception_to_status: ... Doctrine\ORM\OptimisticLockException: 409 ``` #### Step 4. Clear 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: - Djibril Mounkoro (@whiteov3rflow) - Bartłomiej Nowiński (@bnBart) ### For more information If you have any questions or comments about this advisory: - Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues) - Email us at [security@sylius.com](mailto:security@sylius.com)

CVE-2026-31824 Affected Sylius/sylius Versions

9 component(s)
Fixed Versions:
1.9.121.10.161.11.171.12.231.13.151.14.182.0.162.1.122.2.3
Product / Package Ecosystem Affected Versions Fixed Version
sylius/sylius
Packagist
< 1.9.12
1.9.12
sylius/sylius
Packagist
≥ 1.10.0
< 1.10.16
1.10.16
sylius/sylius
Packagist
≥ 1.11.0
< 1.11.17
1.11.17
sylius/sylius
Packagist
≥ 1.12.0
< 1.12.23
1.12.23
sylius/sylius
Packagist
≥ 1.13.0
< 1.13.15
1.13.15
sylius/sylius
Packagist
≥ 1.14.0
< 1.14.18
1.14.18
sylius/sylius
Packagist
≥ 2.0.0
< 2.0.16
2.0.16
sylius/sylius
Packagist
≥ 2.1.0
< 2.1.12
2.1.12
sylius/sylius
Packagist
≥ 2.2.0
< 2.2.3
2.2.3

References

Frequently Asked Questions

What is CVE-2026-31824?
CVE-2026-31824 is a security vulnerability in Sylius/sylius involving Sylius has a Promotion Usage Limit Bypass via Race Condition under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Sylius/sylius versions are affected?
Affected versions include releases prior to 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 across affected packages: sylius/sylius.
What version fixes CVE-2026-31824?
Upgrading to 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 (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 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3. Upgrade your dependency to 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 or later.
What is the CVSS score of CVE-2026-31824?
CVE-2026-31824 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L.
What CWE is associated with CVE-2026-31824?
CVE-2026-31824 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check Packagist dependencies for CVE-2026-31824?
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-7mp4-25j8-hp5q",
  "modified" : "2026-03-11T20:33:38Z",
  "published" : "2026-03-11T00:13:29Z",
  "aliases" : [ "CVE-2026-31824" ],
  "summary" : "Sylius has a Promotion Usage Limit Bypass via Race Condition",
  "details" : "### Impact\nA Time-of-Check To Time-of-Use (TOCTOU) race condition was discovered in the promotion usage limit enforcement. The same class of vulnerability affects three independent limits:\n\n1. **Promotion usage limit** - the global `used` counter on `Promotion` entities\n2. **Coupon usage limit** - the global `used` counter on `PromotionCoupon` entities\n3. **Coupon per-customer usage limit** - the per-customer redemption count on `PromotionCoupon` entities\n\nIn all three cases, the eligibility check reads the `used` counter (or order count) from an in-memory Doctrine entity during validation, while the actual usage increment in `OrderPromotionsUsageModifier` happens later during order completion — with no database-level locking or atomic operations between the two phases.\n\nBecause Doctrine flushes an absolute value (`SET used = 1`) rather than an atomic increment (`SET used = used + 1`), and because the affected entities lack optimistic locking, concurrent requests all read the same stale usage counts and pass the eligibility checks simultaneously.\n\nAn attacker can exploit this by preparing multiple carts with the same limited-use promotion or coupon and firing simultaneous `PATCH /api/v2/shop/orders/{token}/complete` requests. All requests pass the usage limit checks and complete successfully, allowing a single-use promotion or coupon to be redeemed an arbitrary number of times. The per-customer limit can be bypassed in the same way by a single customer completing multiple orders concurrently. No authentication is required to exploit this vulnerability.\n\nThis may lead to direct financial loss through unlimited redemption of limited-use promotions and discount coupons.\n\n### Patches\nThe issue is fixed in versions: 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 and above.\n\n### Workarounds\n\nDecoration of the `OrderPromotionsUsageModifier` service to use atomic operations based on actual database-synchronized values.\n\nThe decorated service id in Sylius >=2.0 is `sylius.modifier.promotion.order_usage`, while <2.0 it's `sylius.promotion_usage_modifier`; The following instruction uses the latter, but it needs to be changed depending on the Sylius version.\n\n#### Step 1. Create the decorator service\n\n`src/Modifier/AtomicOrderPromotionsUsageModifier.php`:\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Modifier;\n\nuse Doctrine\\DBAL\\Connection;\nuse Doctrine\\ORM\\OptimisticLockException;\nuse Sylius\\Component\\Core\\Model\\OrderInterface;\nuse Sylius\\Component\\Core\\Model\\PromotionCouponInterface;\nuse Sylius\\Component\\Core\\Promotion\\Modifier\\OrderPromotionsUsageModifierInterface;\nuse Sylius\\Component\\Promotion\\Model\\PromotionInterface;\n// use Symfony\\Component\\DependencyInjection\\Attribute\\AsDecorator;\n\n// #[AsDecorator(decorates: 'sylius.promotion_usage_modifier')]\nfinal class AtomicOrderPromotionsUsageModifier implements OrderPromotionsUsageModifierInterface\n{\n    /** @var Connection */\n    private $connection;\n\n    public function __construct(Connection $connection)\n    {\n        $this->connection = $connection;\n    }\n\n    public function increment(OrderInterface $order): void\n    {\n        foreach ($order->getPromotions() as $promotion) {\n            $this->incrementPromotionUsage($promotion);\n        }\n\n        /** @var PromotionCouponInterface|null $coupon */\n        $coupon = $order->getPromotionCoupon();\n        if (null === $coupon) {\n            return;\n        }\n\n        $this->incrementCouponUsage($coupon, $order);\n    }\n\n    public function decrement(OrderInterface $order): void\n    {\n        foreach ($order->getPromotions() as $promotion) {\n            $this->decrementPromotionUsage($promotion);\n        }\n\n        /** @var PromotionCouponInterface|null $coupon */\n        $coupon = $order->getPromotionCoupon();\n        if (null === $coupon) {\n            return;\n        }\n\n        if (OrderInterface::STATE_CANCELLED === $order->getState() && !$coupon->isReusableFromCancelledOrders()) {\n            return;\n        }\n\n        $this->decrementCouponUsage($coupon);\n    }\n\n    private function incrementPromotionUsage(PromotionInterface $promotion): void\n    {\n        $affected = $this->doExecuteStatement(\n            'UPDATE sylius_promotion\n             SET used = used + 1\n             WHERE id = :id AND (usage_limit IS NULL OR used < usage_limit)',\n            ['id' => $promotion->getId()]\n        );\n\n        if (0 === $affected) {\n            throw new OptimisticLockException(sprintf('Promotion \"%s\" is no longer applicable.', $promotion->getCode()), $promotion);\n        }\n\n        $newUsed = (int) $this->doFetchOne(\n            'SELECT used FROM sylius_promotion WHERE id = :id',\n            ['id' => $promotion->getId()]\n        );\n\n        $promotion->setUsed($newUsed);\n    }\n\n    private function decrementPromotionUsage(PromotionInterface $promotion): void\n    {\n        $this->doExecuteStatement(\n            'UPDATE sylius_promotion SET used = GREATEST(used - 1, 0) WHERE id = :id',\n            ['id' => $promotion->getId()]\n        );\n\n        $newUsed = (int) $this->doFetchOne(\n            'SELECT used FROM sylius_promotion WHERE id = :id',\n            ['id' => $promotion->getId()]\n        );\n\n        $promotion->setUsed($newUsed);\n    }\n\n    private function incrementCouponUsage(PromotionCouponInterface $coupon, OrderInterface $order): void\n    {\n        $row = $this->doFetchAssociative(\n            'SELECT used, usage_limit, per_customer_usage_limit FROM sylius_promotion_coupon WHERE id = :id FOR UPDATE',\n            ['id' => $coupon->getId()]\n        );\n\n        if (false === $row) {\n            throw new OptimisticLockException(sprintf('Promotion coupon \"%s\" is no longer applicable.', $coupon->getCode()), $coupon);\n        }\n\n        if (null !== $row['usage_limit'] && (int) $row['used'] >= (int) $row['usage_limit']) {\n            throw new OptimisticLockException(sprintf('Promotion coupon \"%s\" is no longer applicable.', $coupon->getCode()), $coupon);\n        }\n\n        if (null !== $row['per_customer_usage_limit']) {\n            $this->assertPerCustomerCouponUsageLimitNotReached(\n                $coupon,\n                $order,\n                (int) $row['per_customer_usage_limit']\n            );\n        }\n\n        $this->doExecuteStatement(\n            'UPDATE sylius_promotion_coupon SET used = used + 1 WHERE id = :id',\n            ['id' => $coupon->getId()]\n        );\n\n        $coupon->setUsed((int) $row['used'] + 1);\n    }\n\n    private function assertPerCustomerCouponUsageLimitNotReached(\n        PromotionCouponInterface $coupon,\n        OrderInterface $order,\n        int $perCustomerUsageLimit\n    ): void {\n        $customer = $order->getCustomer();\n        if (null === $customer || null === $customer->getId()) {\n            return;\n        }\n\n        $sql = 'SELECT o.id FROM sylius_order o\n                WHERE o.customer_id = :customerId\n                AND o.promotion_coupon_id = :couponId\n                AND o.state != :stateCart';\n        $params = [\n            'customerId' => $customer->getId(),\n            'couponId' => $coupon->getId(),\n            'stateCart' => OrderInterface::STATE_CART,\n        ];\n\n        if ($coupon->isReusableFromCancelledOrders()) {\n            $sql .= ' AND o.state != :stateCancelled';\n            $params['stateCancelled'] = OrderInterface::STATE_CANCELLED;\n        }\n\n        $sql .= ' FOR UPDATE';\n\n        $count = count($this->doFetchAllAssociative($sql, $params));\n\n        if ($count >= $perCustomerUsageLimit) {\n            throw new OptimisticLockException(sprintf('Promotion coupon \"%s\" is no longer applicable.', $coupon->getCode()), $coupon);\n        }\n    }\n\n    private function decrementCouponUsage(PromotionCouponInterface $coupon): void\n    {\n        $this->doExecuteStatement(\n            'UPDATE sylius_promotion_coupon SET used = GREATEST(used - 1, 0) WHERE id = :id',\n            ['id' => $coupon->getId()]\n        );\n\n        $newUsed = (int) $this->doFetchOne(\n            'SELECT used FROM sylius_promotion_coupon WHERE id = :id',\n            ['id' => $coupon->getId()]\n        );\n\n        $coupon->setUsed($newUsed);\n    }\n\n    /** @return int Number of affected rows */\n    private function doExecuteStatement(string $sql, array $params): int\n    {\n        if (method_exists($this->connection, 'executeStatement')) {\n            return $this->connection->executeStatement($sql, $params);\n        }\n\n        return $this->connection->executeUpdate($sql, $params);\n    }\n\n    /** @return mixed|false */\n    private function doFetchOne(string $sql, array $params)\n    {\n        if (method_exists($this->connection, 'fetchOne')) {\n            return $this->connection->fetchOne($sql, $params);\n        }\n\n        return $this->connection->fetchColumn($sql, $params);\n    }\n\n    /** @return array|false */\n    private function doFetchAssociative(string $sql, array $params)\n    {\n        if (method_exists($this->connection, 'fetchAssociative')) {\n            return $this->connection->fetchAssociative($sql, $params);\n        }\n\n        return $this->connection->fetchAssoc($sql, $params);\n    }\n\n    /** @return array[] */\n    private function doFetchAllAssociative(string $sql, array $params): array\n    {\n        if (method_exists($this->connection, 'fetchAllAssociative')) {\n            return $this->connection->fetchAllAssociative($sql, $params);\n        }\n\n        return $this->connection->fetchAll($sql, $params);\n    }\n}\n```\n\n#### Step 2. Register the service\n\n**Option A:** If your app uses autowiring and supports the `#[AsDecorator]` attribute, uncomment it in the class and no further configuration is necessary.\n\n**Option B:** Manually register the service in `config/services.yaml`:\n\n```yaml\nservices:\n    App\\Modifier\\AtomicOrderPromotionsUsageModifier:\n        decorates: 'sylius.promotion_usage_modifier'\n        arguments: ['@doctrine.dbal.default_connection']\n```\n\n#### Step 3. Update exception mapping (optional)\n\nCheck if your `api_platform` configuration maps `OptimisticLockException` to a code and update it if not:\n```yaml\napi_platform:\n    ...\n    exception_to_status:\n        ...\n        Doctrine\\ORM\\OptimisticLockException: 409\n```\n\n#### Step 4. Clear 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- Djibril Mounkoro (@whiteov3rflow)\n- Bartłomiej Nowiński (@bnBart)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues)\n- Email us at [security@sylius.com](mailto:security@sylius.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.9.11"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.10.0"
      }, {
        "fixed" : "1.10.16"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.10.15"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.11.0"
      }, {
        "fixed" : "1.11.17"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.11.16"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.12.0"
      }, {
        "fixed" : "1.12.23"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.12.22"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.13.0"
      }, {
        "fixed" : "1.13.15"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.13.14"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.14.0"
      }, {
        "fixed" : "1.14.18"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.14.17"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.16"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.15"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.1.11"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.2.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.2.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Sylius/Sylius/security/advisories/GHSA-7mp4-25j8-hp5q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-31824"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Sylius/Sylius"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362", "CWE-367" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-11T00:13:29Z",
    "nvd_published_at" : "2026-03-10T22:16:20Z"
  }
}