Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-32271

Craft Commerce has a SQL Injection can lead to Remote Code Execution via TotalRevenue Widget
Back to all
CVE

CVE-2026-32271

Craft Commerce has a SQL Injection can lead to Remote Code Execution via TotalRevenue Widget

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 MySQL enables CLIENTMULTISTATEMENTS by 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 calls unserialize() 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 calls fileputcontents(). The attacker’s serialized payload writes a PHP webshell to the server’s webroot. PHP tags survive json_encode() because Guzzle uses options=0 (no JSONHEXTAG).

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-widget with 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)

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
7.7
-
4.0
CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
C
H
U
0
-
C
H
U
-

Related Resources

No items found.

References

https://github.com/craftcms/commerce/security/advisories/GHSA-875v-7m49-8x88, https://nvd.nist.gov/vuln/detail/CVE-2026-32271, https://github.com/craftcms/commerce/commit/6d2d24b3a2b0c06593856d05446f82bd8af92d72, https://github.com/craftcms/commerce

Severity

0

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
0
EPSS Probability
0.0008%
EPSS Percentile
0.23649%
Introduced Version
4.0.0,5.0.0
Fix Available
4.10.3,5.5.5

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading