CVE-2024-21549: Spatie/browsershot Browsershot Improper Input Validation Vulnerability Vulnerability
MODERATECVE-2024-21549 is a MODERATE (CVSS 8.6) browsershot improper input validation vulnerability vulnerability (CWE-125: Out-of-bounds Read) affecting Spatie/browsershot libraries in the Packagist ecosystem. The issue involves browsershot improper input validation vulnerability. Remediation is available by upgrading affected packages to version 5.0.3.
CVE-2024-21549 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N).
How to Fix CVE-2024-21549
To remediate this vulnerability, upgrade all affected Spatie/browsershot dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade spatie/browsershot to 5.0.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for spatie/browsershot
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-21549, inspect your project dependencies for Spatie/browsershot:
inspect dependencies for spatie/browsershot
Analyze the terminal output to locate any version of Spatie/browsershot in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Spatie/browsershot, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-21549 Affected Spatie/browsershot Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
spatie/browsershot
|
Packagist |
< 5.0.3
|
5.0.3
|
References
Frequently Asked Questions
What is CVE-2024-21549?
Which Spatie/browsershot versions are affected?
What version fixes CVE-2024-21549?
Is spatie/browsershot affected?
What is the CVSS score of CVE-2024-21549?
What CWE is associated with CVE-2024-21549?
How can I check Packagist dependencies for CVE-2024-21549?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c9f5-29f6-c35w",
"modified" : "2025-02-04T17:26:43Z",
"published" : "2024-12-20T06:30:45Z",
"aliases" : [ "CVE-2024-21549" ],
"summary" : "Browsershot Improper Input Validation vulnerability",
"details" : "Versions of the package spatie/browsershot before 5.0.3 are vulnerable to Improper Input Validation due to improper URL validation through the setUrl method. An attacker can exploit this vulnerability by utilizing view-source:file://, which allows for arbitrary file reading on a local file.\n\n**Note:**\n\nThis is a bypass of the fix for [CVE-2024-21544](https://security.snyk.io/vuln/SNYK-PHP-SPATIEBROWSERSHOT-8496745).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "spatie/browsershot"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.0.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21549"
}, {
"type" : "WEB",
"url" : "https://github.com/spatie/browsershot/commit/f791ce0ae8dd99367dbfa30588ee31e1196e1728"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/spatie/browsershot"
}, {
"type" : "WEB",
"url" : "https://github.com/spatie/browsershot/discussions/906"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-PHP-SPATIEBROWSERSHOT-8533023"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-125", "CWE-20", "CWE-200" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-12-20T15:08:54Z",
"nvd_published_at" : "2024-12-20T05:15:06Z"
}
}