CVE-2024-21544 Browsershot Local File Inclusion
An attacker can read sensitive server files by exploiting improper URL validation in the setUrl method of the browsershot library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-21544?
CVE-2024-21544 is a high-severity path traversal vulnerability in spatie/browsershot, published on 13 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Versions of the package spatie/browsershot before 5.0.1 are vulnerable to Improper Input Validation due to improper URL validation in the setUrl method. An attacker can exploit this vulnerability by using leading whitespace (%20) before the file:// protocol, resulting in Local File Inclusion, which allows the attacker to read sensitive files on the server.
Weakness: CWE-20
Which versions are affected by CVE-2024-21544?
2 open source packages ship an affected version, including spatie/browsershot.
| Package | Affected | Fixed in |
|---|---|---|
spatie/browsershot Packagist | All versions | 5.0.1 |
spatie/browsershot Packagist | All versions | 5.0.1 |
How do I fix CVE-2024-21544?
Upgrade spatie/browsershot to 5.0.1 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-21544 being exploited?
There is no known exploitation of CVE-2024-21544 in the wild and no public exploit code.
Sources
Also known as GHSA-g2r4-phv7-5fgv.