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. 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
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | craftcms/commerce | >= 5.0.0, < 5.6.0 | 5.6.0 |
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
- https://github.com/craftcms/commerce/releases/tag/5.6.0
- CVSS 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- Weakness (CWE)
CWE-89- Platform
- Composer
- Package
craftcms/commerce- Disclosed
- 14.04.2026
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-r54v-qq87-px5r - CC BY 4.0
Vulnerability history: craftcms/commerce
All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 21
- First → latest
- 02.2026 06.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 5
- Medium 13
- Low 3
Disclosures per year
- 2026: 21
-
Craft Commerce hasVariant/hasProduct Blind SQL Injection this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.