The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-29172

CVE-2026-29172: Craft Commerce SQL Injection Vulnerability

CVE-2026-29172 is a SQL injection flaw in Craft Commerce that allows authenticated attackers to inject arbitrary SQL via the purchasables table endpoint. This article covers technical details, affected versions, impact, and mitigation.

Published: March 13, 2026

CVE-2026-29172 Overview

CVE-2026-29172 is a SQL Injection vulnerability affecting Craft Commerce, the ecommerce platform for Craft CMS. The vulnerability exists in the purchasables table endpoint where the sort parameter is improperly handled. When processing sort requests, the parameter is split by the pipe character (|) and the first part (column name) is passed directly as an array key to orderBy() without whitelist validation. Because Yii2's query builder does NOT escape array keys, an authenticated attacker can inject arbitrary SQL into the ORDER BY clause, potentially leading to unauthorized data access, data manipulation, or complete database compromise.

Critical Impact

Authenticated attackers can inject arbitrary SQL commands into the ORDER BY clause, potentially extracting sensitive customer data, payment information, and administrative credentials from the Craft Commerce database.

Affected Products

  • Craft Commerce versions prior to 4.10.2
  • Craft Commerce versions prior to 5.5.3
  • craftcms craft_commerce (all vulnerable versions)

Discovery Timeline

  • 2026-03-10 - CVE-2026-29172 published to NVD
  • 2026-03-11 - Last updated in NVD database

Technical Details for CVE-2026-29172

Vulnerability Analysis

This SQL Injection vulnerability (CWE-89) stems from insufficient input validation in the sorting functionality of the purchasables table endpoint. The vulnerability affects the OrdersController.php file where user-supplied sort parameters are processed. When a request includes a sort parameter, the application splits it using the pipe delimiter and uses the resulting field name directly in the Yii2 query builder's orderBy() method.

The critical flaw lies in how Yii2's query builder handles array keys - unlike array values, keys are not automatically escaped or parameterized. This architectural decision, combined with the lack of whitelist validation in Craft Commerce, creates a direct path for SQL injection into the ORDER BY clause.

An authenticated attacker with access to the commerce administration interface can craft malicious sort parameters to execute arbitrary SQL statements. This could enable extraction of sensitive data including customer records, payment details, order history, and administrative credentials through time-based or error-based SQL injection techniques.

Root Cause

The root cause is the absence of whitelist validation for the sort field parameter before passing it to Yii2's orderBy() method. The code directly uses user input as an array key in the query builder without verifying that the field name matches an expected list of sortable columns. Yii2's query builder is designed to escape values but not array keys, creating an injection point when untrusted input is used as a key.

Attack Vector

The attack is network-based and requires authentication to the Craft CMS administrative interface. An attacker with valid credentials (even low-privileged) can manipulate the sort parameter in requests to the purchasables table endpoint. By injecting SQL syntax into the column name portion of the sort parameter, the attacker can append arbitrary SQL to the ORDER BY clause.

The following patch demonstrates how the vulnerability was addressed by implementing proper whitelist validation:

php
             $orderQuery->search($search);
         }
 
+        $orderQuery->orderBy('dateOrdered DESC');
         if ($sort) {
-            [$field, $direction] = explode('|', $sort);
+            if (is_array($sort)) {
+                $field = $sort[0]['sortField'];
+                $direction = $sort[0]['direction'];
+            } else {
+                [$field, $direction] = explode('|', $sort);
+            }
+
+            // Validate sorting
+            if (!in_array($direction, ['asc', 'desc']) ||
+                !in_array($field, [
+                    'reference',
+                    'dateOrdered',
+                    'totalPrice',
+                ])
+            ) {
+                $field = null;
+                $direction = null;
+            }
 
             if ($field && $direction) {
                 $orderQuery->orderBy($field . ' ' . $direction);

Source: GitHub Commit b231b920

Detection Methods for CVE-2026-29172

Indicators of Compromise

  • Unusual or malformed sort parameter values in HTTP requests to Craft Commerce endpoints containing SQL syntax such as CASE, WHEN, SLEEP(), or comment sequences (--, /*)
  • Abnormal database query execution times indicating time-based SQL injection attempts
  • Error messages in application logs revealing SQL syntax errors or unexpected query structures
  • Suspicious access patterns to the purchasables table endpoint with repeated requests varying only in sort parameter

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect SQL injection patterns in the sort parameter, specifically looking for ORDER BY injection signatures
  • Enable detailed query logging on the database server to identify malformed or unusually complex ORDER BY clauses
  • Monitor for authentication events followed by rapid requests to commerce administrative endpoints
  • Deploy application-level logging to capture and alert on sort parameters containing non-alphanumeric characters

Monitoring Recommendations

  • Configure SIEM alerts for SQL injection patterns in Craft CMS access logs
  • Monitor database query performance metrics for anomalous execution times that may indicate blind SQL injection
  • Implement real-time alerting on Craft Commerce administrative endpoint access with unusual parameter patterns
  • Review Yii2 application logs for PDOException errors that may indicate failed injection attempts

How to Mitigate CVE-2026-29172

Immediate Actions Required

  • Upgrade Craft Commerce to version 4.10.2 or later for the 4.x branch
  • Upgrade Craft Commerce to version 5.5.3 or later for the 5.x branch
  • Review database access logs for any evidence of exploitation prior to patching
  • Consider rotating database credentials if exploitation is suspected

Patch Information

Craft CMS has released security patches addressing this vulnerability. The fixes implement proper whitelist validation for both the sort field and direction parameters, ensuring only expected values (reference, dateOrdered, totalPrice) can be used in queries.

  • Security Advisory GHSA-j3x5-mghf-xvfw
  • Patch Commit for 4.x branch
  • Patch Commit for 5.x branch

Workarounds

  • If immediate patching is not possible, implement WAF rules to block requests containing SQL keywords in the sort parameter
  • Restrict access to Craft Commerce administrative interfaces to trusted IP addresses only
  • Temporarily disable or restrict access to the purchasables table endpoint functionality
  • Implement database-level monitoring to detect and block suspicious query patterns
bash
# Example nginx configuration to block SQL injection patterns in sort parameter
location /admin/commerce {
    # Block common SQL injection patterns in query strings
    if ($args ~* "(sort=.*[;'\"()=])|(sort=.*(CASE|WHEN|THEN|ELSE|SELECT|UNION|INSERT|UPDATE|DELETE|DROP|EXEC|SLEEP))") {
        return 403;
    }
    # Continue with normal processing
    proxy_pass http://backend;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechCraftcms

  • SeverityHIGH

  • CVSS Score8.7

  • EPSS Probability0.03%

  • Known ExploitedNo
  • 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/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
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-89
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Commit Update

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-29174: Craftcms Craft Commerce SQLi Vulnerability

  • CVE-2026-33159: Craft CMS Auth Bypass Vulnerability

  • CVE-2026-31859: Craft CMS Reflected XSS Vulnerability

  • CVE-2026-29175: Craftcms Craft Commerce XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English