CVE-2024-47823 Livewire Remote Code Execution (RCE) on File Uploads

High 7.7 Published Updated

Attackers can achieve remote code execution by uploading malicious PHP files if the application stores uploads publicly and executes PHP.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-47823?

CVE-2024-47823 is a high-severity vulnerability in livewire, published on 8 Oct 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Livewire is a full-stack framework for Laravel that allows for dynamic UI components without leaving PHP. In livewire/livewire prior to `2.12.7` and `v3.5.2`, the file extension of an uploaded file is guessed based on the MIME type. As a result, the actual file extension from the file name is not validated. An attacker can therefore bypass the validation by uploading a file with a valid MIME type (e.g., `image/png`) and a “.php” file extension. If the following criteria are met, the attacker can carry out an RCE attack: 1. Filename is composed of the original file name using `$file->getClientOriginalName()`. 2. Files stored directly on your server in a public storage disk. 3. Webserver is configured to execute “.php” files. This issue has been addressed in release versions `2.12.7` and `3.5.2`. All users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-434, CWE-20

Which versions are affected by CVE-2024-47823?

4 open source packages ship an affected version, including livewire/livewire. It affects 1 product.

PackageAffectedFixed in
livewire/livewire PackagistAll versions2.12.7
livewire/livewire PackagistAll versions2.12.7
livewire/livewire PackagistFrom 3.0.0-beta.13.5.2
livewire/livewire PackagistFrom 3.0.0-beta.13.5.2

Products include Laravel Livewire.

How do I fix CVE-2024-47823?

Upgrade livewire/livewire to a fixed version for your release line: 2.12.7 or 3.5.2.

Is CVE-2024-47823 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-47823 exists.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-f3cx-396f-7jqp.

Is CVE-2024-47823 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free