8.7high
Craft Commerce: Blind SQL Injection via hasVariant/hasProduct
- Severity
- 8.7high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.30% (higher than 23% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-r54v-qq87-px5r
Description
Craft Commerce is an ecommerce platform for Craft CMS. In versions 5.0.0 through 5.5.4, an SQL injection vulnerability exists where the ProductQuery::hasVariant and VariantQuery::hasProduct properties bypass the input sanitization blocklist added to ElementIndexesController in a prior security fix (GHSA-2453-mppf-46cj). The blocklist only strips top-level Yii2 Query properties such as where and orderBy, but hasVariant and hasProduct pass through untouched and internally call Craft::configure() on a subquery without sanitization, re-introducing SQL injection. Any authenticated control panel user can exploit this via boolean-based blind SQL injection to extract arbitrary database contents, including security keys that enable forging admin sessions for privilege escalation. This issue has been fixed in version 5.6.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| craftcms commerce | >= 5.0.0 < 5.6.0 | CVE List |
| craftcms/commerce (Packagist) | from 5.0.0 before 5.6.0 | GitHub Advisory Database |
All scores
| GitHub_M | 8.7high CVSS:4.0 | 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 |
| GitHub | high CVSS:4.0 | 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 |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
Craft Commerce is an ecommerce platform for Craft CMS. In versions 5.0.0 through 5.5.4, an SQL injection vulnerability exists where the ProductQuery::hasVariant and VariantQuery::hasProduct properties bypass the input sanitization blocklist added to ElementIndexesController in a prior security fix (GHSA-2453-mppf-46cj). The blocklist only strips top-level Yii2 Query properties such as where and orderBy, but hasVariant and hasProduct pass through untouched and internally call Craft::configure() on a subquery without sanitization, re-introducing SQL injection. Any authenticated control panel user can exploit this via boolean-based blind SQL injection to extract arbitrary database contents, including security keys that enable forging admin sessions for privilege escalation. This issue has been fixed in version 5.6.0.
GitHub Advisory Database
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
NVD (es)
Craft Commerce es una plataforma de comercio electrónico para Craft CMS. En las versiones 5.0.0 a 5.5.4, existe una vulnerabilidad de inyección SQL donde las propiedades ProductQuery::hasVariant y VariantQuery::hasProduct eluden la lista negra de saneamiento de entrada añadida a ElementIndexesController en una corrección de seguridad anterior (GHSA-2453-mppf-46cj). La lista negra solo elimina propiedades de consulta de Yii2 de nivel superior como where y orderBy, pero hasVariant y hasProduct pasan sin ser tocadas y llaman internamente a Craft::configure() en una subconsulta sin saneamiento, reintroduciendo la inyección SQL. Cualquier usuario autenticado del panel de control puede explotar esto a través de inyección SQL ciega basada en booleanos para extraer contenido arbitrario de la base de datos, incluyendo claves de seguridad que permiten falsificar sesiones de administrador para la escalada de privilegios. Este problema ha sido solucionado en la versión 5.6.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-32272 changed 2026-04-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-r54v-qq87-px5r changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2026-32272 changed 2026-10-26 | Public domain |