/

CVE-2026-65971

Severity:

HIGH RISK

(7.6)

SQL Injection (CWE-89) in Livewire PowerGrid Sorting

CVE-2026-65971

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

SQL Injection

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Livewire PowerGrid versions 6.0.0 through versions before 6.10.4 interpolate the public sortDirection property into a raw SQL ORDER BY clause without restricting its value. An attacker who can submit updates to an affected Livewire component may be able to inject SQL when sorting is processed.

Affected context

The vulnerability occurs in Livewire PowerGrid's table sorting behavior when the component builds a database query. It affects versions 6.0.0 through versions before 6.10.4 when a submitted sortDirection value is used verbatim in a raw SQL ORDER BY clause. Exploitability depends on whether an attacker can reach the Livewire update endpoint and trigger the affected sorting path.

Exploit preconditions

  • Attack surface: The application's Livewire update endpoint, POST /livewire/update
  • Required access: The ability to submit updates to an affected PowerGrid component; authentication requirements depend on the application
  • Trigger point: Processing a table sort that uses the public sortDirection property
  • Why exploitation is possible: The value is interpolated into raw SQL without being constrained to expected directions such as asc or desc

Why this happens

The component treats a public property as safe SQL syntax and inserts it directly into a raw ORDER BY clause. Because the value is not restricted to an allowlist of valid sort directions, attacker-controlled input can alter the SQL statement's structure. This is an SQL injection flaw mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

Potential impact

  • An attacker may be able to alter database queries executed during sorting
  • Depending on the query, database permissions, and application controls, sensitive data could be exposed or modified
  • Database availability or application integrity could be affected

General mitigation guidance

Defensive patterns include treating sort parameters as untrusted and mapping them to a fixed set of permitted values before query construction. Prefer query-builder APIs and bound parameters where applicable, and avoid interpolating user-controlled values into raw SQL syntax. Apply least-privilege database permissions and restrict access to component actions according to the application's authorization model.

How teams detect issues like this

  • Use static analysis to identify raw SQL construction that incorporates public component properties or request-derived values
  • Review sorting code for missing allowlists and direct interpolation into ORDER BY clauses
  • Apply policy checks that flag unsafe raw-query APIs or require validation of SQL identifiers and directions
  • Monitor application and database logs for unexpected sorting inputs or anomalous query behavior

Sources

SourceLink
github.comgithub.com/Power-Components/livewire-powergrid/commit/13d047bf1637e82926e6914aa3ca0f29a4c9704a
github.comgithub.com/Power-Components/livewire-powergrid/releases/tag/v6.10.4
github.comgithub.com/Power-Components/livewire-powergrid/security/advisories/GHSA-7fgc-3h6c-698r

Frequently asked

questions

PowerGrid table sorting is affected when sortDirection is used to construct a raw SQL ORDER BY clause.

An attacker needs to be able to submit updates to an affected Livewire component and trigger sorting. Whether authentication is required depends on the application's access controls.

Restrict sort directions to a fixed allowlist and avoid placing untrusted values directly into raw SQL.

Treat all client-submitted component state as untrusted, review raw query construction, enforce authorization, and use static analysis or policy checks to catch unsafe SQL patterns.

Find out what's already
exploitable in your codebase.