CVE-2026-32272: Craft Commerce hasVariant/hasProduct Blind SQL Injection
Overview Craft Commerce’s ProductQuery::hasVariant and VariantQuery::hasProduct properties bypass the unset() blocklist added to ElementIndexesController in GHSA-2453-mppf-46cj. The blocklist only strips top-level Yii2 Query properties (where, orderBy, etc.), but hasVariant and hasProduct pass through untouched.
Published Apr 14, 2026
Affected packages
craftcms/commerce
- Ecosystem
- Composer (PHP)
- Affected
- >= 5.0.0, < 5.6.0
- Fixed in
- 5.6.0
- Check
composer show craftcms/commerce
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Overview
Craft Commerce’s ProductQuery::hasVariant and VariantQuery::hasProduct properties bypass the unset() blocklist added to ElementIndexesController in GHSA-2453-mppf-46cj.
The blocklist only strips top-level Yii2 Query properties (where, orderBy, etc.), but hasVariant and hasProduct pass through untouched. Internally, these properties call Craft::configure() on a subquery without sanitization, re-introducing SQL injection via criteria[hasVariant][where]=INJECTED_SQL.
An authenticated control panel user can perform boolean-based blind SQL injection through the patched ElementIndexesController and extract arbitrary database contents.
Impact
- Full database read access via blind SQL injection
- Privilege escalation via security key extraction → forged admin sessions
Prerequisites
- Authenticated control panel user
- Commerce plugin installed
- Products with variants in the database
Credited to Neosprings.
References
- https://github.com/craftcms/commerce/security/advisories/GHSA-r54v-qq87-px5r
- https://nvd.nist.gov/vuln/detail/CVE-2026-32272
- https://github.com/craftcms/commerce/pull/4232
- https://github.com/advisories/GHSA-2453-mppf-46cj
- https://github.com/craftcms/commerce/releases/tag/5.6.0
- https://github.com/advisories/GHSA-r54v-qq87-px5r
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesCVE-2026-55795
Craft Commerce: Coupon Code Brute-Force via Rate Limit Bypass
medium6.9Jun 19, 2026GHSA-78vr-q6cf-c7p6
Craft Commerce: Partial Payment Amount Without Lower Bound Validation
medium6.9Jun 19, 2026CVE-2026-32270
Craft Commerce has an unauthenticated information disclosure that can leak some customer order data on anonymous payments
low1.7Apr 14, 2026CVE-2026-32271
Craft Commerce has a SQL Injection can lead to Remote Code Execution via TotalRevenue Widget
high8.7Apr 14, 2026CVE-2026-29172
Craft Commerce is Vulnerable to SQL Injection in Commerce Purchasables Table Sorting
high8.7Mar 10, 2026CVE-2026-29173
Craft Commerce is Vulnerable to Stored XSS while updating Order Status from Orders Table
low1.9Mar 10, 2026
