CVE-2026-32272: Craftcms/commerce Remote Code Execution Vulnerability
HIGHCVE-2026-32272 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 hasvariant/hasproduct blind sql injection. Remediation is available by upgrading affected packages to version 5.6.0.
CVE-2026-32272 at a Glance
How to Fix CVE-2026-32272
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 5.6.0
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-32272, 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 5.6.0), 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-32272 Affected Craftcms/commerce Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
craftcms/commerce
|
Packagist |
≥ 5.0.0
< 5.6.0
|
5.6.0
|
References
Frequently Asked Questions
What is CVE-2026-32272?
Which Craftcms/commerce versions are affected?
What version fixes CVE-2026-32272?
Is craftcms/commerce affected?
What CWE is associated with CVE-2026-32272?
How can I check Packagist dependencies for CVE-2026-32272?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r54v-qq87-px5r",
"modified" : "2026-04-14T00:06:56Z",
"published" : "2026-04-14T00:06:56Z",
"aliases" : [ "CVE-2026-32272" ],
"summary" : "Craft Commerce hasVariant/hasProduct Blind SQL Injection",
"details" : "## Overview\n\nCraft Commerce’s `ProductQuery::hasVariant` and `VariantQuery::hasProduct` properties bypass the `unset()` blocklist added to `ElementIndexesController` in GHSA-2453-mppf-46cj.\n\nThe blocklist only strips top-level Yii2 Query properties (`where`, `orderBy`, etc.), but `hasVariant` and `hasProduct` pass\nthrough untouched. Internally, these properties call `Craft::configure()` on a subquery without sanitization, re-introducing SQL injection via `criteria[hasVariant][where]=INJECTED_SQL`.\n\nAn authenticated control panel user can perform boolean-based blind SQL injection through the patched `ElementIndexesController` and extract arbitrary database contents.\n\n## Impact\n\n* Full database read access via blind SQL injection\n* Privilege escalation via security key extraction → forged admin sessions\n\n## Prerequisites\n* Authenticated control panel user\n* Commerce plugin installed\n* Products with variants in the database",
"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" : "5.0.0"
}, {
"fixed" : "5.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/craftcms/commerce/security/advisories/GHSA-r54v-qq87-px5r"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32272"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/commerce/pull/4232"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-2453-mppf-46cj"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/craftcms/commerce"
}, {
"type" : "WEB",
"url" : "https://github.com/craftcms/commerce/releases/tag/5.6.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-14T00:06:56Z",
"nvd_published_at" : "2026-04-13T21:16:24Z"
}
}