CVE-2025-1022: Improper Input Validation in spatie/browsershot
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.
AI Analysis
Technical Summary
The vulnerability in spatie/browsershot affects versions prior to 5.0.5 and involves improper input validation in the setHtml function, called by Browsershot::html(). The flaw allows bypassing of file URI scheme restrictions by omitting slashes in the file URI (e.g., file:../../../../etc/passwd), enabling injection of local file references into HTML content. This occurs because the package does not properly validate or block file URI schemes in user-supplied HTML. Additional proof-of-concept exploits have been identified, but no official fix or patch is currently available.
Potential Impact
An attacker can exploit this vulnerability to inject HTML content that references local files via crafted file URIs, potentially exposing sensitive local files or causing unintended behavior in applications using the vulnerable package. The CVSS 4.0 score of 8.8 indicates high severity with network attack vector, low attack complexity, no privileges required, no user interaction, and high impact on confidentiality.
Mitigation Recommendations
As no official fix or patch is currently available, developers using spatie/browsershot should implement their own input validation to block or sanitize file URI schemes in HTML content passed to the setHtml function. Monitoring vendor advisories for updates or patches is recommended.
CVE-2025-1022: Improper Input Validation in spatie/browsershot
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.
CVSS v4.0
Score 8.8high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in spatie/browsershot affects versions prior to 5.0.5 and involves improper input validation in the setHtml function, called by Browsershot::html(). The flaw allows bypassing of file URI scheme restrictions by omitting slashes in the file URI (e.g., file:../../../../etc/passwd), enabling injection of local file references into HTML content. This occurs because the package does not properly validate or block file URI schemes in user-supplied HTML. Additional proof-of-concept exploits have been identified, but no official fix or patch is currently available.
Potential Impact
An attacker can exploit this vulnerability to inject HTML content that references local files via crafted file URIs, potentially exposing sensitive local files or causing unintended behavior in applications using the vulnerable package. The CVSS 4.0 score of 8.8 indicates high severity with network attack vector, low attack complexity, no privileges required, no user interaction, and high impact on confidentiality.
Mitigation Recommendations
As no official fix or patch is currently available, developers using spatie/browsershot should implement their own input validation to block or sanitize file URI schemes in HTML content passed to the setHtml function. Monitoring vendor advisories for updates or patches is recommended.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- snyk
- Date Reserved
- 2025-02-04T10:20:48.623Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a57af5d68715ace430250c1
Added to database: 07/15/2026, 16:03:41 UTC
Last enriched: 08/13/2026, 18:07:16 UTC
Last updated: 09/10/2026, 19:36:49 UTC
Views: 68
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.