Packagist
CVE-2026-65971
livewire-powergrid: SQL injection via sortDirection in naturalSort queries
- Severity
- High 7.6
- Published
- 25 Nov 2026
- Last changed
- 25 Nov 2026
- Added to UpHeron
- 25 Nov 2026
- Fixed in
- 6.10.4
- Weakness
- SQL injection (CWE-89)
- Attack
- Over the network · Needs a user account · No user action needed
- Attacker can
- Read data · Change some data · Slow it down
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L- Also known as
- GHSA-7fgc-3h6c-698r
- Sources
- OSV.dev and GitHub
Description
The public Livewire property sortDirection is interpolated verbatim into a raw SQL ORDER BY clause and is not restricted to asc/desc, allowing arbitrary SQL injection through POST /livewire/update.
- Source — src/Concerns/Sorting.php: public string $sortDirection; is a Livewire-bound property with no whitelist/validation (it is only assigned and flipped by reverseSort()), so it is fully attacker-controlled via the standard Livewire update endpoint.
- Taint — src/DataSource/Processors/Database/Pipelines/ColumnRawQueries.php, resolvePlaceholders():
substitutes {sortDirection} with the raw property value.
- Sink — src/DataSource/Support/Sql.php::getSortSqlByDriver() builds the naturalSort expression, e.g. "... {sortDirection}" / "CAST(...) {sortDirection}", which is passed to orderByRaw(). The tainted direction lands directly in the SQL string.
Workarounds
Normally the Sorting pipeline calls orderBy(resolveSortField($sortField), $sortDirection), and Laravel validates the direction (Order direction must be "asc" or "desc".). Setting sortField="" makes the Sorting pipeline skip (filled('') is false), so the validating orderBy never runs — but the ColumnRawQueries pipeline still applies the naturalSort orderByRaw unconditionally with the attacker-controlled {sortDirection}. The result is arbitrary SQL in the ORDER BY, bypassing Laravel's direction validation entirely.
Affected software
| Software | Affected versions |
|---|---|
power-components/livewire-powergridPackagist · osv:Packagist:power-components/livewire-powergrid |
|
About power-components/livewire-powergrid
- Monthly downloads (Packagist)
- 124,623Packagist, 25 Nov 2026
- Total downloads (Packagist)
- 2,331,607Packagist, 25 Nov 2026
This is the only vulnerability in power-components/livewire-powergrid in our list.
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-65971
- GitHub Advisory Database https://github.com/advisories/GHSA-7fgc-3h6c-698r