CVE-2026-31824: Sylius/sylius Sylius Has A Promotion Usage Vulnerability
HIGHCVE-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
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).
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.
Upgrade sylius/sylius to 1.9.12
Upgrade sylius/sylius to 1.10.16
Upgrade sylius/sylius to 1.11.17
Upgrade sylius/sylius to 1.12.23
Upgrade sylius/sylius to 1.13.15
Upgrade sylius/sylius to 1.14.18
Upgrade sylius/sylius to 2.0.16
Upgrade sylius/sylius to 2.1.12
Upgrade sylius/sylius to 2.2.3
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
CVE-2026-31824 Affected Sylius/sylius Versions
9 component(s)| 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?
Which Sylius/sylius versions are affected?
What version fixes CVE-2026-31824?
Is sylius/sylius affected?
What is the CVSS score of CVE-2026-31824?
What CWE is associated with CVE-2026-31824?
How can I check Packagist dependencies for CVE-2026-31824?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}