Dev.to Security 🔐 Cybersecurity 👁 0 📖 3 min read

CVE-2026-65971: CVE-2026-65971: SQL Injection in Livewire PowerGrid via Public sortDirection Property

CVE-2026-65971: SQL Injection in Livewire PowerGrid via Public sortDirection Property Vulnerability ID: CVE-2026-65971 CVSS Score: 7.6 Published: 2026-11-25 A SQL injection vulnerability exists in power-components/l

CVE-2026-65971: SQL Injection in Livewire PowerGrid via Public sortDirection Property

Vulnerability ID: CVE-2026-65971
CVSS Score: 7.6
Published: 2026-11-25

A SQL injection vulnerability exists in power-components/livewire-powergrid versions 6.0.0 through 6.10.3. The public Livewire component property sortDirection is interpolated directly into raw SQL ORDER BY clauses during natural sorting operations without prior validation. By clearing the sortField property to bypass standard Laravel query builder protections, an attacker can inject arbitrary SQL expressions via POST requests to the /livewire/update endpoint.

TL;DR

Livewire PowerGrid 6.0.0 to 6.10.3 fails to sanitize the public sortDirection property before interpolating it into raw SQL ORDER BY clauses used by naturalSort. Setting sortField to an empty string bypasses Laravel's built-in direction validation, enabling SQL injection via standard Livewire update requests.

⚠️ Exploit Status: POC

Technical Details

  • Vulnerability Type: CWE-89: SQL Injection
  • CVSS v3.1 Score: 7.6 High (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L)
  • Attack Vector: Network via POST /livewire/update
  • Affected Versions: power-components/livewire-powergrid >= 6.0.0, < 6.10.4
  • Patched Version: 6.10.4
  • EPSS Score: 0.35% (20.73rd percentile)
  • Exploit Status: Public PoC Available
  • CISA KEV Status: Not Listed

Affected Systems

  • power-components/livewire-powergrid (>= 6.0.0, < 6.10.4)
  • livewire-powergrid: >= 6.0.0, < 6.10.4 (Fixed in: 6.10.4)

Code Analysis

Commit: 13d047b

Restrict sortDirection to a strict asc/desc allowlist across raw query placeholders, sorting pipelines, persisted state, and Livewire lifecycle hooks.

--- a/src/DataSource/Support/Sql.php
+++ b/src/DataSource/Support/Sql.php
@@ -64,4 +64,17 @@ class Sql
+    public static function sanitizeSortDirection(?string $direction): string
+    {
+        $direction = strtolower(trim((string) $direction));
+
+        return in_array($direction, ['asc', 'desc'], true) ? $direction : 'asc';
+    }
--- a/src/DataSource/Processors/Database/Pipelines/ColumnRawQueries.php
+++ b/src/DataSource/Processors/Database/Pipelines/ColumnRawQueries.php
@@ -49,6 +49,10 @@ class ColumnRawQueries
     private function resolvePlaceholders(?string $sql): ?string
     {
         return preg_replace_callback('/\{(\w+)\}/', function ($matches) {
             $property = trim($matches[1]);
+
+            if ($property === 'sortDirection') {
+                return Sql::sanitizeSortDirection($this->component->sortDirection);
+            }

             return data_get($this->component, $property, '');
         }, $sql);
     }

Exploit Details

  • GitHub: Proof-of-concept, reproduction lab, and technical write-up for CVE-2026-65971 / GHSA-7fgc-3h6c-698r demonstrating SQL injection via the sortDirection Livewire property.

Mitigation Strategies

  • Upgrade power-components/livewire-powergrid to version 6.10.4 or later to enforce strict allowlist sanitization on sortDirection.
  • Implement a temporary component-level override for updatedSortDirection() to restrict sortDirection values to 'asc' or 'desc' prior to query execution.
  • Deploy Web Application Firewall (WAF) rules inspecting POST /livewire/update JSON payloads for sortDirection mutations containing values other than 'asc' or 'desc'.
  • Audit custom PowerGrid column definitions using rawQueries to ensure no other public Livewire properties are interpolated via {property} placeholders without sanitization.

Remediation Steps:

  1. Check the currently installed version of Livewire PowerGrid by running: composer show power-components/livewire-powergrid
  2. Update the dependency constraint in composer.json or execute: composer require power-components/livewire-powergrid:^6.10.4
  3. Verify that the lockfile resolves to v6.10.4 or higher and deploy the updated vendor bundle to all application environments.
  4. Review database error logs and web server access logs targeting /livewire/update for anomalous ORDER BY syntax errors (such as SQLSTATE[42000] or MySQL error 1105).

References

Read the full report for CVE-2026-65971 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.