CVE-2026-29172: Craftcms/commerce Remote Code Execution Vulnerability
HIGHCVE-2026-29172 is a HIGH remote code execution vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Craftcms/commerce libraries in the Packagist ecosystem. The issue involves craft commerce is vulnerable to sql injection in commerce purchasables table sorting. Remediation is available by upgrading affected packages to version 4.10.2, 5.5.3.
CVE-2026-29172 at a Glance
How to Fix CVE-2026-29172
To remediate this vulnerability, upgrade all affected Craftcms/commerce 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 craftcms/commerce to 4.10.2
Upgrade craftcms/commerce to 5.5.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for craftcms/commerce
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-29172, inspect your project dependencies for Craftcms/commerce:
inspect dependencies for craftcms/commerce
Analyze the terminal output to locate any version of Craftcms/commerce in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.10.2), 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-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Craftcms/commerce, 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-29172 Affected Craftcms/commerce Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
craftcms/commerce
|
Packagist |
≥ 4.0.0
< 4.10.2
|
4.10.2
|
|
craftcms/commerce
|
Packagist |
≥ 5.0.0
< 5.5.3
|
5.5.3
|
References
Frequently Asked Questions
What is CVE-2026-29172?
Which Craftcms/commerce versions are affected?
What version fixes CVE-2026-29172?
Is craftcms/commerce affected?
What CWE is associated with CVE-2026-29172?
How can I check Packagist dependencies for CVE-2026-29172?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j3x5-mghf-xvfw",
"modified" : "2026-03-10T22:55:11Z",
"published" : "2026-03-10T18:23:07Z",
"aliases" : [ "CVE-2026-29172" ],
"summary" : "Craft Commerce is Vulnerable to SQL Injection in Commerce Purchasables Table Sorting",
"details" : "## Summary\nCraft Commerce is vulnerable to **SQL Injection** in the purchasables table endpoint. The `sort` parameter is split by `|` and the first part (column name) is passed directly as an array key to `orderBy()` without whitelist validation. Yii2's query builder does **NOT** escape array keys, allowing an authenticated attacker to inject arbitrary SQL into the `ORDER BY` clause.\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 orders\n\t- Edit orders\n\n### Steps to reproduce\n1. Log in to the control panel\n2. Navigate to **Commerce** > **Orders** > Create a new order\n3. Click on \"Add a line item\" to show the purchasables table\n4. Intercept the AJAX request and modify the `sort` parameter as follows:\n```http\nGET /index.php?p=admin/actions/commerce/orders/purchasables-table&siteId=1&sort=id,(SELECT%20SLEEP(2))|asc\n```\n5. 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\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%2Factions%2Fcommerce%2Forders%2Fpurchasables-table&siteId=1&sort=id,(SELECT%20SLEEP(5))|asc'\n```\n\n### Impact\nWith this Blind SQLi, an attacker can:\n- **Exfiltrate data** character-by-character (same technique as [GHSA-pmgj-gmm4-jh6j](https://github.com/craftcms/commerce/security/advisories/GHSA-pmgj-gmm4-jh6j)).\n- **Modify or destroy data** (drop tables, update records, alter schema).",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "craftcms/commerce"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.10.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.10.1"
}
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "craftcms/commerce"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.5.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.5.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/craftcms/commerce/security/advisories/GHSA-j3x5-mghf-xvfw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-29172"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/commerce/commit/b231b920b73db023e81e5b261b894d73e865c276"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/commerce/commit/e4e0f4107cd895d29290523637f077fe280407b1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/craftcms/commerce"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-10T18:23:07Z",
"nvd_published_at" : "2026-03-10T20:16:38Z"
}
}