Improper Input Validation Affecting spatie/browsershot package, versions <5.0.5


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Input Validation vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-SPATIEBROWSERSHOT-8533024
  • published4 Feb 2025
  • disclosed16 Dec 2024
  • creditChua Jian Shen, Ee Yang Tee

Introduced: 16 Dec 2024

CVE-2025-1026  (opens in a new tab)
CWE-20  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade spatie/browsershot to version 5.0.5 or higher.

Overview

spatie/browsershot is a library for converting a webpage to an image or pdf using headless Chrome.

Affected versions of this package are vulnerable to Improper Input Validation due to improper URL validation through the setUrl method, which results in a Local File Inclusion allowing the attacker to read sensitive files.

Note:

This is a bypass of the fix for CVE-2024-21549.

PoC

<?php

require_once 'vendor/autoload.php';

use Spatie\Browsershot\Browsershot;

$a = 'file:
///etc/passwd';

Browsershot::url($a)->newHeadless()->save("./test.pdf");

CVSS Scores

version 4.0
version 3.1