Laravel Livewire Remote Code Execution via Known APP_KEY (CVE-2025-54068)
by haxorstars (recode of original research by Synacktiv / Livepyre) · 2026-07-06
- Severity
- Critical
- CVE
- CVE-2025-54068
- Category
- web
- Affected product
- Laravel Livewire (versions prior to v3.6.4)
- Affected versions
- Livewire < v3.6.4 (per repository's bundled versions.json version-hash fingerprinting)
- Disclosed
- 2026-07-06
- Patch status
- unpatched
Tags
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-06 |
| Last Updated | 2026-07-06 |
| Author / Researcher | haxorstars (recode of original research by Synacktiv / Livepyre) |
| CVE / Advisory | CVE-2025-54068 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.8 (per NVD) |
| Status | Weaponized |
| Tags | laravel, livewire, php, deserialization, app-key, hmac-forgery, gadget-chain, rce, cwe-502, python |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Laravel Livewire (versions prior to v3.6.4) |
| Versions Affected | Livewire < v3.6.4 (per repository’s bundled versions.json version-hash fingerprinting) |
| Language / Platform | Python 3 exploit client targeting a PHP/Laravel + Livewire web application |
| Authentication Required | No application session required, but the attacker must know (or have leaked/brute-forced) the target’s Laravel APP_KEY |
| Network Access Required | Yes |
Summary
Laravel Livewire serializes component state into a wire:snapshot HTML attribute and protects it with an HMAC-SHA256 checksum keyed on the application’s APP_KEY. If an attacker obtains the APP_KEY (leaked .env, default/demo key, weak secret, etc.), they can craft an arbitrary snapshot payload, sign it with a correctly computed checksum, and submit it to Livewire’s component-update endpoint. Because Livewire trusts any snapshot whose checksum matches, a forged snapshot containing nested serialized PHP objects (Illuminate\Broadcasting\BroadcastEvent, Illuminate\Validation\Validator, Laravel\SerializableClosure\Serializers\Signed, GuzzleHttp\Psr7\FnStream, etc.) reaches a PHP-object-injection gadget chain that invokes an arbitrary PHP function (e.g. system, shell_exec, or unserialize of a further attacker-supplied payload) with attacker-controlled arguments, yielding remote code execution. This repository (a Python recode of Synacktiv’s original “Livepyre” PoC) automates the whole chain: locating the Livewire snapshot and CSRF token on a page, rebuilding a malicious snapshot with the injected gadget, HMAC-signing it using the supplied APP_KEY, and POSTing it to the discovered Livewire update URI.
Vulnerability Details
Root Cause
Livewire snapshots are integrity-protected only by an HMAC-SHA256 checksum field computed over the JSON-encoded snapshot using the APP_KEY as the HMAC key. Anyone holding the APP_KEY can produce a snapshot with arbitrary data content and a still-valid checksum — there is no additional server-side session binding preventing forgery of a snapshot with attacker-chosen values. The exploit rewrites a legitimate snapshot’s first data entry into a PHP object-injection gadget chain and re-signs it (from exploit/exploit_appkey.py):
| |
Once the checksum is recomputed with the known APP_KEY, the server cannot distinguish this forged snapshot from a legitimate one, and Livewire’s update handler deserializes/dispatches the injected chain, ultimately calling the attacker-chosen PHP function with param as its argument.
Attack Vector
- Identify a page serving a Livewire component (the string
livewireand awire:snapshot="..."attribute present in the HTML). - Fingerprint the Livewire version from bundled asset hashes against a lookup table (
exploit/versions.json) and confirm it is < v3.6.4. - Extract the page’s CSRF token and the Livewire component “update URI” from the HTML/inline JS config.
- Extract one of the page’s
wire:snapshotvalues, strip its existingchecksum, and rewrite its firstdataentry with a PHP object-injection gadget chain resolving to an arbitraryfunction(param)call — optionally wrapping a richercustom_exec-style PHP payload (payloads/custom_functions.php) invoked viaunserializefor shell/file/DB/network operations in one shot. - Recompute the snapshot’s HMAC-SHA256
checksumusing the known/leaked LaravelAPP_KEY. - POST the forged
{"_token": csrf, "components":[{"snapshot": ..., "updates":{}, "calls":[]}]}payload to the Livewire update endpoint; the server validates the checksum, trusts the snapshot, executes the injected call chain, and the command output is returned in the HTTP response body.
Impact
Full remote code execution as the web server/PHP-FPM user on any Laravel application using a vulnerable Livewire version, provided the attacker knows the APP_KEY — a realistic condition given how often APP_KEY values leak via exposed .env files, public GitHub repositories, Laravel debug/error pages, or default/demo installs.
Environment / Lab Setup
Target: Laravel application using Livewire < v3.6.4, with a discoverable APP_KEY
(leaked .env, debug endpoint, or hardcoded/default key)
Attacker: Python 3.9+
pip install -r requirements.txt (requests, pycryptodome, etc.)
Install as CLI: pipx install git+https://github.com/haxorstars/CVE-2025-54068
or: uv tool install git+https://github.com/haxorstars/CVE-2025-54068
Proof of Concept
PoC Script
See
gas.py(CLI entry point),exploit/exploit.py,exploit/exploit_appkey.py,exploit/exploit_wappkey.py,exploit/payload_generator.py,exploit/mass.py,exploit/laravel_crypto/andpayloads/custom_functions.phpin this folder.
| |
Detection & Indicators of Compromise
Signs of compromise:
- POST requests to the Livewire update URI whose
components[].snapshotfield contains serialized PHP class names not used by the legitimate component - Unexpected shell command output or file contents appearing in HTTP responses from a Livewire update endpoint
- Presence of leaked
.envfiles, exposed debug pages, or a default/weakAPP_KEYon the target application - Anomalous child processes (
sh,bash,id,uname, etc.) spawned by the PHP-FPM/web server process
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade Livewire to v3.6.4 or later, and immediately rotate/regenerate the Laravel APP_KEY if it has ever been exposed |
| Interim mitigation | Ensure .env files and debug/diagnostic endpoints are never web-accessible, keep APP_DEBUG=false in production, and monitor Livewire update endpoints for anomalous/oversized snapshot payloads |
References
Notes
Mirrored from https://github.com/haxorstars/CVE-2025-54068 on 2026-07-06. The tool is an acknowledged recode of Synacktiv’s public Livepyre PoC with added features (custom function/PHP payload injection, mass-check mode, payload-only generation); the underlying exploit logic (HMAC checksum forgery + PHP gadget-chain snapshot injection) is functional and CVE-specific.
| |