CVE-2024-21504 Cross-site Scripting in livewire/livewire

Medium 6.1 Published Updated

An attacker can inject malicious HTML into a user's browser session via crafted links in Livewire applications using the Url property.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-21504?

CVE-2024-21504 is a medium-severity cross-site scripting vulnerability in livewire/livewire, published on 19 Mar 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Versions of the package livewire/livewire from 3.3.5 and before 3.4.9 are vulnerable to Cross-site Scripting (XSS) when a page uses [Url] for a property. An attacker can inject HTML code in the context of the user's browser session by crafting a malicious link and convincing the user to click on it.

Weakness: CWE-79

Which versions are affected by CVE-2024-21504?

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

PackageAffectedFixed in
livewire/livewire PackagistFrom 3.3.53.4.9
livewire/livewire PackagistFrom 3.3.53.4.9

Products include Laravel Livewire.

How do I fix CVE-2024-21504?

Upgrade livewire/livewire to 3.4.9 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2024-21504 being exploited?

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

Sources

Also known as GHSA-389c-cf87-qmwj.

Is CVE-2024-21504 in your software?

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

Check your SBOMs for free