CVE-2026-32271 — craftcms/commerce
Fix: craftcms/commerce@6d2d24bCVE-2026-32271 is a SQL Injection vulnerability in craftcms/commerce. A fix is available for craftcms/commerce — see the affected versions and patch details below.
Craft Commerce: SQL Injection can lead to Remote Code Execution via TotalRevenue Widget
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-32271.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
craftcms/commerce🐘craftcms/commerceReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
Summary
A SQL injection in the Commerce TotalRevenue widget can lead to remote code execution through a chain of four vulnerabilities:
-
SQL Injection -- The TotalRevenue stat interpolates unsanitized widget settings directly into a sprintf-based SQL Expression. Any control panel user can create any widget type without permission checks.
-
PDO Multi-Statement Queries -- PHP
PDO MySQLenablesCLIENT_MULTI_STATEMENTSby default. Neither Yii2 nor Craft CMS disables it. This allows stacking an INSERT statement after the injected SELECT , writing a maliciously serialized PHP object into the queue table. -
Unrestricted
unserialize()-- The yii2-queue PhpSerializer callsunserialize()with no allowed_classes restriction on every queue job. When the queue consumer processes the injected job, it instantiates the attacker-controlled object. -
Gadget Chain (FileCookieJar) --
GuzzleHttp\Cookie\FileCookieJar(a standard Guzzle dependency) has an unguarded__destruct()method that callsfile_put_contents(). The attacker’s serialized payload writes a PHP webshell to the server’s webroot. PHP tags survivejson_encode()because Guzzle usesoptions=0(noJSON_HEX_TAG).
The complete chain requires 3 HTTP requests and achieves arbitrary command execution as the PHP process user. Queue processing is triggered via GET /actions/queue/run, an endpoint that requires no authentication ($allowAnonymous = ['run']).
RCE Exploitation Steps
- Authenticate as any control panel user
- POST to
/admin/actions/dashboard/create-widgetwith stacked SQL injection: settings[type]contains the stacked INSERT with the serialized gadget chain- Response: HTTP 500 (expected -- INSERT already committed)
- Trigger queue processing:
GET /actions/queue/run - Queue consumer deserializes the gadget chain
FileCookieJar::__destruct()writes webshell to webroot- Access the webshell:
GET /poc_rce.php?c=id - Response:
uid=1000(home) gid=1000(home) groups=1000(home)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | craftcms/commerce | ≥ 4.0.0&&< 4.10.3 | 4.10.3composer require craftcms/commerce:^4.10.3 |
| 🐘Packagist | craftcms/commerce | ≥ 5.0.0&&< 5.5.5 | 5.5.5composer require craftcms/commerce:^5.5.5 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for craftcms/commerce, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update craftcms/commerce to 4.10.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-32271 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-32271 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-32271. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-32271 in your dependencies?
O3 Security finds CVE-2026-32271 across Packagist dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.