# Patch Livewire PowerGrid sortDirection SQL injection (CVE-2026-65971)

> Raise power-components/livewire-powergrid to 6.10.4 and whitelist asc/desc on Livewire-bound sort fields.

Source: https://fullbytedeveloper.com/blog/patch-livewire-powergrid-sort-sql-injection
Published here: 2026-11-26

GHSA-7fgc-3h6c-698r is SQL injection through a Livewire-bound `sortDirection` on PowerGrid naturalSort. Severity High, CVSS 3.1 7.6. The CVE id is CVE-2026-65971. The Composer floor is `power-components/livewire-powergrid` 6.10.4. Whitelist `asc` and `desc` only on any Livewire-bound sort field you own. [1]

Related reading: [Patch Laravel JSON DoS floors](/blog/patch-laravel-json-dos-floors), [Patch Drupal install.php RCE (CVE-2026-132165)](/blog/patch-drupal-install-php-rce-floors), [Lock down ruflo MCP bridge defaults (CVE-2026-59726)](/blog/lock-down-ruflo-mcp-bridge-defaults) and [Patch W3 Total Cache CVE-2026-135616](/blog/patch-w3-total-cache-memcached-poi). Browse the [Security topic](https://fullbytedeveloper.com/blog/topic/security).

## Confirm the sortDirection path

GHSA-7fgc-3h6c-698r is titled "SQL Injection via User-Controlled sortDirection in Livewire naturalSort Order Clause." Package: Composer `power-components/livewire-powergrid`. Published July 4, 2026. Affected: >= 6.0.0 and < 6.10.4. Patched: 6.10.4. [1]

Source: `src/Concerns/Sorting.php` exposes `public string $sortDirection` as a Livewire-bound property with no whitelist. Taint: `ColumnRawQueries.php` `resolvePlaceholders()` substitutes `{sortDirection}` with the raw property value. Sink: `Sql.php::getSortSqlByDriver()` builds the naturalSort expression and passes it to `orderByRaw()`. [1]

Laravel normally validates direction on `orderBy(..., $sortDirection)`. Setting `sortField=""` makes the Sorting pipeline skip, so that check never runs, while the naturalSort `orderByRaw` path still runs with attacker-controlled direction. [1]

## Raise PowerGrid to 6.10.4

```bash
composer show power-components/livewire-powergrid
composer require power-components/livewire-powergrid:^6.10.4
```

Confirm the installed version is 6.10.4 or newer. The advisory patched versions field is 6.10.4. [1][2]

## Keep sort direction on a whitelist

For any Livewire-bound sort direction you control outside this package, accept only `asc` and `desc`. Do not interpolate free-form direction strings into `orderByRaw`. The advisory's bypass is exactly that missing whitelist on the naturalSort path. [1]

## Know the read impact

Any actor who can reach a PowerGrid table using `naturalSort` and control `sortDirection` can read arbitrary data from the database (other tables, password hashes, tokens) through a blind boolean or time-based oracle. Stacked queries are blocked by the default PDO MySQL driver, so impact is read-oriented (confidentiality), but complete for readable data. In multi-tenant or admin apps this enables cross-tenant data exfiltration. [1]

Do not mark this advisory as brand-new on 2026-11-26. The GHSA publish date is July 4, 2026; CISA and Trend Radar resurfaced it later for patching pressure. [1]

Send this to the Laravel teammate who still runs PowerGrid below 6.10.4 on any table with `naturalSort(true)`.

## Sources

1. [GitHub advisory GHSA-7fgc-3h6c-698r (SQL Injection via sortDirection)](https://github.com/Power-Components/livewire-powergrid/security/advisories/GHSA-7fgc-3h6c-698r)
2. [livewire-powergrid v6.10.4 release](https://github.com/Power-Components/livewire-powergrid/releases/tag/v6.10.4)
3. [CVE record CVE-2026-65971](https://www.cve.org/CVERecord?id=CVE-2026-65971)
