6.3medium
Craft Commerce has a Potential IDOR in Commerce carts
- Severity
- 6.3medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.29% (higher than 23% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-vff3-pqq8-4cpq
Description
Craft Commerce is an ecommerce platform for Craft CMS. Prior to 4.11.0 and 5.6.0, An Insecure Direct Object Reference (IDOR) vulnerability exists in Craft Commerce’s cart functionality that allows users to hijack any shopping cart by knowing or guessing its 32-character number. The CartController accepts a user-supplied number parameter to load and modify shopping carts. No ownership validation is performed - the code only checks if the order exists and is incomplete, not whether the requester has authorization to access it. This vulnerability enables the takeover of shopping sessions and potential exposure of PII. This vulnerability is fixed in 4.11.0 and 5.6.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| craftcms commerce | >= 4.0.0, < 4.11.0, >= 5.0.0, < 5.6.0 | CVE List |
| craftcms/commerce (Packagist) | from 5.0.0 before 5.6.0, from 4.0.0 before 4.11.0 | GitHub Advisory Database |
| craftcms craft_commerce | from 4.0.0 before 4.11.0, from 5.0.0 before 5.6.0 | NVD |
All scores
| GitHub_M | 6.3medium CVSS:4.0 | CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N |
| NVD | 4.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Craft Commerce is an ecommerce platform for Craft CMS. Prior to 4.11.0 and 5.6.0, An Insecure Direct Object Reference (IDOR) vulnerability exists in Craft Commerce’s cart functionality that allows users to hijack any shopping cart by knowing or guessing its 32-character number. The CartController accepts a user-supplied number parameter to load and modify shopping carts. No ownership validation is performed - the code only checks if the order exists and is incomplete, not whether the requester has authorization to access it. This vulnerability enables the takeover of shopping sessions and potential exposure of PII. This vulnerability is fixed in 4.11.0 and 5.6.0.
GitHub Advisory Database
An Insecure Direct Object Reference (IDOR) vulnerability exists in Craft Commerce’s cart functionality that allows users to hijack any shopping cart by knowing or guessing its 32-character number. This vulnerability enables the takeover of shopping sessions and potential exposure of PII.
Vulnerability Details
Root Cause
The CartController accepts a user-supplied number parameter to load and modify shopping carts. No ownership validation is performed - the code only checks if the order exists and is incomplete, not whether the requester has authorization to access it.
// CartController.php:374-389 - actionLoadCart()
public function actionLoadCart(): ?Response
{
$number = $this->request->getParam('number');
if ($number === null) {
return $this->asFailure(Craft::t('commerce', 'A cart number must be specified.'));
}
// No ownership check - returns any cart to any requester
$cart = Order::find()->number($number)->isCompleted(false)->one();
// Cart is loaded into attacker's session without authorization
...
}
// CartController.php:606-616 - _getCart()
$orderNumber = $this->request->getBodyParam('number');
if ($orderNumber) {
// Same issue - no ownership validation
$cart = Order::find()->number($orderNumber)->isCompleted(false)->one();
// Returns cart to any requester who knows the number
}
Attack Scenario
Prerequisites
- Target Craft Commerce installation with active shopping carts
- Knowledge of a victim’s cart number (32-character hex string)
Cart Number Acquisition Vectors
- Referrer Header Leakage: Cart URLs shared externally expose the number
- Browser History: Accessible on shared/compromised devices
- Proxy/WAF Logs: Cart numbers logged in URL parameters
- Social Engineering: Support tickets, screenshots containing cart URLs
- Brute Force: While impractical for random targeting, feasible for targeted attacks against recently-created carts
NVD (es)
Craft Commerce es una plataforma de comercio electrónico para Craft CMS. Antes de las versiones 4.11.0 y 5.6.0, existe una vulnerabilidad de Referencia Directa a Objeto Insegura (IDOR) en la funcionalidad del carrito de Craft Commerce que permite a los usuarios secuestrar cualquier carrito de compras al conocer o adivinar su número de 32 caracteres. El CartController acepta un parámetro de número proporcionado por el usuario para cargar y modificar carritos de compras. No se realiza ninguna validación de propiedad; el código solo verifica si el pedido existe y está incompleto, no si el solicitante tiene autorización para acceder a él. Esta vulnerabilidad permite la toma de control de sesiones de compra y la exposición potencial de PII. Esta vulnerabilidad está corregida en las versiones 4.11.0 y 5.6.0.
References
| https://github.com/craftcms/commerce/security/advisories/GHSA-vff3-pqq8-4cpq | exploit, patch, vendor-advisory, web | |
| https://github.com/craftcms/commerce/pull/4207 | issue-tracking, patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-31867 | advisory | |
| https://github.com/craftcms/commerce | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-31867 changed 2026-03-12 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-vff3-pqq8-4cpq changed 2026-03-13 | CC-BY-4.0 |
| NVD | CVE-2026-31867 changed 2026-06-17 | Public domain |